refactor(接口测试): 优化断言文档中长json导入展开的方法

This commit is contained in:
wxg0103 2022-06-15 16:10:42 +08:00 committed by fit2-zhao
parent 9be69ed77e
commit ee9ddeb3b1
1 changed files with 6 additions and 3 deletions

View File

@ -217,9 +217,12 @@ export default {
if (tree.children.length === 0) {
resolveArr = this.originalData;
//children
const tarItem = resolveArr.find(item => item.id === tree.idList.shift())
tarItem.loadedChildren = true
resolveArr = tarItem.children
let id;
while ((id = tree.idList.shift())) {
const tarItem = resolveArr.find(item => item.id === id)
tarItem.loadedChildren = true
resolveArr = tarItem.children
}
} else {
resolveArr = tree;
resolveArr = tree.children;