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

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

View File

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