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; return result;
}); });
// //
const isHasAllPermission = computed(() => { const isHasAllPermission = computed(() => {
return props.list.some((item: ActionsItem) => { const permissionList = props.list.map((item) => {
if (item.permission) { return item.permission || [];
return hasAnyPermission(item.permission);
}
return false;
}); });
const permissionResult = permissionList.flat();
return hasAnyPermission(permissionResult);
}); });
function selectHandler(value: SelectedValue) { function selectHandler(value: SelectedValue) {

View File

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

View File

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

View File

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