refactor(接口测试): 优化批量操作按钮权限
This commit is contained in:
parent
087bfb417f
commit
bd5821acf2
|
@ -4,7 +4,7 @@
|
||||||
<template v-for="(element, idx) in baseAction" :key="element.label">
|
<template v-for="(element, idx) in baseAction" :key="element.label">
|
||||||
<a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" />
|
<a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" />
|
||||||
<a-button
|
<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="ml-[12px]"
|
||||||
:class="{
|
:class="{
|
||||||
'arco-btn-outline--danger': element.danger,
|
'arco-btn-outline--danger': element.danger,
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
>
|
>
|
||||||
<!-- baseAction多菜单选择 -->
|
<!-- baseAction多菜单选择 -->
|
||||||
<a-dropdown
|
<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"
|
position="tr"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
>
|
>
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { getNodeWidth } from '@/utils/dom';
|
import { getNodeWidth } from '@/utils/dom';
|
||||||
import { hasAllPermission } from '@/utils/permission';
|
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import { BatchActionConfig, BatchActionParams } from './type';
|
import { BatchActionConfig, BatchActionParams } from './type';
|
||||||
import ResizeObserver from 'resize-observer-polyfill';
|
import ResizeObserver from 'resize-observer-polyfill';
|
||||||
|
|
|
@ -131,6 +131,7 @@ export interface BatchActionParams {
|
||||||
danger?: boolean;
|
danger?: boolean;
|
||||||
children?: BatchActionParams[];
|
children?: BatchActionParams[];
|
||||||
permission?: string[];
|
permission?: string[];
|
||||||
|
anyPermission?: string[];
|
||||||
}
|
}
|
||||||
export interface BatchActionConfig {
|
export interface BatchActionConfig {
|
||||||
baseAction: BatchActionParams[];
|
baseAction: BatchActionParams[];
|
||||||
|
|
|
@ -419,7 +419,7 @@
|
||||||
{
|
{
|
||||||
label: 'project.taskCenter.batchStop',
|
label: 'project.taskCenter.batchStop',
|
||||||
eventTag: 'batchStop',
|
eventTag: 'batchStop',
|
||||||
permission: permissionsMap[props.group][props.moduleType].stop,
|
anyPermission: permissionsMap[props.group][props.moduleType].stop,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// label: 'project.taskCenter.batchExecution',
|
// label: 'project.taskCenter.batchExecution',
|
||||||
|
|
|
@ -340,12 +340,12 @@
|
||||||
{
|
{
|
||||||
label: 'project.taskCenter.batchEnable',
|
label: 'project.taskCenter.batchEnable',
|
||||||
eventTag: 'batchEnable',
|
eventTag: 'batchEnable',
|
||||||
// permission: permissionsMap[props.group][props.moduleType].edit,
|
anyPermission: permissionsMap[props.group][props.moduleType].edit,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'project.taskCenter.batchDisable',
|
label: 'project.taskCenter.batchDisable',
|
||||||
eventTag: 'batchDisable',
|
eventTag: 'batchDisable',
|
||||||
// permission: permissionsMap[props.group][props.moduleType].edit,
|
anyPermission: permissionsMap[props.group][props.moduleType].edit,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue