fix(测试计划): 优化测试计划定时任务权限问题

This commit is contained in:
limin-fit2 2022-02-15 15:15:38 +08:00 committed by john1298308460
parent d6594d261e
commit e67891633e
1 changed files with 9 additions and 4 deletions

View File

@ -110,7 +110,8 @@
@click.stop.native @click.stop.native
v-model="scope.row.scheduleOpen" v-model="scope.row.scheduleOpen"
inactive-color="#DCDFE6" inactive-color="#DCDFE6"
@change="scheduleChange(scope.row)"> @change="scheduleChange(scope.row)"
:disabled="!hasSchedulePermission">
</el-switch> </el-switch>
</el-tooltip> </el-tooltip>
</span> </span>
@ -119,11 +120,12 @@
@click.stop.native @click.stop.native
v-model="scope.row.scheduleOpen" v-model="scope.row.scheduleOpen"
inactive-color="#DCDFE6" inactive-color="#DCDFE6"
@change="scheduleChange(scope.row)"> @change="scheduleChange(scope.row)"
:disabled="!hasSchedulePermission">
</el-switch> </el-switch>
</span> </span>
<span v-else> <span v-else>
<el-link @click.stop="scheduleTask(scope.row)" style="color:#783887;">{{ <el-link @click.stop="scheduleTask(scope.row)" :disabled="!hasSchedulePermission" style="color:#783887;">{{
$t('schedule.not_set') $t('schedule.not_set')
}}</el-link> }}</el-link>
</span> </span>
@ -387,6 +389,7 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
hasEditPermission: false, hasEditPermission: false,
hasSchedulePermission: false,
total: 0, total: 0,
tableData: [], tableData: [],
fields: getCustomTableHeader('TEST_PLAN_LIST'), fields: getCustomTableHeader('TEST_PLAN_LIST'),
@ -415,7 +418,8 @@ export default {
publicButtons: [ publicButtons: [
{ {
name: this.$t('test_track.plan.test_plan_batch_switch'), name: this.$t('test_track.plan.test_plan_batch_switch'),
handleClick: this.handleBatchSwitch handleClick: this.handleBatchSwitch,
permissions: ['PROJECT_TRACK_PLAN:READ+SCHEDULE']
} }
], ],
simpleOperators: [ simpleOperators: [
@ -455,6 +459,7 @@ export default {
this.projectId = getCurrentProjectID(); this.projectId = getCurrentProjectID();
} }
this.hasEditPermission = hasPermission('PROJECT_TRACK_PLAN:READ+EDIT'); this.hasEditPermission = hasPermission('PROJECT_TRACK_PLAN:READ+EDIT');
this.hasSchedulePermission = hasPermission('PROJECT_TRACK_PLAN:READ+SCHEDULE');
this.condition.orders = getLastTableSortField(this.tableHeaderKey); this.condition.orders = getLastTableSortField(this.tableHeaderKey);
getPlanStageOption((data) => { getPlanStageOption((data) => {
this.stageOption = data; this.stageOption = data;