fix(测试跟踪): 脑图保存提示没有设置权限

--bug=1018745 --user=陈建星 【系统设置】用户只有测试跟踪查看选线,进入测试用例使用脑图查看并修改部分内容,切换列表时提示点击保存提示建议优化 https://www.tapd.cn/55049933/s/1343917
This commit is contained in:
chenjianxing 2023-02-28 16:22:08 +08:00 committed by jianxing
parent f768c5c852
commit 5fb07e894e
9 changed files with 30 additions and 10 deletions

View File

@ -9,8 +9,16 @@
@close="handleClose">
{{tip}}
<template v-slot:footer>
<el-button type="primary" @click="save" size="small" @keydown.enter.native.prevent>{{$t('commons.save')}}</el-button>
<el-button @click="cancel" size="small">{{$t('commons.not_save')}}</el-button>
<el-button type="primary"
@click="save"
size="small"
@keydown.enter.native.prevent>
{{$t('commons.save')}}
</el-button>
<el-button @click="cancel"
size="small">
{{$t('commons.not_save')}}
</el-button>
</template>
</ms-edit-dialog>
</template>
@ -57,7 +65,6 @@ export default {
this.visible = false;
},
handleClose() {
this.$store.commit('setTemWorkspaceId', null);
}
}

View File

@ -390,7 +390,7 @@ export default {
});
},
updateActiveDom(activeDom) {
openMinderConfirm(this, activeDom);
openMinderConfirm(this, activeDom, 'PROJECT_TRACK_CASE:READ+EDIT');
},
importChangeConfirm(isSave) {
store.isTestCaseMinderChanged = false;

View File

@ -274,7 +274,7 @@ export default {
if (isSave) {
this.save(window.minder.exportJson());
} else {
useStore().setIsTestCaseMinderChanged = false;
useStore().isTestCaseMinderChanged = false;
this._handleNodeSelect(this.tmpNode);
}
},

View File

@ -233,7 +233,9 @@ export default {
this.$success('关联成功');
},
setIsChange(isChanged) {
useStore().isTestCaseMinderChanged = isChanged;
useStore().$patch({
isTestCaseMinderChanged: isChanged
});
},
}
}

View File

@ -173,7 +173,9 @@ export default {
saveCases.push(testCase);
},
setIsChange(isChanged) {
useStore().setIsTestCaseMinderChanged = isChanged;
useStore().$patch({
isTestCaseMinderChanged: isChanged
});
}
}
}

View File

@ -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') {

View File

@ -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();
}

View File

@ -207,7 +207,7 @@ export default {
}
},
updateActiveDom(activeDom) {
openMinderConfirm(this, activeDom);
openMinderConfirm(this, activeDom, 'PROJECT_TRACK_PLAN:READ+RUN');
},
changeConfirm(isSave) {
saveMinderConfirm(this, isSave);

View File

@ -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);