Browse Source

安全检查界面优化

jiawuxian 2 năm trước cách đây
mục cha
commit
4684ca4f51

+ 25 - 15
src/views/safetycheck/rule/index.vue

@@ -121,7 +121,7 @@
             v-if="columns[5].visible"
           ></el-table-column>
           <el-table-column label="操作">
-            <template slot-scope="r" v-if="orgId==r.row.orgId">
+            <template slot-scope="r" v-if="orgId == r.row.orgId">
               <el-button
                 size="mini"
                 type="text"
@@ -130,12 +130,16 @@
                 v-hasPermi="['safetycheck:rule:edit']"
                 >编辑</el-button
               >
-              <el-popconfirm
-                title="确定删除检查内容库定义?"
-                @confirm="onDel(r.row.id)"
+              <el-button
+                type="text"
+                size="small"
+                slot="reference"
+                icon="el-icon-delete"
+                @click="onDel(r.row.id)"
+                v-if="orgId == r.row.orgId"
+                v-hasPermi="['safetycheck:rule:remove']"
+                >删除</el-button
               >
-                <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['safetycheck:rule:remove']">删除</el-button>
-              </el-popconfirm>
             </template>
           </el-table-column>
         </el-table>
@@ -160,11 +164,11 @@
 
 <script>
 import OrgTree from "@/components/orgTree";
-import { mapGetters} from "vuex";
+import { mapGetters } from "vuex";
 import DialogEdit from "./dialog.edit";
 import * as api from "@/api/safetycheck/rule";
 import { getLabel } from "./../../commonOption";
-import {wholeTreeByType} from "@/api/system/org.js"
+import { wholeTreeByType } from "@/api/system/org.js";
 export default {
   name: "safetycheckruletype",
   dicts: ["sys_org_type", "plan_status"],
@@ -190,7 +194,7 @@ export default {
         name: null,
         type: null,
         orgType: null,
-        checkSub:true,
+        checkSub: true,
         pageNum: 1,
         pageSize: 10,
 
@@ -211,11 +215,11 @@ export default {
   props: {},
   watch: {},
   computed: {
-    ...mapGetters(['orgId']),
+    ...mapGetters(["orgId"]),
   },
   methods: {
     getLabel,
-    orgTree(){
+    orgTree() {
       return wholeTreeByType(3);
     },
     refresh() {
@@ -246,10 +250,16 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    async onDel(id) {
-      await api.remove(id);
-      this.$message.info("删除成功");
-      this.getList();
+    onDel(id) {
+      this.$modal
+        .confirm("确定删除检查内容库定义?")
+        .then(() => {
+          return api.remove(id);
+        })
+        .then(() => {
+          this.$message.info("删除成功");
+          this.getList();
+        });
     },
     // 多选框选中数据
     handleSelectionChange(selection) {

+ 18 - 17
src/views/safetycheck/ruleManager/index.vue

@@ -151,20 +151,15 @@
                 v-hasPermi="['safetycheck:ruleManager:edit']"
                 >编辑</el-button
               >
-
-              <el-popconfirm
-                title="将删除检查项及其下所有检查内容,确定删除?"
-                @confirm="deldata(scope.row.id)"
+              <el-button
+                type="text"
+                size="small"
+                slot="reference"
+                icon="el-icon-delete"
+                @click="deldata(scope.row.id)"
+                v-hasPermi="['safetycheck:ruleManager:remove']"
+                >删除</el-button
               >
-                <el-button
-                  type="text"
-                  size="small"
-                  slot="reference"
-                  icon="el-icon-delete"
-                  v-hasPermi="['safetycheck:ruleManager:remove']"
-                  >删除</el-button
-                >
-              </el-popconfirm>
             </template>
           </el-table-column>
         </el-table>
@@ -325,10 +320,16 @@ export default {
       }
       this.refresh();
     },
-    async deldata(val) {
-      await del(val);
-      this.$message.info("删除成功");
-      this.getList();
+    deldata(val) {
+      this.$modal
+        .confirm("确定删除检查内容库定义?")
+        .then(() => {
+          return del(val);
+        })
+        .then(() => {
+          this.$message.info("删除成功");
+          this.getList();
+        });
     },
     renderContent(h, { node, data, store }) {
       if (data.isRule == 0) {