From cb440a7026729d260e75fc727ffb8099b4c8b2be Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: 星期三, 03 八月 2022 17:26:02 +0800
Subject: [PATCH] 数据对接

---
 src/views/contingencyManagement/panManagement/index.vue |  177 ++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 97 insertions(+), 80 deletions(-)

diff --git a/src/views/contingencyManagement/panManagement/index.vue b/src/views/contingencyManagement/panManagement/index.vue
index 7c9717c..00c5926 100644
--- a/src/views/contingencyManagement/panManagement/index.vue
+++ b/src/views/contingencyManagement/panManagement/index.vue
@@ -84,19 +84,24 @@
                 <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="jumpFrom(0)">
+<!--            <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="onEdit('修改',scope.row.id)">
               <el-icon style="margin-right: 5px;">
                 <EditPen />
               </el-icon>修改
             </el-button>
-            <el-button  size="small" text type="primary" @click="abolish(0)">
-             发起审批
-            </el-button>
+<!--            <el-button size="small" text type="primary" @click="jumpFrom(0)">-->
+<!--              <el-icon style="margin-right: 5px;">-->
+<!--                <EditPen />-->
+<!--              </el-icon>修改-->
+<!--            </el-button>-->
+<!--            <el-button  size="small" text type="primary" @click="abolish(0)">-->
+<!--             发起审批-->
+<!--            </el-button>-->
             <el-button size="small" text type="primary" @click="onRowDel(scope.row.id)">
               <el-icon>
                 <Delete />
@@ -122,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>
@@ -154,7 +159,7 @@
   ElMessageBox,
   ElMessage,
 } from 'element-plus';
-import {useRouter} from "vue-router"
+// import {useRouter} from "vue-router"
 import type {
   // FormInstance,
 } from 'element-plus'
@@ -171,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";
@@ -181,7 +186,7 @@
   components: {
     OpenAdd,
     // StartUp,
-    AbolishLibrary,
+    // AbolishLibrary,
     EditPen,
     Plus,
     Edit,
@@ -230,26 +235,7 @@
     };
     const warning = ref(true);
     const danger = ref(true);
-    const deleteAll = ref();
-    const handleSelectionChange = (val: any) => {
-      let valId = JSON.parse(JSON.stringify(val));
-      let arr = [];
-      for (let i = 0; i < valId.length; i++) {
-        arr.push(valId[i].id);
-      }
-      deleteAll.value = arr.toString();
-      console.log(deleteAll.value);
-      if (val.length == 1) {
-        warning.value = false;
-        danger.value = false;
-      } else if (val.length == 0) {
-        warning.value = true;
-        danger.value = true;
-      } else {
-        warning.value = true;
-        danger.value = false;
-      }
-    };
+
 
     // 上传
     // const upShow=ref()
@@ -301,7 +287,7 @@
     // 打开新增用户弹窗
     const addRef = ref();
     const onOpenAdd = () => {
-      addRef.value.openDialog('新建应急预案管理');
+      addRef.value.openDialog('新建应急预案管理',false);
     };
     // 新增后刷新
     const onMyAdd = (e: boolean) => {
@@ -311,20 +297,31 @@
         onSubmit();
       }
     };
-    //打开废止库弹窗
-    const abolishRef = ref();
-    const onabolishLibrary = () => {
-      abolishRef.value.openDialog();
+    // 打开修改应急预案管理弹窗
+    const onEdit = (val: string, row: object) => {
+      if (val == '详情') {
+        addRef.value.openDialog('查看应急预案管理',row,true);
+      } else {
+        addRef.value.openDialog('修改应急预案管理',row,false);
+      }
     };
+
+    //打开废止库弹窗
+    // const abolishRef = ref();
+    // const onabolishLibrary = () => {
+    //   abolishRef.value.openDialog();
+    // };
     // 删除用户
-    const onRowDel = (data: any) => {
+    const onRowDel = (id: number) => {
+      let arr = [];
+      arr.push(id)
       ElMessageBox.confirm('确定删除所选项吗?', '提示', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning',
       }).then(() => {
         emergencyPlanApi()
-              .deleteEmergencyTeam(data)
+              .deleteEmergencyTeam(arr)
               .then((res) => {
                 if (res.data.code == 200) {
                   ElMessage({
@@ -344,6 +341,26 @@
               });
         }).catch(() => {});
     };
+
+    const deleteAll = ref();
+    const handleSelectionChange = (val: any) => {
+      let valId = JSON.parse(JSON.stringify(val));
+      let arr = [];
+      for (let i = 0; i < valId.length; i++) {
+        arr.push(valId[i].id);
+      }
+      deleteAll.value = arr;
+      if (val.length == 1) {
+        warning.value = false;
+        danger.value = false;
+      } else if (val.length == 0) {
+        warning.value = true;
+        danger.value = true;
+      } else {
+        warning.value = true;
+        danger.value = false;
+      }
+    };
 // 多选删除
     const onDeleteAll = () => {
       ElMessageBox.confirm('确定删除所选项吗?', '提示', {
@@ -353,24 +370,23 @@
       })
           .then(() => {
             emergencyPlanApi()
-                .deleteEmergencyTeam(deleteAll.value)
-                .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();
-                  }
-                });
+              .deleteEmergencyTeam(deleteAll.value)
+              .then((res) => {
+                if (res.data.code == 200) {
+                  ElMessage({
+                    message: res.data.msg,
+                    type: 'success',
+                  });
+                  onSubmit();
+                } else {
+                  ElMessage({
+                    showClose: true,
+                    message: res.data.msg,
+                    type: 'error',
+                  });
+                  onSubmit();
+                }
+              });
           })
           .catch(() => {});
     };
@@ -387,25 +403,25 @@
       listQuery.pageIndex = val;
     };
 
-    const router=useRouter()
+    // const router=useRouter()
     // 修改跳转
-    const jumpFrom=(data:string)=>{
-      router.push({
-        path:"/processForm",
-        query:{
-          type:data
-        }
-      })
-    }
+    // const jumpFrom=(data:string)=>{
+    //   router.push({
+    //     path:"/processForm",
+    //     query:{
+    //       type:data
+    //     }
+    //   })
+    // }
     // 发起审批跳转
-    const abolish=(data:string)=>{
-      router.push({
-        path:"/abolishDialog",
-        query:{
-          type:data
-        }
-      })
-    }
+    // const abolish=(data:string)=>{
+    //   router.push({
+    //     path:"/abolishDialog",
+    //     query:{
+    //       type:data
+    //     }
+    //   })
+    // }
     //全屏
     const full = ref(false);
     const toggleFullscreen = () => {
@@ -425,15 +441,15 @@
       tableData,
       onSubmit,
       onOpenAdd,  //新增
-      onabolishLibrary,
       addRef,
-      abolishRef,
+      // onabolishLibrary,
+      // abolishRef,
+      // abolish,
       onRowDel,
       onHandleSizeChange,
       onHandleCurrentChange,
-      jumpFrom,
-      abolish,
-      router,
+      // jumpFrom,
+      // router,
       toggleFullscreen,
       FullScreen,
       full,
@@ -455,6 +471,7 @@
       form,
       emit,
       onDetermine,
+      onEdit,
     };
   },
 });

--
Gitblit v1.9.2