Jelajahi Sumber

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

愿你天天开心 1 tahun lalu
induk
melakukan
3ddaae432f

+ 7 - 0
src/api/riskPrevention/planManage.ts

@@ -21,3 +21,10 @@ export function getPlanDetail(planId) {
     method: 'get'
   });
 }
+
+export function getResponseDetail(responseId) {
+  return request({
+    url: '/api/emergency_plan/plan/' + responseId,
+    method: 'get'
+  });
+}

+ 19 - 8
src/api/system/user/index.ts

@@ -18,7 +18,8 @@ import {
   ResponseForm,
   ResponseVO,
   ResponseQuery,
-  ResponseInfoVO
+  ResponseInfoVO,
+  AddUserParams
 } from './types';
 import { parseStrEmpty } from '@/utils/ruoyi';
 
@@ -76,8 +77,18 @@ export const optionSelect = (userIds: (number | string)[]): AxiosPromise<UserVO[
  */
 export const getUser = (userId?: string | number): AxiosPromise<UserInfoVO> => {
   return request({
-    url: '/system/user/' + parseStrEmpty(userId),
-    method: 'get'
+    url: '/api/emergency_plan/training/create',
+    method: 'post',
+    params: {
+      theme: params.theme, // 培训主题
+      unitName: params.unitName, // 培训单位
+      address: params.address, // 培训地点
+      startTime: params.startTime, // 开始时间
+      endTime: params.endTime, // 结束时间
+      peopleNum: params.peopleNum, // 参与人数
+      Content: params.Content, // 培训内容
+      trainingWay: params.trainingWay // 培训方式
+    }
   });
 };
 /**
@@ -113,9 +124,9 @@ export const getResponse = (drillId?: string | number): AxiosPromise<ResponseInf
 /**
  * 新增培训
  */
-export const addUser = (data: UserForm) => {
+export const addUser = (data: AddUserParams) => {
   return request({
-    url: '/system/user',
+    url: '/api/emergency_plan/training/create',
     method: 'post',
     data: data
   });
@@ -144,10 +155,10 @@ export const addDrill = (data: DrillForm) => {
 /**
  * 修改培训
  */
-export const updateUser = (data: UserForm) => {
+export const updateUser = (data: AddUserParams) => {
   return request({
-    url: '/system/user',
-    method: 'put',
+    url: '/api/emergency_plan/training/create',
+    method: 'post',
     data: data
   });
 };

+ 10 - 2
src/api/system/user/types.ts

@@ -24,7 +24,6 @@ export interface UserVO {
  * 培训记录表单类型
  */
 export interface UserForm {
-  id?: string;
   textId?: string;
   theme: string;
   unitName?: string;
@@ -35,7 +34,16 @@ export interface UserForm {
   peopleNum?: string;
   trainingWay?: string;
 }
-
+export interface AddUserParams {
+  theme: string;
+  unitName: string;
+  address: string;
+  startTime: string;
+  endTime: string;
+  Content: string;
+  peopleNum: string;
+  trainingWay: string;
+}
 export interface UserInfoVO {
   user: UserVO;
 }

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

@@ -16,21 +16,15 @@ declare module 'vue' {
     CompanyMap: typeof import('./../components/Map/company-map.vue')['default']
     DictTag: typeof import('./../components/DictTag/index.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
-    ElAnchor: typeof import('element-plus/es')['ElAnchor']
-    ElAnchorLink: typeof import('element-plus/es')['ElAnchorLink']
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
     ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
     ElButton: typeof import('element-plus/es')['ElButton']
-    ElCard: typeof import('element-plus/es')['ElCard']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
-    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
-    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -43,7 +37,6 @@ declare module 'vue' {
     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,34 +44,20 @@ 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']
-    ElStep: typeof import('element-plus/es')['ElStep']
-    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     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']
-    ElTimeline: typeof import('element-plus/es')['ElTimeline']
-    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     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']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 48 - 31
src/views/riskPrevention/planManage/planList.vue

@@ -7,12 +7,9 @@
           <el-button type="primary" icon="ArrowLeft" @click="goBack">返回上一级</el-button>
         </el-form-item>
         <el-row :span="24" :gutter="10">
-          <el-col :span="18" label="预案名称">
+          <el-col :span="20" label="预案名称">
             <h2 key="planName" style="font-weight: bolder">{{ detailData.planName }}</h2>
           </el-col>
-          <el-col :span="1.5">
-            <el-button v-has-permi="['system:plan:add']" type="primary" plain icon="Plus" @click="planAdd()">新增</el-button>
-          </el-col>
           <el-col :span="1.5">
             <el-button v-has-permi="['system:plan:add']" type="success" plain icon="Edit" @click="planUpdate()"> 编辑 </el-button>
           </el-col>
@@ -26,7 +23,9 @@
         <div style="white-space: nowrap">
           <el-text :lg="15" class="mx-1">附件</el-text>
           <el-text :lg="15" class="mx-2" type="primary">
-            <a v-if="detailData.file_list && detailData.file_list[0]" :href="detailData.file_list[0].file_url">{{ detailData.file_list[0].file_name_desc }}</a>
+            <a v-if="detailData.file_list && detailData.file_list[0]" :href="detailData.file_list[0].file_url">{{
+              detailData.file_list[0].file_name_desc
+            }}</a>
           </el-text>
         </div>
         <el-card style="margin-top: 10px" shadow="hover">
@@ -267,7 +266,7 @@
         <!-- 响应记录 -->
         <h3>响应记录</h3>
         <el-card shadow="hover">
-          <el-table v-loading="loading" @selection-change="handleSelectionChangeResponse">
+          <el-table v-loading="loading4" @selection-change="handleSelectionChangeResponse">
             <el-table-column type="selection" width="50" align="center" />
             <el-table-column v-if="columns1[0].visible" key="eventId" label="事件编号" align="center" prop="eventId" />
             <el-table-column
@@ -510,7 +509,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, 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,9 +520,9 @@ import { optionselect } from '@/api/system/post';
 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, getTrainingList } from '@/api/riskPrevention/planManage';
-
+import { reactive } from 'vue';
+import { getDrillList, getPlanDetail, getResponseDetail, getTrainingList } from "@/api/riskPrevention/planManage";
+import drill from './drill.vue';
 const router = useRouter();
 
 const goBack = () => {
@@ -573,7 +572,9 @@ const route = useRoute();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { sys_normal_disable, sys_user_sex } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_user_sex'));
 const userList = ref<UserVO[]>();
+const loading4 = ref(false);
 const loading3 = ref(false);
+const total4 = ref(0);
 const total3 = ref(0);
 const planList = ref<PlanVO[]>();
 const drillList = ref<DrillVO[]>();
@@ -669,7 +670,7 @@ const initFormData: UserForm = {
 };
 
 const initData: PageData<UserForm, UserQuery> = {
-  form: { ...initFormData },
+  form2: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
@@ -738,6 +739,11 @@ const queryParams3 = reactive({
   pageSize: 10,
   planNum: ''
 });
+const responseParams = reactive({
+  page: 1,
+  pageSize: 10,
+  planNum: ''
+});
 
 const form = reactive<DrillVO>({
   drillId: '',
@@ -785,10 +791,10 @@ 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
-  })
+  res.data.forEach((item) => {
+    item.drillPicture = item.drillPicture[0].file_name_desc;
+    item.drillVideo = item.drillVideo[0].file_name_desc;
+  });
   drillList.value = res.data;
   total2.value = res.total;
 };
@@ -805,12 +811,23 @@ const getList3 = async () => {
   total3.value = res.total;
 };
 /** 查询响应列表 */
-const getListResponse = async () => {
-  loading.value = true;
+/**const getListResponse = async () => {
+  loading4.value = true;
   const res = await api.listResponse(proxy?.addDateRange(queryParams.value, dateRange.value));
-  loading.value = false;
+  loading4.value = false;
   responseList.value = res.rows;
   total.value = res.total;
+};*/
+const getListResponse = async () => {
+  loading4.value = true;
+  const res = await getResponseDetail(responseParams);
+  loading4.value = false;
+  // res.data.forEach(item => {
+  //   item.drillPicture = item.drillPicture[0].file_name_desc
+  //   item.drillVideo = item.drillVideo[0].file_name_desc
+  // })
+  responseList.value = res.data;
+  total4.value = res.total;
 };
 /** 删除按钮操作 */
 const handleDelete = async (row?: UserVO) => {
@@ -902,8 +919,8 @@ const cancel = () => {
 /** 修改按钮操作 */
 const handleUpdate = async (row?: UserForm) => {
   reset();
-  const textId = row?.textId || ids.value[0];
-  const { data } = await api.getUser(textId);
+  //const textId = row?.textId || ids.value[0];
+  //const { data } = await api.getUser(textId);
   dialog.visible = true;
   dialog.title = '修改培训记录';
   await initTreeData();
@@ -941,20 +958,20 @@ const resetForm = () => {
 /** 新增按钮操作 */
 const handleAdd = async () => {
   reset();
-  const { data } = await api.getUser();
+  //const { data } = await api.getUser();
   dialog.visible = true;
   dialog.title = '新增培训记录';
 };
-let detailData =ref({
+let detailData = ref({
   file_list: []
-})
+});
 onMounted(() => {
-  const planId = route.query.planId
-  drillForm.planNum = planId
-  queryParams3.planNum = planId
-  getPlanDetail(planId).then(res => {
-    detailData.value = res.data
-  })
+  const planId = route.query.planId;
+  drillForm.planNum = planId;
+  queryParams3.planNum = planId;
+  getPlanDetail(planId).then((res) => {
+    detailData.value = res.data;
+  });
   getTreeSelect(); // 初始化培训内容数据
   getList(); // 初始化列表数据
   getList2(); // 初始化列表数据
@@ -969,11 +986,11 @@ async function handleDeptChange(value: number | string) {
   postOptions.value = response.data;
 }
 
-/** 新增预案按钮操作 */
+/** 新增预案按钮操作
 const planAdd = () => {
   dialog0.visible = true;
   dialog0.id = '';
-};
+};*/
 /** 修改预案按钮操作 */
 const planUpdate = (row) => {
   dialog1.visible = true;