fix(测试跟踪): 脑图模式下,模块树添加一个子节点,脑图刷新后,点击子节点会展示所有用例

--bug=1025035 --user=陈建星 脑图模式下,模块树添加一个子节点,脑图刷新后,点击子节点会展示所有用例 https://www.tapd.cn/55049933/s/1358315
This commit is contained in:
chenjianxing 2023-03-31 17:21:28 +08:00 committed by jianxing
parent c8fbeaffd2
commit f3eee460b0
3 changed files with 29 additions and 11 deletions

View File

@ -39,6 +39,7 @@
:show-operator="false"
:public-total="publicTotal"
:case-condition="condition"
:is-minder-mode="isMinderMode"
@refreshTable="refresh"
@setTreeNodes="setTreeNodes"
@refreshAll="refreshAll"
@ -101,12 +102,12 @@
ref="testCaseList">
</test-case-list>
<test-case-minder
v-if="isMinderMode"
:current-version="currentVersion"
:tree-nodes="treeNodes"
:project-id="projectId"
:condition="condition"
:active-name="activeName"
v-if="activeDom === 'right'"
@refresh="minderSaveRefresh"
@toggleMinderFullScreen="toggleMinderFullScreen"
ref="minder"/>
@ -320,6 +321,9 @@ export default {
},
moduleOptions() {
return store.testCaseModuleOptions;
},
isMinderMode() {
return this.activeDom === 'right';
}
},
methods: {

View File

@ -142,6 +142,14 @@ export default {
}
},
watch: {
//
treeNodes(newVal, oldVal) {
if (newVal !== oldVal && this.activeName === 'default') {
// tab
this.handleNodeUpdateForMinder();
}
},
//
selectNode() {
if (this.noRefreshMinderForSelectNode) {
//
@ -155,12 +163,6 @@ export default {
},
currentVersion() {
this.$refs.minder.initData();
},
treeNodes(newVal, oldVal) {
if (newVal !== oldVal && this.activeName === 'default') {
// tab
this.handleNodeUpdateForMinder();
}
}
},
mounted() {
@ -187,6 +189,13 @@ export default {
this.noRefreshMinder = false;
return;
}
if (this.selectNode && this.selectNode.data) {
// selectNode selectNode watch
//
return;
}
//
if (!useStore().isTestCaseMinderChanged) {
if (this.$refs.minder) {

View File

@ -110,7 +110,12 @@ export default {
hideNodeOperator: {
type: Boolean,
default: false
}
},
//
isMinderMode: {
type: Boolean,
default: false
},
},
watch: {
treeNodes() {
@ -166,7 +171,7 @@ export default {
this.$emit('enablePublic', this.condition.publicEnable);
this.$emit('toPublic', 'public');
},
list({ isForceSetCurrentKey } = {}) {
list() {
if (this.projectId) {
this.caseCondition.casePublic = false;
this.loading = true;
@ -193,7 +198,7 @@ export default {
});
}
} else {
if (isForceSetCurrentKey) {
if (this.isMinderMode) {
this.forceSetCurrentKey();
} else {
this.setCurrentKey();
@ -229,7 +234,7 @@ export default {
},
// currentNode currentNode
forceSetCurrentKey() {
if (this.$refs.nodeTree && this.currentNode) {
if (this.$refs.nodeTree && this.currentNode && this.currentNode.data) {
this.$refs.nodeTree.setCurrentKeyById(this.currentNode.data.id);
}
},