feat:所有模块,接入 access 权限控制
This commit is contained in:
@@ -6,6 +6,9 @@ import { z } from '#/adapter/form';
|
||||
import { CommonStatusEnum } from '#/utils/constants';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
import { getRangePickerDefaultProps } from '#/utils/date';
|
||||
import { useAccess } from '@vben/access';
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
@@ -200,6 +203,16 @@ export function useGridColumns<T = SystemSmsChannelApi.SystemSmsChannel>(
|
||||
onClick: onActionClick,
|
||||
},
|
||||
name: 'CellOperation',
|
||||
options: [
|
||||
{
|
||||
code: 'edit',
|
||||
show: hasAccessByCodes(['system:sms-channel:update']),
|
||||
},
|
||||
{
|
||||
code: 'delete',
|
||||
show: hasAccessByCodes(['system:sms-channel:delete']),
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -111,11 +111,11 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<FormModal @success="onRefresh" />
|
||||
<Grid table-title="短信渠道列表">
|
||||
<template #toolbar-tools>
|
||||
<Button type="primary" @click="onCreate">
|
||||
<Button type="primary" @click="onCreate" v-access:code="['system:sms-channel:create']">
|
||||
<Plus class="size-5" />
|
||||
{{ $t('ui.actionTitle.create', ['短信渠道']) }}
|
||||
</Button>
|
||||
<Button type="primary" class="ml-2" @click="onExport">
|
||||
<Button type="primary" class="ml-2" @click="onExport" v-access:code="['system:sms-channel:export']">
|
||||
<Download class="size-5" />
|
||||
{{ $t('ui.actionTitle.export') }}
|
||||
</Button>
|
||||
|
||||
@@ -5,6 +5,9 @@ import type { SystemSmsLogApi } from '#/api/system/sms/log';
|
||||
import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
import { getRangePickerDefaultProps } from '#/utils/date';
|
||||
import { useAccess } from '@vben/access';
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
@@ -176,6 +179,7 @@ export function useGridColumns<T = SystemSmsLogApi.SystemSmsLog>(
|
||||
{
|
||||
code: 'view',
|
||||
text: '查看',
|
||||
show: hasAccessByCodes(['system:sms-log:query']),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -83,7 +83,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<DetailModal @success="onRefresh" />
|
||||
<Grid table-title="短信日志列表">
|
||||
<template #toolbar-tools>
|
||||
<Button type="primary" class="ml-2" @click="onExport">
|
||||
<Button type="primary" class="ml-2" @click="onExport" v-access:code="['system:sms-log:export']">
|
||||
<Download class="size-5" />
|
||||
{{ $t('ui.actionTitle.export') }}
|
||||
</Button>
|
||||
|
||||
@@ -7,6 +7,9 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
|
||||
import { CommonStatusEnum } from '#/utils/constants';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
import { getRangePickerDefaultProps } from '#/utils/date';
|
||||
import { useAccess } from '@vben/access';
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
@@ -280,11 +283,18 @@ export function useGridColumns<T = SystemSmsTemplateApi.SystemSmsTemplate>(
|
||||
},
|
||||
name: 'CellOperation',
|
||||
options: [
|
||||
'edit', // 默认的编辑按钮
|
||||
'delete', // 默认的删除按钮
|
||||
{
|
||||
code: 'edit',
|
||||
show: hasAccessByCodes(['system:sms-template:update']),
|
||||
},
|
||||
{
|
||||
code: 'delete',
|
||||
show: hasAccessByCodes(['system:sms-template:delete']),
|
||||
},
|
||||
{
|
||||
code: 'sms-send',
|
||||
text: '发送短信',
|
||||
show: hasAccessByCodes(['system:sms-template:send-sms']),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -127,11 +127,11 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<SendModal />
|
||||
<Grid table-title="短信模板列表">
|
||||
<template #toolbar-tools>
|
||||
<Button type="primary" @click="onCreate">
|
||||
<Button type="primary" @click="onCreate" v-access:code="['system:sms-template:create']">
|
||||
<Plus class="size-5" />
|
||||
{{ $t('ui.actionTitle.create', ['短信模板']) }}
|
||||
</Button>
|
||||
<Button type="primary" class="ml-2" @click="onExport">
|
||||
<Button type="primary" class="ml-2" @click="onExport" v-access:code="['system:sms-template:export']">
|
||||
<Download class="size-5" />
|
||||
{{ $t('ui.actionTitle.export') }}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user