Просмотр исходного кода

@
feat: 费控编辑页回显使用规则 + 清理调试日志

InstitutionForm 编辑模式底部添加 RuleList 组件展示关联规则。
@

alphaH 15 часов назад
Родитель
Сommit
76a32a93fa

+ 1 - 5
frontend/src/components/CURD/PageContent.vue

@@ -909,7 +909,6 @@ function getIndexActionErrorMessage(err: unknown): string {
 }
 
 function fetchPageData(formData: IObject = {}, isRestart = false) {
-  console.log('[PageContent] fetchPageData called, showPagination:', showPagination, 'hasIndexAction:', typeof props.contentConfig?.indexAction);
   loading.value = true;
   // 上一次搜索条件
   lastFormData = formData;
@@ -928,20 +927,18 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
         : formData
     )
     .then((data) => {
-      console.log('[PageContent] indexAction resolved, data:', JSON.stringify(data));
       if (showPagination) {
         if (props.contentConfig.parseData) {
           data = props.contentConfig.parseData(data);
         }
         pagination.total = data.total;
         pageData.value = data.list;
-        console.log('[PageContent] pageData set, count:', pageData.value.length);
       } else {
         pageData.value = data;
       }
     })
     .catch((err: unknown) => {
-      console.error('[PageContent] indexAction error:', err);
+      console.error(err);
       ElMessage.error(getIndexActionErrorMessage(err));
     })
     .finally(() => {
@@ -949,7 +946,6 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
     });
 }
 if (props.contentConfig.initialFetch !== false) {
-  console.log('[PageContent] initial fetch triggered');
   fetchPageData();
 }
 

+ 6 - 0
frontend/src/views/module_payment/institution/components/InstitutionForm.vue

@@ -215,6 +215,11 @@
       </el-row>
     </el-form>
 
+    <template v-if="props.type === 'update' && props.institutionId">
+      <el-divider content-position="left">使用规则</el-divider>
+      <RuleList :institution-id="props.institutionId" />
+    </template>
+
     <EmployeeSelector v-model:visible="showEmployeeSelector" :selected-ids="formData.employee_ids"
       :enterprise-id="formData.enterprise_id" @confirm="handleEmployeeConfirm" />
   </div>
@@ -232,6 +237,7 @@ import DepartmentAPI from "@/api/module_payment/department";
 import { useEnterpriseStore } from "@/store/modules/enterprise.store";
 import { reactive, ref, watch, computed, onMounted } from "vue";
 import EmployeeSelector from "./EmployeeSelector.vue";
+import RuleList from "./RuleList.vue";
 
 interface Props {
   type: "create" | "update";

+ 4 - 7
frontend/src/views/module_payment/rule/index.vue

@@ -266,7 +266,6 @@ const contentConfig = reactive<IContentConfig<RulePageQuery>>({
     institution_id: institutionIdFromUrl.value,
   })) as Record<string, unknown>,
   indexAction: async (params) => {
-    console.log('[rule] indexAction called, params:', JSON.stringify(params));
     const query: RulePageQuery = {
       page_no: params.page_no,
       page_size: params.page_size,
@@ -274,12 +273,10 @@ const contentConfig = reactive<IContentConfig<RulePageQuery>>({
     if (params.institution_id) query.institution_id = params.institution_id;
     if (params.name) query.name = params.name;
     const res = await RuleAPI.listRule(query);
-    console.log('[rule] raw res.data:', JSON.stringify(res.data));
-    console.log('[rule] res.data.data:', JSON.stringify(res.data.data));
-    const list = res.data.data?.items || res.data.data?.list || [];
-    const total = res.data.data?.total || 0;
-    console.log('[rule] extracted list:', list.length, 'total:', total);
-    return { list, total };
+    return {
+      list: res.data.data?.items || res.data.data?.list || [],
+      total: res.data.data?.total || 0,
+    };
   },
 });