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"
|
: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: {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue