Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/types/components.d.ts
Hwf před 1 rokem
rodič
revize
835f7c8f87

+ 4 - 3
src/api/riskPrevention/planManage.ts

@@ -15,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
   });
 }
 

+ 2 - 2
src/api/system/user/planList.ts

@@ -8,11 +8,11 @@ export const fetchReports = (params: PlanForm): AxiosPromise<FetchPlanResponse>
     url: '/api/emergency_plan/plan/list',
     method: 'get',
     params: {
-      page: params.pageNum, // 分页参数中的页码
+      /*page: params.pageNum, // 分页参数中的页码
       page_size: params.pageSize, // 分页参数中的每页大小
       plan_type: params.planType, // 预案类型(可选)
       publish_date: params.publish_date, // 发布日期范围(可选)
-      plan_name: params.planName // 预案名称(可选)
+      plan_name: params.planName // 预案名称(可选)*/
     }
   });
 };

+ 25 - 6
src/api/system/user/types.ts

@@ -108,7 +108,7 @@ export interface DrillVO {
 export interface DrillForm {
   pageNum: number;
   pageSize: number;
-  planId?: string;
+  planId?: number;
 }
 export interface DrillInfoVO {
   drill: DrillVO;
@@ -118,11 +118,30 @@ export interface FetchDrillResponse {
   data: DrillVO[];
   total: number;
 }
-// 定义获取预案列表接口的请求参数类型
-export interface QueryParams {
+//响应
+/**响应查询对象类型**/
+
+export interface ResponseQuery {
+  responseId?: string;
+}
+/**
+ * 响应返回对象
+ */
+export interface ResponseVO {
+  responseId: string;
+  eventName: string;
+  eventType: string;
+  responseUnit: string;
+  eventAddress: string;
+  responseLevel: string;
+  responseStartTime: string;
+  responseEndTime: string;
+}
+/**
+ * 响应表单类型
+ */
+export interface responseForm {
   pageNum: number;
   pageSize: number;
-  eventType?: string;
-  publishDate?: [string, string];
-  keyword?: string;
+  planId?: string;
 }

+ 1 - 1
src/views/knowledge/knowledge-management/detail.vue

@@ -156,7 +156,7 @@ onMounted(async () => {
       sourceUnit: data.publishingUnit,
       notificationType: data.notificationType,
       summary: data.summary,
-      attachmentName: data.file.length > 0 ? data.file[0].name : '',
+      attachmentName: data.file.length > 0 ? data.file[0].content : '',
       attachmentUrl: data.file.length > 0 ? data.file[0].url : ''
     };
   } catch (error) {

+ 0 - 3
src/views/knowledge/knowledge-management/index.vue

@@ -205,10 +205,7 @@ const getList = async () => {
     const [startDate, endDate] = queryParams.publishDate;
     const formattedStartDate = startDate ? startDate.replace(/-/g, '/') : '';
     const formattedEndDate = endDate ? endDate.replace(/-/g, '/') : '';
-    console.log('startDate:', startDate, 'endDate:', endDate);
     const publishDateRange = formattedStartDate && formattedEndDate ? `${formattedStartDate}-${formattedEndDate}` : '';
-    console.log('publishDateRange:', publishDateRange);
-
 
     // 构建新的请求参数对象
     const requestParams = {

+ 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();

+ 45 - 76
src/views/riskPrevention/planManage/planList.vue

@@ -180,7 +180,7 @@
                   删除
                 </el-button>
               </el-col>
-              <right-toolbar v-model:showSearch="showSearch" :columns="columns0" :search="true" @query-table="getList"></right-toolbar>
+              <right-toolbar v-model:showSearch="showSearch" :columns="columns0" :search="true" @query-table="getList2"></right-toolbar>
             </el-row>
             <drill :id="dialog3.id" v-model="dialog3.visible" @getlist="getList2" />
           </template>
@@ -253,13 +253,7 @@
             </el-table-column>
           </el-table>
 
-          <pagination
-            v-show="total2 > 0"
-            v-model:page="drillForm.pageNum"
-            v-model:limit="drillForm.pageSize"
-            :total="total2"
-            @pagination="getList2"
-          />
+          <pagination v-show="total2 > 0" v-model:page="drillForm.page" v-model:limit="drillForm.pageSize" :total="total2" @pagination="getList2" />
         </el-card>
       </el-col>
       <el-col :lg="30" :xs="24">
@@ -321,10 +315,10 @@
             </el-table-column>
           </el-table>
           <pagination
-            v-show="total > 0"
+            v-show="total4 > 0"
             v-model:page="queryParams.pageNum"
             v-model:limit="queryParams.pageSize"
-            :total="total"
+            :total="total4"
             @pagination="getListResponse"
           />
         </el-card>
@@ -509,7 +503,7 @@
 
 <script setup name="User" lang="ts">
 import api from '@/api/system/user';
-import { UserForm, UserQuery, UserVO, PlanVO, DrillVO, PlanForm } from '@/api/system/user/types';
+import { UserForm, UserQuery, UserVO, PlanVO, DrillVO, ResponseVO, PlanForm } from '@/api/system/user/types';
 import { DeptVO } from '@/api/system/dept/types';
 import { RoleVO } from '@/api/system/role/types';
 import { PostQuery, PostVO } from '@/api/system/post/types';
@@ -521,8 +515,9 @@ import type { TabsPaneContext } from 'element-plus';
 import { ArrowLeft } from '@element-plus/icons-vue';
 import { useRouter } from 'vue-router';
 import { reactive } from 'vue';
-import { getDrillList, getPlanDetail, getResponseDetail, getTrainingList } from "@/api/riskPrevention/planManage";
+import { getDrillList, getPlanDetail, getResponseDetail, getTrainingList } from '@/api/riskPrevention/planManage';
 import drill from './drill.vue';
+import { fetchReportDetail } from "@/api/kenowledge";
 const router = useRouter();
 
 const goBack = () => {
@@ -576,7 +571,6 @@ const loading4 = ref(false);
 const loading3 = ref(false);
 const total4 = ref(0);
 const total3 = ref(0);
-const planList = ref<PlanVO[]>();
 const drillList = ref<DrillVO[]>();
 const loading2 = ref(false);
 const total2 = ref(0);
@@ -589,10 +583,8 @@ 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[]>([]);
-const roleOptions = ref<RoleVO[]>([]);
 /*** 用户导入参数 */
 const upload = reactive<ImportOption>({
   // 是否显示弹出层(用户导入)
@@ -728,33 +720,25 @@ const initData: PageData<UserForm, UserQuery> = {
 };
 const data = reactive<PageData<UserForm, UserQuery>>(initData);
 
+
 const { queryParams, form2, rules } = toRefs<PageData<UserForm, UserQuery>>(data);
-const drillForm = reactive({
-  page: 1,
+//演练
+const drillForm = reactive<DrillForm>({
+  pageNum: 1,
   pageSize: 10,
-  planNum: ''
+  planNum: 'YJYA0000000001'
 });
+//培训
 const queryParams3 = reactive({
   page: 1,
   pageSize: 10,
-  planNum: ''
+  planNum: 'YJYA0000000001'
 });
+//响应
 const responseParams = reactive({
-  page: 1,
+  pageNum: 1,
   pageSize: 10,
-  planNum: ''
-});
-
-const form = reactive<DrillVO>({
-  drillId: '',
-  drillName: '',
-  drillUnit: '',
-  year: '',
-  drillTime: '',
-  drillAddress: '',
-  drillProject: '',
-  drillVideo: '',
-  drillPicture: ''
+  planId: 'YJYA0000000001'
 });
 
 /** 通过条件过滤节点  */
@@ -772,44 +756,34 @@ watchEffect(
   }
 );
 
-/** 查询培训内容下拉树结构 */
-const getTreeSelect = async () => {
-  const res = await api.deptTreeSelect();
-  deptOptions.value = res.data;
-};
-
 /** 查询培训列表 */
-const getList = async () => {
-  loading.value = true;
-  const res = await api.listUser(proxy?.addDateRange(queryParams.value, dateRange.value));
-  loading.value = false;
-  userList.value = res.rows;
-  total.value = res.total;
+const getList3 = async () => {
+  loading3.value = true;
+  const res = await getTrainingList(queryParams3);
+  loading3.value = false;
+  userList.value = res.data;
+  total3.value = res.total;
 };
 /** 查询演练列表 */
+/*const getList2 = async () => {
+  loading2.value = true;
+  const res = await api.listDrill(proxy?.addDateRange(drillForm.value, dateRange.value));
+  loading2.value = false;
+  drillList.value = res.rows;
+  total2.value = res.total;
+};*/
 const getList2 = async () => {
   loading2.value = true;
   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;
 };
-/** 查询培训列表 */
-const getList3 = async () => {
-  loading3.value = true;
-  const res = await getTrainingList(queryParams3);
-  loading3.value = false;
-  // res.data.forEach(item => {
-  //   item.drillPicture = item.drillPicture[0].file_name_desc
-  //   item.drillVideo = item.drillVideo[0].file_name_desc
-  // })
-  userList.value = res.data;
-  total3.value = res.total;
-};
+
 /** 查询响应列表 */
 /**const getListResponse = async () => {
   loading4.value = true;
@@ -835,7 +809,7 @@ const handleDelete = async (row?: UserVO) => {
   const [err] = await to(proxy?.$modal.confirm('是否确认删除记录编号为"' + textIds + '"的数据项?') as any);
   if (!err) {
     await api.delUser(textIds);
-    await getList();
+    await getList3();
     proxy?.$modal.msgSuccess('删除成功');
   }
 };
@@ -888,7 +862,7 @@ const handleFileSuccess = (response: any, file: UploadFile) => {
   ElMessageBox.alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {
     dangerouslyUseHTMLString: true
   });
-  getList();
+  getList3();
 };
 
 /** 提交上传文件 */
@@ -896,15 +870,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 };
@@ -923,7 +888,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);
 };
 
@@ -934,7 +898,7 @@ const submitForm = () => {
       form.value.textId ? await api.updateUser(form.value) : await api.addUser(form.value);
       proxy?.$modal.msgSuccess('操作成功');
       dialog.visible = false;
-      await getList();
+      await getList3();
     }
   });
 };
@@ -962,9 +926,16 @@ const handleAdd = async () => {
   dialog.visible = true;
   dialog.title = '新增培训记录';
 };
+
 let detailData = ref({
-  file_list: []
+  planId: '',
+  planName: '',
+  planType: '',
+  publish_date: '',
+  organUnit: '',
+  document: '',
 });
+
 onMounted(() => {
   const planId = route.query.planId;
   drillForm.planNum = planId;
@@ -972,8 +943,6 @@ onMounted(() => {
   getPlanDetail(planId).then((res) => {
     detailData.value = res.data;
   });
-  getTreeSelect(); // 初始化培训内容数据
-  getList(); // 初始化列表数据
   getList2(); // 初始化列表数据
   getList3(); // 初始化列表数据
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
@@ -1023,7 +992,7 @@ const drillDelete = async (row?: DrillVO) => {
   const [err] = await to(proxy?.$modal.confirm('是否确认删除记录编号为"' + drillIds + '"的数据项?') as any);
   if (!err) {
     await api.delPlan(drillIds);
-    await getList();
+    await getList3();
     proxy?.$modal.msgSuccess('删除成功');
   }
 };