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

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

View File

@ -17,6 +17,7 @@
:type="'edit'"
:total='total'
:public-total="publicTotal"
:is-minder-mode="isMinderMode"
ref="nodeTree"
@importChangeConfirm="importChangeConfirm"
/>
@ -122,7 +123,7 @@
:project-id="projectId"
:condition="condition"
:active-name="activeName"
v-if="activeDom === 'right'"
v-if="isMinderMode"
@refresh="minderSaveRefresh"
ref="minder"/>
</ms-tab-button>
@ -356,7 +357,9 @@ export default {
let redirectParam = this.$route.params.dataSelectRange;
return redirectParam;
},
isMinderMode() {
return this.activeDom === 'right';
},
projectId() {
return getCurrentProjectID();
},

View File

@ -126,6 +126,11 @@ export default {
showOperator: Boolean,
total: Number,
publicTotal: Number,
//
isMinderMode: {
type: Boolean,
default: false
},
},
watch: {
treeNodes() {
@ -181,7 +186,7 @@ export default {
this.$emit('enablePublic', this.condition.publicEnable);
this.$emit('toPublic', 'public');
},
list({ isForceSetCurrentKey } = {}) {
list() {
if (this.projectId) {
this.result = getTestCaseNodes(this.projectId, data => {
this.treeNodes = data;
@ -193,7 +198,7 @@ export default {
if (this.$refs.nodeTree) {
this.$refs.nodeTree.filter(this.condition.filterText);
}
if (isForceSetCurrentKey) {
if (this.isMinderMode) {
this.forceSetCurrentKey();
} else {
this.setCurrentKey();
@ -208,7 +213,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);
}
},

View File

@ -126,6 +126,12 @@ name: "TestCaseMinder",
},
watch: {
treeNodes(newVal, oldVal) {
if (newVal !== oldVal && this.activeName === 'default') {
// tab
this.handleNodeUpdateForMinder();
}
},
selectNode() {
if (this.noRefreshMinderForSelectNode) {
//
@ -138,12 +144,6 @@ name: "TestCaseMinder",
},
currentVersion() {
this.$refs.minder.initData();
},
treeNodes(newVal, oldVal) {
if (newVal !== oldVal && this.activeName === 'default') {
// tab
this.handleNodeUpdateForMinder();
}
}
},
mounted() {
@ -162,6 +162,13 @@ name: "TestCaseMinder",
this.noRefreshMinder = false;
return;
}
if (this.selectNode && this.selectNode.data) {
// selectNode selectNode watch
//
return;
}
//
if (!this.$store.state.isTestCaseMinderChanged) {
if (this.$refs.minder) {