diff --git a/framework/sdk-parent/frontend/src/components/IsChangeConfirm.vue b/framework/sdk-parent/frontend/src/components/IsChangeConfirm.vue index f082cd7960..5ea2b90b5f 100644 --- a/framework/sdk-parent/frontend/src/components/IsChangeConfirm.vue +++ b/framework/sdk-parent/frontend/src/components/IsChangeConfirm.vue @@ -9,8 +9,16 @@ @close="handleClose"> {{tip}} @@ -57,7 +65,6 @@ export default { this.visible = false; }, handleClose() { - this.$store.commit('setTemWorkspaceId', null); } } diff --git a/test-track/frontend/src/business/case/TestCase.vue b/test-track/frontend/src/business/case/TestCase.vue index e15511dfb5..032bdca258 100644 --- a/test-track/frontend/src/business/case/TestCase.vue +++ b/test-track/frontend/src/business/case/TestCase.vue @@ -390,7 +390,7 @@ export default { }); }, updateActiveDom(activeDom) { - openMinderConfirm(this, activeDom); + openMinderConfirm(this, activeDom, 'PROJECT_TRACK_CASE:READ+EDIT'); }, importChangeConfirm(isSave) { store.isTestCaseMinderChanged = false; diff --git a/test-track/frontend/src/business/common/minder/MsModuleMinder.vue b/test-track/frontend/src/business/common/minder/MsModuleMinder.vue index 1601fa5f16..d71d957ed5 100644 --- a/test-track/frontend/src/business/common/minder/MsModuleMinder.vue +++ b/test-track/frontend/src/business/common/minder/MsModuleMinder.vue @@ -274,7 +274,7 @@ export default { if (isSave) { this.save(window.minder.exportJson()); } else { - useStore().setIsTestCaseMinderChanged = false; + useStore().isTestCaseMinderChanged = false; this._handleNodeSelect(this.tmpNode); } }, diff --git a/test-track/frontend/src/business/common/minder/TestPlanMinder.vue b/test-track/frontend/src/business/common/minder/TestPlanMinder.vue index efdea55cb3..dedcac3c84 100644 --- a/test-track/frontend/src/business/common/minder/TestPlanMinder.vue +++ b/test-track/frontend/src/business/common/minder/TestPlanMinder.vue @@ -233,7 +233,9 @@ export default { this.$success('关联成功'); }, setIsChange(isChanged) { - useStore().isTestCaseMinderChanged = isChanged; + useStore().$patch({ + isTestCaseMinderChanged: isChanged + }); }, } } diff --git a/test-track/frontend/src/business/common/minder/TestReviewMinder.vue b/test-track/frontend/src/business/common/minder/TestReviewMinder.vue index 5e3ac16148..db14fbdbf4 100644 --- a/test-track/frontend/src/business/common/minder/TestReviewMinder.vue +++ b/test-track/frontend/src/business/common/minder/TestReviewMinder.vue @@ -173,7 +173,9 @@ export default { saveCases.push(testCase); }, setIsChange(isChanged) { - useStore().setIsTestCaseMinderChanged = isChanged; + useStore().$patch({ + isTestCaseMinderChanged: isChanged + }); } } } diff --git a/test-track/frontend/src/business/common/minder/minderUtils.js b/test-track/frontend/src/business/common/minder/minderUtils.js index bc2c38051e..11ce588866 100644 --- a/test-track/frontend/src/business/common/minder/minderUtils.js +++ b/test-track/frontend/src/business/common/minder/minderUtils.js @@ -5,6 +5,7 @@ import {deleteIssueRelate} from "@/api/issue"; import {minderPageInfoMap} from "@/api/testCase"; import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils"; import {useStore} from "@/store"; +import {hasPermission} from "@/business/utils/sdk-utils"; export function listenNodeSelected(callback) { let minder = window.minder; @@ -671,7 +672,11 @@ export function handleMinderIssueDelete(commandName, isPlan) { } -export function openMinderConfirm(vueObj, activeDom) { +export function openMinderConfirm(vueObj, activeDom, permission) { + if (permission && !hasPermission(permission)) { + vueObj.activeDom = activeDom; + return; + } let isTestCaseMinderChanged = useStore().isTestCaseMinderChanged; if (vueObj.activeDom !== 'left' && activeDom === 'left' && isTestCaseMinderChanged) { if (vueObj.planStatus !=='Archived') { diff --git a/test-track/frontend/src/business/module/TestCaseNodeTree.vue b/test-track/frontend/src/business/module/TestCaseNodeTree.vue index 372b16e6f1..78e7b67b51 100644 --- a/test-track/frontend/src/business/module/TestCaseNodeTree.vue +++ b/test-track/frontend/src/business/module/TestCaseNodeTree.vue @@ -66,6 +66,7 @@ import { testCaseNodeEdit, testCaseNodePos } from "@/api/test-case-node"; +import {hasPermission} from "@/business/utils/sdk-utils"; export default { name: "TestCaseNodeTree", @@ -349,6 +350,9 @@ export default { }, openMinderConfirm() { let isTestCaseMinderChanged = useStore().isTestCaseMinderChanged; + if (!hasPermission('PROJECT_TRACK_CASE:READ+EDIT')) { + return false; + } if (isTestCaseMinderChanged) { this.$refs.isChangeConfirm.open(); } diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctional.vue b/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctional.vue index 008c9db331..aa7dc5550f 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctional.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctional.vue @@ -207,7 +207,7 @@ export default { } }, updateActiveDom(activeDom) { - openMinderConfirm(this, activeDom); + openMinderConfirm(this, activeDom, 'PROJECT_TRACK_PLAN:READ+RUN'); }, changeConfirm(isSave) { saveMinderConfirm(this, isSave); diff --git a/test-track/frontend/src/business/review/view/components/TestReviewFunction.vue b/test-track/frontend/src/business/review/view/components/TestReviewFunction.vue index 7f7c239560..f0829b546b 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewFunction.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewFunction.vue @@ -148,7 +148,7 @@ export default { this.$refs.testReviewRelevance.openTestReviewRelevanceDialog(); }, updateActiveDom(activeDom) { - openMinderConfirm(this, activeDom); + openMinderConfirm(this, activeDom, 'PROJECT_TRACK_REVIEW:READ+EDIT'); }, changeConfirm(isSave) { saveMinderConfirm(this, isSave);