refactor(接口测试): 优化批量操作按钮权限

This commit is contained in:
wxg0103 2024-04-12 13:00:10 +08:00 committed by Craftsman
parent 087bfb417f
commit bd5821acf2
4 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<template v-for="(element, idx) in baseAction" :key="element.label">
<a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" />
<a-button
v-if="!element.isDivider && !element.children && hasAllPermission(element.permission as string[])"
v-if="!element.isDivider && !element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
class="ml-[12px]"
:class="{
'arco-btn-outline--danger': element.danger,
@ -16,7 +16,7 @@
>
<!-- baseAction多菜单选择 -->
<a-dropdown
v-if="!element.isDivider && element.children && hasAllPermission(element.permission as string[])"
v-if="!element.isDivider && element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
position="tr"
@select="handleSelect"
>
@ -67,7 +67,7 @@
import { useI18n } from '@/hooks/useI18n';
import { getNodeWidth } from '@/utils/dom';
import { hasAllPermission } from '@/utils/permission';
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
import { BatchActionConfig, BatchActionParams } from './type';
import ResizeObserver from 'resize-observer-polyfill';

View File

@ -131,6 +131,7 @@ export interface BatchActionParams {
danger?: boolean;
children?: BatchActionParams[];
permission?: string[];
anyPermission?: string[];
}
export interface BatchActionConfig {
baseAction: BatchActionParams[];

View File

@ -419,7 +419,7 @@
{
label: 'project.taskCenter.batchStop',
eventTag: 'batchStop',
permission: permissionsMap[props.group][props.moduleType].stop,
anyPermission: permissionsMap[props.group][props.moduleType].stop,
},
// {
// label: 'project.taskCenter.batchExecution',

View File

@ -340,12 +340,12 @@
{
label: 'project.taskCenter.batchEnable',
eventTag: 'batchEnable',
// permission: permissionsMap[props.group][props.moduleType].edit,
anyPermission: permissionsMap[props.group][props.moduleType].edit,
},
{
label: 'project.taskCenter.batchDisable',
eventTag: 'batchDisable',
// permission: permissionsMap[props.group][props.moduleType].edit,
anyPermission: permissionsMap[props.group][props.moduleType].edit,
},
],
};