zhangyihao před 1 rokem
rodič
revize
648080e6c2

+ 5 - 8
src/api/riskPrevention/planManage.ts

@@ -4,11 +4,7 @@ export function getDrillList(params) {
   return request({
     url: '/api/emergency_plan/drill/list',
     method: 'get',
-    params: {
-      page: params.pageNum, // 分页参数中的页码
-      page_size: params.pageSize, // 分页参数中的每页大小
-      planNum: params.planId // 预案编号
-    }
+    params: params
   });
 }
 export function getTrainingList(params) {
@@ -19,10 +15,11 @@ export function getTrainingList(params) {
   });
 }
 
-export function getPlanDetail(planId) {
+export function getPlanDetail(params) {
   return request({
-    url: '/api/emergency_plan/plan/' + planId,
-    method: 'get'
+    url: '/api/emergency_plan/plan/list',
+    method: 'get',
+    params: params
   });
 }
 

+ 0 - 8
src/types/components.d.ts

@@ -41,9 +41,7 @@ declare module 'vue' {
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
-    ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
-    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElLink: typeof import('element-plus/es')['ElLink']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@@ -51,8 +49,6 @@ declare module 'vue' {
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
     ElProgress: typeof import('element-plus/es')['ElProgress']
-    ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
@@ -62,18 +58,14 @@ declare module 'vue' {
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
-    ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
-    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
     HeaderSearch: typeof import('./../components/HeaderSearch/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
-    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
-    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']

+ 17 - 10
src/views/riskPrevention/planManage/index.vue

@@ -120,6 +120,7 @@ import ChunkUpload from '@/components/ChunkUpload/index.vue';
 import { getDicts } from '@/api/system/dict/data';
 
 import { useRouter } from 'vue-router';
+import { getPlanDetail, getTrainingList } from "@/api/riskPrevention/planManage";
 
 const router = useRouter();
 const demoFormRef = ref(null);
@@ -167,19 +168,25 @@ const dialog = reactive({
   title: ''
 });
 
+// const getList = async () => {
+//   loading.value = true;
+//   try {
+//     const response = await fetchReports(planForm);
+//     demoList.value = response.data;
+//     total.value = response.total;
+//   } catch (error) {
+//     console.error('获取数据时出错:', error);
+//   } finally {
+//     loading.value = false;
+//   }
+// };
 const getList = async () => {
   loading.value = true;
-  try {
-    const response = await fetchReports(planForm);
-    demoList.value = response.data;
-    total.value = response.total;
-  } catch (error) {
-    console.error('获取数据时出错:', error);
-  } finally {
-    loading.value = false;
-  }
+  const res = await getPlanDetail(planForm);
+  loading.value = false;
+  demoList.value = res.data;
+  total.value = res.total;
 };
-
 const handleQuery = () => {
   planForm.pageNum = 1;
   getList();

+ 4 - 21
src/views/riskPrevention/planManage/planList.vue

@@ -582,7 +582,6 @@ const multiple = ref(true);
 const total = ref(0);
 const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
 const Content = ref('');
-const deptOptions = ref<DeptVO[]>([]);
 const initPassword = ref<string>('');
 const postOptions = ref<PostVO[]>([]);
 /*** 用户导入参数 */
@@ -725,7 +724,7 @@ const { queryParams, form2, rules } = toRefs<PageData<UserForm, UserQuery>>(data
 const drillForm = reactive<DrillForm>({
   pageNum: 1,
   pageSize: 10,
-  planId: 'YJYA0000000001'
+  planNum: 'YJYA0000000001'
 });
 //培训
 const queryParams3 = reactive({
@@ -754,12 +753,6 @@ watchEffect(
   }
 );
 
-/** 查询培训内容下拉树结构 */
-const getTreeSelect = async () => {
-  const res = await api.deptTreeSelect();
-  deptOptions.value = res.data;
-};
-
 /** 查询培训列表 */
 const getList3 = async () => {
   loading3.value = true;
@@ -781,8 +774,8 @@ const getList2 = async () => {
   const res = await getDrillList(drillForm);
   loading2.value = false;
   res.data.forEach((item) => {
-    item.drillPicture = item.drillPicture[0].file_name_desc;
-    item.drillVideo = item.drillVideo[0].file_name_desc;
+    item.drillPicture = item.drillPicture[0]?.file_name_desc;
+    item.drillVideo = item.drillVideo[0]?.file_name_desc;
   });
   drillList.value = res.data;
   total2.value = res.total;
@@ -874,15 +867,6 @@ function submitFileForm() {
   uploadRef.value?.submit();
 }
 
-/** 初始化培训内容数据 */
-const initTreeData = async () => {
-  // 判断培训内容的数据是否存在,存在不获取,不存在则获取
-  if (deptOptions.value === undefined) {
-    const { data } = await treeselect();
-    deptOptions.value = data;
-  }
-};
-
 /** 重置操作表单 */
 const reset = () => {
   form.value = { ...initFormData };
@@ -901,7 +885,6 @@ const handleUpdate = async (row?: UserForm) => {
   //const { data } = await api.getUser(textId);
   dialog.visible = true;
   dialog.title = '修改培训记录';
-  await initTreeData();
   Object.assign(form.value, data.user);
 };
 
@@ -940,6 +923,7 @@ const handleAdd = async () => {
   dialog.visible = true;
   dialog.title = '新增培训记录';
 };
+
 let detailData = ref({
   file_list: []
 });
@@ -950,7 +934,6 @@ onMounted(() => {
   getPlanDetail(planId).then((res) => {
     detailData.value = res.data;
   });
-  getTreeSelect(); // 初始化培训内容数据
   getList2(); // 初始化列表数据
   getList3(); // 初始化列表数据
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {