Kaynağa Gözat

fix: 更新表单和表格配置,修改标签名称,添加反馈和下发数模板

sunqijun 2 ay önce
ebeveyn
işleme
3753f8c623

+ 2 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagement/configs/form.ts

@@ -4,7 +4,7 @@ import { FormConfig } from '@/types/basic-form';
 export const DRAW_LESSONS_FORM_CONFIG: FormConfig[] = [
   {
     prop: 'dangerId',
-    label: '隐患名称:',
+    label: '隐患问题:',
     slot: 'dangerId',
     componentProps: {
       placeholder: '请选择隐患',
@@ -13,7 +13,7 @@ export const DRAW_LESSONS_FORM_CONFIG: FormConfig[] = [
   },
   {
     prop: 'associationOneThree',
-    label: '举一反三内容:',
+    label: '举一反三要求:',
     component: 'ElInput',
     componentProps: {
       placeholder: '请输入举一反三具体内容和要求',

+ 2 - 0
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagement/configs/tables.ts

@@ -54,12 +54,14 @@ export const DRAW_LESSONS_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '下发数',
     prop: 'issueCount',
+    slot: 'issueCount',
     align: 'center',
     width: '90px',
   },
   {
     label: '反馈人数',
     prop: 'feedbackCount',
+    slot: 'feedbackCount',
     align: 'center',
     width: '90px',
   },

+ 32 - 12
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagement/oneByOneManagement.vue

@@ -71,6 +71,12 @@
             <template #status="scope">
               <span>{{ scope.row.statusName || '-' }}</span>
             </template>
+            <template #issueCount="scope">
+              <span>{{ scope.row.issueCount || '-' }}</span>
+            </template>
+            <template #feedbackCount="scope">
+              <span>{{ scope.row.feedbackCount || '-' }}</span>
+            </template>
             <template #feedbackRatio="scope">
               <span>{{ scope.row.feedbackRatio ?? (scope.row.issueCount ? `${scope.row.feedbackCount ?? 0}/${scope.row.issueCount}` : '-') }}</span>
             </template>
@@ -145,10 +151,8 @@
             @change="onIssueGroupChange"
           >
             <el-option
-              v-for="d in groupOptions"
-              :key="d.id"
-              :label="d.deptName"
-              :value="d.id"
+              v-for="item in groupOptions"
+              :key="item.id" :label="item.name" :value="item.id"
             />
           </el-select>
         </el-form-item>
@@ -211,7 +215,7 @@
   import { downloadByData } from '@/utils/file/download';
   import { useGlobSetting } from '@/hooks/setting';
   import urlJoin from 'url-join';
-
+  import { queryUserGroupPage } from '@/api/system/person-group';
   const router = useRouter();
 
   // 表格
@@ -412,16 +416,32 @@
     return list;
   }
 
-  async function loadGroupOptions() {
+
+  // 获取用户组列表(用于下发时选择用户名称)
+  const getUserGroupOptions = async () => {
     try {
-      const res = await getAllDepartments();
-      const tree = (res as DeptTree[]) ?? [];
-      groupOptions.value = flattenDeptTree(Array.isArray(tree) && tree[0]?.children ? tree[0].children : tree);
+      const res = await queryUserGroupPage({
+        pageNumber: 1,
+        pageSize: 9999,
+        queryParam: '',
+      });
+      groupOptions.value = res?.records ?? [];
     } catch (e) {
-      console.error('获取分组列表失败:', e);
+      console.error('获取用户组列表失败:', e);
       groupOptions.value = [];
     }
-  }
+  };
+
+//   async function loadGroupOptions() {
+//     try {
+//       const res = await getAllDepartments();
+//       const tree = (res as DeptTree[]) ?? [];
+//       groupOptions.value = flattenDeptTree(Array.isArray(tree) && tree[0]?.children ? tree[0].children : tree);
+//     } catch (e) {
+//       console.error('获取分组列表失败:', e);
+//       groupOptions.value = [];
+//     }
+//   }
 
   function onIssueGroupChange(deptId: number) {
     const d = groupOptions.value.find((x) => x.id === deptId);
@@ -480,7 +500,7 @@
   };
 
   onMounted(() => {
-    loadGroupOptions();
+    getUserGroupOptions();
     getTableData();
   });
 </script>