fix(场景自动化) 场景步骤深度复制
This commit is contained in:
parent
f96e30d341
commit
a116c35d97
|
@ -542,6 +542,9 @@ export default {
|
|||
const hashTree = parent.data.hashTree || parent.data;
|
||||
// 深度复制
|
||||
let obj = JSON.parse(JSON.stringify(row));
|
||||
if (obj.hashTree && obj.hashTree.length > 0) {
|
||||
this.resetResourceId(obj.hashTree);
|
||||
}
|
||||
obj.resourceId = getUUID();
|
||||
if (obj.name) {
|
||||
obj.name = obj.name + '_copy';
|
||||
|
@ -555,6 +558,14 @@ export default {
|
|||
this.sort();
|
||||
this.reload();
|
||||
},
|
||||
resetResourceId(hashTree) {
|
||||
hashTree.forEach(item => {
|
||||
item.resourceId = getUUID();
|
||||
if (item.hashTree && item.hashTree.length > 0) {
|
||||
this.resetResourceId(item.hashTree);
|
||||
}
|
||||
})
|
||||
},
|
||||
showHide() {
|
||||
this.showHideTree = false
|
||||
this.$nextTick(() => {
|
||||
|
|
Loading…
Reference in New Issue