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