Bläddra i källkod

处理联动表格批量删除异常问题

lph 1 år sedan
förälder
incheckning
b862b19d2a
1 ändrade filer med 6 tillägg och 9 borttagningar
  1. 6 9
      zkqy-ui/src/views/relateTable/index.vue

+ 6 - 9
zkqy-ui/src/views/relateTable/index.vue

@@ -542,7 +542,6 @@ import { mapGetters, mapState } from "vuex";
 import { v4 as uuidv4 } from "uuid";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import json from "highlight.js/lib/languages/json";
 import { getTableInfo } from "@/api/system/table.js";
 
 export default {
@@ -1269,17 +1268,18 @@ export default {
     // 删除表格组
     DeleteTableGroup(row) {
       const fIds = row.id || this.ids;
-      if (row) {
-        this.menuIds = row;
+      if (row.groupTableInfo) {
+        this.menuIds = row.groupTableInfo[0].menuId;
       }
-      const menus = row.menuId || this.menuIds;
+      let temp = JSON.parse(JSON.stringify(this.menuIds));
+      const menus = row.menuId || temp;
       this.$modal
         .confirm(
           '是否确认删除动态单编号为"' +
             fIds +
             '"的数据项?删除后表格中所有的数据都将删除!'
         )
-        .then(function () {
+        .then(() => {
           return delMenu(menus);
         })
         .then(async () => {
@@ -1629,10 +1629,7 @@ export default {
       console.log(selection);
       this.ids = selection.map((item) => item.id);
       this.Keys = selection.map((item) => item.sqlKey);
-      selection.forEach((vals) => {
-        this.menuIds = vals.groupTableInfo.map((item) => item.menuId);
-        console.log(this.menuIds);
-      });
+      this.menuIds = selection.map((item) => item.groupTableInfo[0].menuId);
       this.selection = selection;
       this.single = selection.length !== 1;
       this.multiple = !selection.length;