Преглед изворни кода

feat: 处理定制频道、设备升级、功能权限多添加一层谨慎操作提示

Damon пре 9 месеци
родитељ
комит
93b616ed86

+ 2 - 23
src/views/device/function/index.vue

@@ -80,7 +80,7 @@
 
 <script>
 import { create, edit, list } from "@/api/device/function";
-import { callBack } from "@/utils/DialogUtil";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   dicts: ["sys_normal_disable"],
   data() {
@@ -188,7 +188,7 @@ export default {
     // 删除
     getDelete(row) {
       var that = this;
-      callBack(that, function () {
+      dialogCallBack(that, function () {
         that
           .$confirm(`是否删除${row.name}?`, "提示", {
             confirmButtonText: "确定",
@@ -206,27 +206,6 @@ export default {
             });
           });
       });
-
-      // this.$alert(`删除后数据不可恢复,请谨慎进行该操作!`, "温馨提示", {
-      //   confirmButtonText: "确定",
-      // }).then(() => {
-      //   setTimeout(() => {
-      //     this.$confirm(`是否删除${row.name}?`, "提示", {
-      //       confirmButtonText: "确定",
-      //       cancelButtonText: "取消",
-      //       type: "warning",
-      //     }).then(() => {
-      //       this.form = row;
-      //       this.form.isDelete = 1;
-      //       edit(this.form).then((res) => {
-      //         if (res.code === 0) {
-      //           this.$message.success("已删除!");
-      //           this.getList();
-      //         }
-      //       });
-      //     });
-      //   }, 300);
-      // });
     },
   },
 };

+ 21 - 15
src/views/device/version/index.vue

@@ -112,6 +112,7 @@
 <script>
 import { getPageList, getVersionDelete } from "@/api/device/version";
 import { devMixin, devModeMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [devMixin, devModeMixin],
   data() {
@@ -176,25 +177,30 @@ export default {
         },
       });
     },
+    
     // 删除
     getDelete(row) {
-      var id = row.id;
-      this.$confirm(`是否删除${row.title}?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.loading = true;
-        getVersionDelete({ id: id }).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-            this.loading = false;
-          }
-        });
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.title}?`, "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            that.loading = true;
+            var id = row.id;
+            getVersionDelete({ id: id }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+                that.loading = false;
+              }
+            });
+          });
       });
     },
-
     // 字典翻译
     typeFormatter(row) {
       return this.selectDictLabel(this.devModeOptions, row.type);

+ 16 - 9
src/views/operation/channel/index.vue

@@ -1,3 +1,4 @@
+<!-- 定制频道-->
 <template>
   <div class="app-container">
     <!-- 新增 -->
@@ -171,6 +172,7 @@ editPage,
 getRemove,
 page,
 } from "@/api/operation/channel";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   name: "Channel",
   data() {
@@ -264,15 +266,20 @@ export default {
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示", {
-        type: "warning",
-      }).then(() => {
-        getRemove(row.id).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-          }
-        });
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            getRemove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
       });
     },