feat:所有模块,接入 access 权限控制

This commit is contained in:
YunaiV
2025-04-05 09:43:01 +08:00
parent 49f13bf301
commit a617d4b71e
30 changed files with 199 additions and 42 deletions

View File

@@ -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[] {
@@ -135,6 +138,16 @@ export function useGridColumns<T = SystemTenantPackageApi.SystemTenantPackage>(o
onClick: onActionClick,
},
name: 'CellOperation',
options: [
{
code: 'edit',
show: hasAccessByCodes(['system:tenant-package:update']),
},
{
code: 'delete',
show: hasAccessByCodes(['system:tenant-package:delete']),
},
],
},
},
];

View File

@@ -101,7 +101,7 @@ 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:tenant-package:create']">
<Plus class="size-5" />
{{ $t('ui.actionTitle.create', ['套餐']) }}
</Button>