mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-30 02:58:31 +08:00
fix: 修改紧急bug&moreAction权限禁用问题
This commit is contained in:
parent
8e9c8d9411
commit
b1fcf4f0ee
@ -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) {
|
||||
|
@ -139,6 +139,7 @@
|
||||
label: t('system.orgTemplate.enable'),
|
||||
eventTag: 'enable',
|
||||
danger: true,
|
||||
permission: ['ORGANIZATION_TEMPLATE:READ+ENABLE'],
|
||||
},
|
||||
]);
|
||||
const showEnableVisible = ref<boolean>(false);
|
||||
|
@ -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)"
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user