fix(接口定义): 复制优化

This commit is contained in:
fit2-zhao 2021-01-28 16:54:49 +08:00
parent dcc8e2c609
commit 21935279ce
1 changed files with 6 additions and 1 deletions

View File

@ -143,7 +143,12 @@
copyRow(row) {
let obj = JSON.parse(JSON.stringify(row));
obj.id = getUUID();
this.request.hashTree.push(obj);
const index = this.request.hashTree.findIndex(d => d.id === row.id);
if (index != -1) {
this.request.hashTree.splice(index, 0, obj);
} else {
this.request.hashTree.push(obj);
}
this.reload();
},
reload() {