fix(测试跟踪): 模块增删改,脑图没有提示刷新

--bug=1014167 --user=陈建星 【测试跟踪】脑图模式下,左侧模块增删改,脑图没有及时更新 https://www.tapd.cn/55049933/s/1184890
This commit is contained in:
chenjianxing 2022-06-17 11:08:12 +08:00 committed by f2c-ci-robot[bot]
parent e7a037bf60
commit b6dd3495d7
2 changed files with 43 additions and 6 deletions

View File

@ -120,6 +120,7 @@
:tree-nodes="treeNodes"
:project-id="projectId"
:condition="condition"
:active-name="activeName"
v-if="activeDom === 'right'"
@refresh="minderSaveRefresh"
ref="minder"/>
@ -690,9 +691,6 @@ export default {
if (this.$refs.testCaseList) {
this.$refs.testCaseList.initTableData();
}
if (this.$refs.minder) {
this.$refs.minder.initData();
}
this.$refs.nodeTree.list();
this.setTable(data);
},

View File

@ -31,6 +31,10 @@
@refresh="refreshIssue"
ref="issueEdit"/>
<is-change-confirm
@confirm="changeConfirm"
ref="isChangeConfirm"/>
</div>
</template>
@ -60,12 +64,13 @@ import {addIssueHotBox, getSelectedNodeData, handleIssueAdd, handleIssueBatch} f
import IssueRelateList from "@/business/components/track/case/components/IssueRelateList";
import TestPlanIssueEdit from "@/business/components/track/case/components/TestPlanIssueEdit";
import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils";
import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm";
const {getIssuesListById} = require("@/network/Issue");
const {getCurrentWorkspaceId} = require("@/common/js/utils");
export default {
name: "TestCaseMinder",
components: {TestPlanIssueEdit, IssueRelateList, MsModuleMinder},
components: {IsChangeConfirm, TestPlanIssueEdit, IssueRelateList, MsModuleMinder},
data() {
return{
testCase: [],
@ -73,6 +78,7 @@ name: "TestCaseMinder",
tags: [this.$t('api_test.definition.request.case'), this.$t('test_track.case.prerequisite'), this.$t('commons.remark'), this.$t('test_track.module.module')],
result: {loading: false},
needRefresh: false,
noRefresh: false,
saveCases: [],
saveModules: [],
saveModuleNodeMap: new Map(),
@ -91,6 +97,7 @@ name: "TestCaseMinder",
currentVersion: String,
condition: Object,
projectId: String,
activeName: String
},
computed: {
selectNodeIds() {
@ -125,6 +132,12 @@ name: "TestCaseMinder",
},
currentVersion() {
this.$refs.minder.initData();
},
treeNodes(newVal, oldVal) {
if (newVal !== oldVal && this.activeName === 'default') {
// tab
this.handleNodeUpdateForMinder();
}
}
},
mounted() {
@ -137,8 +150,30 @@ name: "TestCaseMinder",
}
},
methods: {
handleNodeUpdateForMinder() {
this.noRefresh = true;
//
if (!this.$store.state.isTestCaseMinderChanged) {
if (this.$refs.minder) {
this.$refs.minder.initData();
}
} else {
this.$refs.isChangeConfirm.open();
}
},
changeConfirm(isSave) {
if (isSave) {
this.save(() => {
this.initData();
});
} else {
this.initData();
}
},
initData() {
this.$refs.minder.initData();
if (this.$refs.minder) {
this.$refs.minder.initData();
}
},
getMinderTreeExtraNodeCount() {
return getMinderTreeExtraNodeCount;
@ -249,7 +284,11 @@ name: "TestCaseMinder",
item.isExtraNode = false;
});
this.extraNodeChanged = [];
this.$emit('refresh');
if (!this.noRefresh) {
this.$emit('refresh');
}
//
this.noRefresh = false;
this.setIsChange(false);
if (callback && callback instanceof Function) {
callback();