fix: 修改紧急bug&moreAction权限禁用问题

This commit is contained in:
xinxin.wu 2024-05-28 10:51:29 +08:00 committed by 刘瑞斌
parent 8e9c8d9411
commit b1fcf4f0ee
4 changed files with 44 additions and 22 deletions

View File

@ -92,14 +92,13 @@
return result;
});
//
//
const isHasAllPermission = computed(() => {
return props.list.some((item: ActionsItem) => {
if (item.permission) {
return hasAnyPermission(item.permission);
}
return false;
const permissionList = props.list.map((item) => {
return item.permission || [];
});
const permissionResult = permissionList.flat();
return hasAnyPermission(permissionResult);
});
function selectHandler(value: SelectedValue) {

View File

@ -139,6 +139,7 @@
label: t('system.orgTemplate.enable'),
eventTag: 'enable',
danger: true,
permission: ['ORGANIZATION_TEMPLATE:READ+ENABLE'],
},
]);
const showEnableVisible = ref<boolean>(false);

View File

@ -185,35 +185,57 @@
<template #operation="{ record }">
<div class="flex items-center">
<div
<MsButton
v-if="
record.functionalCaseCount > 0 &&
hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE']) &&
record.status !== 'ARCHIVED'
"
class="flex items-center"
class="!mx-0"
@click="openDetail(record.id)"
>{{ t('testPlan.testPlanIndex.execution') }}</MsButton
>
<MsButton class="!mx-0" @click="openDetail(record.id)">{{ t('testPlan.testPlanIndex.execution') }}</MsButton>
</div>
<div
<a-divider
v-if="
record.functionalCaseCount > 0 &&
hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE']) &&
record.status !== 'ARCHIVED'
"
direction="vertical"
:margin="8"
></a-divider>
<MsButton
v-if="hasAnyPermission(['PROJECT_TEST_PLAN:READ+UPDATE']) && record.status !== 'ARCHIVED'"
class="flex items-center"
class="!mx-0"
@click="emit('editOrCopy', record.id, false)"
>{{ t('common.edit') }}</MsButton
>
<a-divider direction="vertical" :margin="8"></a-divider>
<MsButton class="!mx-0" @click="emit('editOrCopy', record.id, false)">{{ t('common.edit') }}</MsButton>
<a-divider direction="vertical" :margin="8"></a-divider>
</div>
<div
<a-divider
v-if="hasAnyPermission(['PROJECT_TEST_PLAN:READ+UPDATE']) && record.status !== 'ARCHIVED'"
direction="vertical"
:margin="8"
></a-divider>
<MsButton
v-if="
hasAnyPermission(['PROJECT_TEST_PLAN:READ+ADD']) &&
record.functionalCaseCount < 1 &&
record.status !== 'ARCHIVED'
"
class="flex items-center"
class="!mx-0"
@click="emit('editOrCopy', record.id, true)"
>{{ t('common.copy') }}</MsButton
>
<MsButton class="!mx-0" @click="emit('editOrCopy', record.id, true)">{{ t('common.copy') }}</MsButton>
<a-divider direction="vertical" :margin="8"></a-divider>
</div>
<a-divider
v-if="
hasAnyPermission(['PROJECT_TEST_PLAN:READ+ADD']) &&
record.functionalCaseCount < 1 &&
record.status !== 'ARCHIVED'
"
direction="vertical"
:margin="8"
></a-divider>
<MsTableMoreAction
:list="getMoreActions(record.status, record.functionalCaseCount)"
@select="handleMoreActionSelect($event, record)"

View File

@ -22,7 +22,7 @@ export default {
'testPlan.testPlanIndex.belongModule': 'belong module',
'testPlan.testPlanIndex.createTime': 'create time',
'testPlan.testPlanIndex.operation': 'operation',
'testPlan.testPlanIndex.execution': 'execution',
'testPlan.testPlanIndex.execution': 'Execute',
'testPlan.testPlanIndex.newCreatePlanGroup': 'New Plan group',
'testPlan.testPlanIndex.planStartToEndTime': 'plan times',
'testPlan.testPlanIndex.actualStartToEndTime': 'Actual times',