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