zhangyihao hai 9 meses
pai
achega
7c65e7d78d

+ 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'
+  });
+}

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

@@ -18,7 +18,8 @@ import {
   ResponseForm,
   ResponseVO,
   ResponseQuery,
-  ResponseInfoVO
+  ResponseInfoVO,
+  AddUserParams
 } from './types';
 import { parseStrEmpty } from '@/utils/ruoyi';
 
@@ -72,9 +73,9 @@ export const optionSelect = (userIds: (number | string)[]): AxiosPromise<UserVO[
 
 /**
  * 获取培训详情
- * @param textId
+ * @param userId
  */
-export const getUser = (textId?: string | number): AxiosPromise<UserInfoVO> => {
+export const getUser = (userId?: string | number): AxiosPromise<UserInfoVO> => {
   return request({
     url: '/api/emergency_plan/training/create',
     method: 'post',
@@ -123,7 +124,7 @@ export const getResponse = (drillId?: string | number): AxiosPromise<ResponseInf
 /**
  * 新增培训
  */
-export const addUser = (data: UserForm) => {
+export const addUser = (data: AddUserParams) => {
   return request({
     url: '/api/emergency_plan/training/create',
     method: 'post',
@@ -154,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;
 }

+ 25 - 7
src/views/riskPrevention/planManage/planList.vue

@@ -266,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
@@ -521,8 +521,8 @@ 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 { getDrillList, getPlanDetail, getResponseDetail, getTrainingList } from "@/api/riskPrevention/planManage";
+import drill from './drill.vue';
 const router = useRouter();
 
 const goBack = () => {
@@ -572,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[]>();
@@ -668,7 +670,7 @@ const initFormData: UserForm = {
 };
 
 const initData: PageData<UserForm, UserQuery> = {
-  form: { ...initFormData },
+  form2: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
@@ -737,6 +739,11 @@ const queryParams3 = reactive({
   pageSize: 10,
   planNum: ''
 });
+const responseParams = reactive({
+  page: 1,
+  pageSize: 10,
+  planNum: ''
+});
 
 const form = reactive<DrillVO>({
   drillId: '',
@@ -804,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) => {