权限使用
- 在columns中使用
{
title: t('routes.alerts.status'),
dataIndex: 'status',
width: 80,
auth: 'Alerts:status',
},
- 在button中使用
<a-button v-auth="RoleEnum.SUPER" type="primary" class="mx-4"> 拥有super角色权限可见</a-button>
- 在useTable中formConfig使用
import { usePermission } from '@/hooks/web/usePermission';
const { hasPermission } = usePermission();
{
field: 'status',
label: t('routes.alerts.status'),
labelWidth: 50,
component: 'Select',
defaultValue: ['pending'],
componentProps: {
mode: 'multiple',
showSearch: true,
options: [
{ label: t('routes.alerts.pending'), value: 'pending' },
{ label: t('routes.alerts.confirmed'), value: 'confirmed' },
{ label: t('routes.alerts.revoked'), value: 'revoked' },
],
},
colProps: { span: 3 },
ifShow:hasPermission(['Alerts:status']),
},
- 在actions中使用
:actions="[
{
icon: 'ant-design:video-camera-outlined',
tooltip: checkVideoTip,
auth: 'Alerts:View',
onClick: handleView.bind(null, record, index),
},
]"

6525

被折叠的 条评论
为什么被折叠?



