fix(测试跟踪): 禁用测试跟踪首页无权限的跳转链接

--bug=1018743,1018750 --user=宋昌昌 【系统设置】测试跟踪首页点击场景名称提示没有权限,建议提示优化 https://www.tapd.cn/55049933/s/1275439
This commit is contained in:
song-cc-rock 2022-10-24 20:56:11 +08:00 committed by 刘瑞斌
parent e2ba28511a
commit 7f3dca6d0f
1 changed files with 13 additions and 2 deletions

View File

@ -11,7 +11,9 @@
<el-table-column prop="caseName" :label="$t('home.case.case_name')"
width="150">
<template v-slot:default="{row}">
<el-link type="info" @click="redirect(row.caseType,row.id)">
<el-link type="info" @click="redirect(row.caseType,row.id)"
:disabled="(row.caseType === 'apiCase' && apiCaseReadOnly) || (row.caseType === 'scenario' && apiScenarioReadOnly) ||
(row.caseType === 'load' && loadCaseReadOnly) || (row.caseType === 'testCase' && testCaseReadOnly)">
{{ row.caseName }}
</el-link>
</template>
@ -52,6 +54,7 @@
import MsTag from "metersphere-frontend/src/components/MsTag";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {homeTestPlanFailureCaseGet} from "@/api/remote/api/api-home";
import {hasPermission} from "@/business/utils/sdk-utils";
export default {
name: "MsFailureTestCaseList",
@ -63,7 +66,11 @@ export default {
data() {
return {
tableData: [],
loading: false
loading: false,
testCaseReadOnly: false,
apiCaseReadOnly: false,
apiScenarioReadOnly: false,
loadCaseReadOnly: false,
}
},
props: {
@ -103,6 +110,10 @@ export default {
created() {
this.search();
this.testCaseReadOnly = !hasPermission('PROJECT_TRACK_CASE:READ');
this.apiCaseReadOnly = !hasPermission('PROJECT_API_DEFINITION:READ');
this.apiScenarioReadOnly = !hasPermission('PROJECT_API_SCENARIO:READ');
this.loadCaseReadOnly = !hasPermission('PROJECT_PERFORMANCE_TEST:READ');
},
activated() {
this.search();