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

View File

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