fix(测试跟踪): 脑图模式下,模块树添加一个子节点,脑图刷新后,点击子节点会展示所有用例
--bug=1025035 --user=陈建星 脑图模式下,模块树添加一个子节点,脑图刷新后,点击子节点会展示所有用例 https://www.tapd.cn/55049933/s/1358315
This commit is contained in:
parent
c8fbeaffd2
commit
f3eee460b0
|
@ -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: {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue