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

View File

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

View File

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