fix(接口测试): 修复测试报告中节点过滤中错误的逻辑判断

--bug=1015270 --user=宋天阳 【接口测试】接口自动化-批量选择场景执行-集合报告结果中未执行显示错误
https://www.tapd.cn/55049933/s/1209463
This commit is contained in:
song-tianyang 2022-07-25 11:44:05 +08:00 committed by f2c-ci-robot[bot]
parent f25d0880d4
commit ff61886ea9
1 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@
highlight-current highlight-current
class="ms-tree ms-report-tree" ref="resultsTree"> class="ms-tree ms-report-tree" ref="resultsTree">
<span slot-scope="{ node, data}" style="width: 99%" @click="nodeClick(node)"> <span slot-scope="{ node, data}" style="width: 99%" @click="nodeClick(node)">
<ms-scenario-result :node="data" :console="console" v-on:requestResult="requestResult" <ms-scenario-result :node="data" :console="console" v-on:requestResult="requestResult"
:isActive="isActive" :is-share="isShare" :share-id="shareId"/> :isActive="isActive" :is-share="isShare" :share-id="shareId"/>
</span> </span>
</el-tree> </el-tree>
@ -38,7 +38,7 @@ export default {
default: false, default: false,
type: Boolean, type: Boolean,
}, },
isShare:Boolean, isShare: Boolean,
shareId: String, shareId: String,
}, },
data() { data() {
@ -58,7 +58,7 @@ export default {
}, },
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
if (!data.value && !data.children && data.children.length === 0) { if (!data.value && (!data.children || data.children.length === 0)) {
return false; return false;
} }
if (!value) return true; if (!value) return true;
@ -67,11 +67,11 @@ export default {
if (data.errorCode && data.errorCode !== "" && data.value.status === "errorReportResult") { if (data.errorCode && data.errorCode !== "" && data.value.status === "errorReportResult") {
return true; return true;
} }
}else if (value === 'unexecute') { } else if (value === 'unexecute') {
if(data.value.status === 'unexecute'){ if (data.value.status === 'unexecute') {
return true; return true;
} }
}else { } else {
if (this.isUi) { if (this.isUi) {
return data.value.success === false && data.value.startTime > 0; return data.value.success === false && data.value.startTime > 0;
} else { } else {
@ -93,7 +93,7 @@ export default {
node.expanded = !node.expanded; node.expanded = !node.expanded;
}, },
// //
changeTreeNodeStatus(node,expandCount) { changeTreeNodeStatus(node, expandCount) {
node.expanded = this.expandAll node.expanded = this.expandAll
for (let i = 0; i < node.childNodes.length; i++) { for (let i = 0; i < node.childNodes.length; i++) {
// expanded // expanded
@ -107,13 +107,13 @@ export default {
closeExpansion() { closeExpansion() {
this.isActive = false; this.isActive = false;
this.expandAll = false; this.expandAll = false;
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root,0); this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0);
}, },
openExpansion() { openExpansion() {
this.isActive = true; this.isActive = true;
this.expandAll = true; this.expandAll = true;
// //
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root,0) this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0)
}, },
} }
} }