From 44dae1108f8bc7134fbbc39a09c581bf3c4e0bb2 Mon Sep 17 00:00:00 2001 From: 13937891274 <kxc0822> Date: 星期四, 04 八月 2022 16:47:42 +0800 Subject: [PATCH] 数据对接 --- src/views/contingencyManagement/panManagement/index.vue | 68 ++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/views/contingencyManagement/panManagement/index.vue b/src/views/contingencyManagement/panManagement/index.vue index 00c5926..366470d 100644 --- a/src/views/contingencyManagement/panManagement/index.vue +++ b/src/views/contingencyManagement/panManagement/index.vue @@ -84,11 +84,11 @@ <VideoPlay /> </el-icon>启动 </el-button> -<!-- <el-button size="small" text type="primary" @click="abolish(0)">--> -<!-- <el-icon style="margin-right: 5px;">--> -<!-- <VideoPause />--> -<!-- </el-icon>废止--> -<!-- </el-button>--> + <el-button size="small" text type="primary" @click="abolish"> + <el-icon style="margin-right: 5px;"> + <VideoPause /> + </el-icon>废止 + </el-button> <el-button size="small" text type="primary" @click="onEdit('修改',scope.row.id)"> <el-icon style="margin-right: 5px;"> <EditPen /> @@ -127,7 +127,7 @@ </div> </el-card> <OpenAdd ref="addRef" @myAdd="onMyAdd"/> -<!-- <AbolishLibrary ref="abolishRef"/>--> + <AbolishLibrary ref="abolishRef"/> <!-- <StartUp ref="startRef" @myAdd="startUp"/>--> <el-dialog v-model="dialogFormVisible" width="30%" title="启动" :fullscreen="full"> <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> @@ -176,7 +176,7 @@ } from '@element-plus/icons-vue' import OpenAdd from '/@/views/contingencyManagement/panManagement/component/openAdd.vue'; // import StartUp from '/@/views/contingencyManagement/panManagement/component/startUp.vue'; -// import AbolishLibrary from '/@/views/contingencyManagement/panManagement/component/abolishLibrary.vue'; +import AbolishLibrary from '/@/views/contingencyManagement/panManagement/component/abolishLibrary.vue'; // import UpData from '/@/views/contingencyManagement/panManagement/component/upData.vue'; import {emergencyPlanApi} from "/@/api/emergencyPlan"; import {emergencyPlanLogApi} from "/@/api/emergencyPlanLog"; @@ -186,7 +186,7 @@ components: { OpenAdd, // StartUp, - // AbolishLibrary, + AbolishLibrary, EditPen, Plus, Edit, @@ -207,6 +207,7 @@ searchParams: { name: "", type: "", + abolishStatus: false, } }) // 定义表格数据 @@ -276,14 +277,6 @@ remark: '', } } - // 新增后刷新 - // const startUp = (e: boolean) => { - // if (e) { - // onSubmit(); - // } else { - // onSubmit(); - // } - // }; // 打开新增用户弹窗 const addRef = ref(); const onOpenAdd = () => { @@ -307,10 +300,39 @@ }; //打开废止库弹窗 - // const abolishRef = ref(); - // const onabolishLibrary = () => { - // abolishRef.value.openDialog(); - // }; + const abolishRef = ref(); + const onabolishLibrary = () => { + abolishRef.value.openDialog(); + }; + // 废止 + const abolish = (data: any) => { + ElMessageBox.confirm('确定要废止所选项吗?', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + emergencyPlanApi() + .EmergencyTeam(data) + .then((res) => { + if (res.data.code == 200) { + ElMessage({ + showClose: true, + message: res.data.msg, + type: 'success', + }); + onSubmit(); + } else { + ElMessage({ + showClose: true, + message: res.data.msg, + type: 'error', + }); + onSubmit(); + } + }); + }).catch(() => {}); + }; + // 删除用户 const onRowDel = (id: number) => { let arr = []; @@ -442,9 +464,9 @@ onSubmit, onOpenAdd, //新增 addRef, - // onabolishLibrary, - // abolishRef, - // abolish, + onabolishLibrary, + abolishRef, + abolish, onRowDel, onHandleSizeChange, onHandleCurrentChange, -- Gitblit v1.9.2