zhangjie il y a 1 an
Parent
commit
1fc2393c0d
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      src/modules/mark/components/markParam/MarkParamStructure.vue

+ 4 - 4
src/modules/mark/components/markParam/MarkParamStructure.vue

@@ -288,7 +288,7 @@ export default {
     getNewRow(val) {
       return this.$objAssign(
         {
-          id: this.$randomCode(),
+          id: null,
           key: this.$randomCode(),
           mainId: this.$randomCode(),
           objective: true,
@@ -332,7 +332,7 @@ export default {
       if (nextMainStartPos === null) return this.tableData.length;
     },
     toAddMain(row) {
-      const startPos = this.tableData.findIndex((item) => item.id === row.id);
+      const startPos = this.tableData.findIndex((item) => item.key === row.key);
       const nextMainStartPos = this.getNextMainStartPos(startPos, row.mainId);
       this.tableData.splice(
         nextMainStartPos,
@@ -358,7 +358,7 @@ export default {
       });
     },
     toAddSub(row) {
-      const subPos = this.tableData.findIndex((item) => item.id === row.id);
+      const subPos = this.tableData.findIndex((item) => item.key === row.key);
       this.tableData.splice(
         subPos + 1,
         0,
@@ -379,7 +379,7 @@ export default {
         });
     },
     toDeleteSub(row) {
-      const subPos = this.tableData.findIndex((item) => item.id === row.id);
+      const subPos = this.tableData.findIndex((item) => item.key === row.key);
       this.tableData.splice(subPos, 1);
 
       this.tableData