fix(测试跟踪): 点击用例模块,模块用例数量更新有误

--bug=1025755 --user=陈建星 【测试跟踪】功能用例-左侧目录显示用例数量为0 https://www.tapd.cn/55049933/s/1366078
This commit is contained in:
chenjianxing 2023-04-24 16:37:10 +08:00 committed by jianxing
parent a4d0a22dd8
commit 9ab8c49562
1 changed files with 2 additions and 2 deletions

View File

@ -323,10 +323,10 @@ export default {
let children = item.children;
if (children && children.length > 0) {
this.doUpdateNodeCount(children, countMap);
item.caseNum = countMap[item.id] + children.map(i => i.caseNum)
item.caseNum = (countMap[item.id] ? countMap[item.id] : 0) + children.map(i => i.caseNum)
.reduce((pre, curr) => pre + curr, 0);
} else {
item.caseNum = countMap[item.id];
item.caseNum = countMap[item.id] ? countMap[item.id] : 0;
}
});
},