fix: naive code

This commit is contained in:
xingyu4j
2025-10-17 11:24:07 +08:00
parent 9499a80e8a
commit a5e3406849
39 changed files with 112 additions and 175 deletions

View File

@@ -59,8 +59,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
},
defaultValue: true,
rules: 'required',

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
},
{
@@ -44,9 +42,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
},
},
{

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
},
{
@@ -44,9 +42,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
},
},
{

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
},
{
@@ -44,9 +42,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
},
},
{

View File

@@ -57,9 +57,7 @@ function handleEdit(row: Demo03StudentApi.Demo03Student) {
async function handleDelete(row: Demo03StudentApi.Demo03Student) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.id]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteDemo03Student(row.id!);

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
},
{
@@ -44,9 +42,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
},
},
{

View File

@@ -50,9 +50,7 @@ function handleEdit(row: Demo03StudentApi.Demo03Student) {
async function handleDelete(row: Demo03StudentApi.Demo03Student) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.id]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteDemo03Student(row.id!);

View File

@@ -53,9 +53,7 @@ async function handleCopyUrl(row: InfraFileApi.File) {
async function handleDelete(row: InfraFileApi.File) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name || row.path]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteFile(row.id!);

View File

@@ -3,7 +3,7 @@ import type { UploadFileInfo } from 'naive-ui';
import { useVbenModal } from '@vben/common-ui';
import { NUpload } from 'naive-ui';
import { NUpload, NUploadDragger } from 'naive-ui';
import { useVbenForm } from '#/adapter/form';
import { message } from '#/adapter/naive';
@@ -50,8 +50,11 @@ const [Modal, modalApi] = useVbenModal({
});
/** 上传前 */
function beforeUpload(file: UploadFileInfo) {
formApi.setFieldValue('file', file);
function beforeUpload(data: {
file: UploadFileInfo;
fileList: UploadFileInfo[];
}) {
formApi.setFieldValue('file', data.file.file);
return false;
}
</script>
@@ -62,21 +65,23 @@ function beforeUpload(file: UploadFileInfo) {
<template #file>
<div class="w-full">
<!-- 上传区域 -->
<NUpload.Dragger
<NUpload
name="file"
:max-count="1"
:max="1"
:multiple="false"
accept=".jpg,.png,.gif,.webp"
:before-upload="beforeUpload"
list-type="picture-card"
@before-upload="beforeUpload"
>
<p class="ant-upload-drag-icon">
<span class="icon-[ant-design--inbox-outlined] text-2xl"></span>
</p>
<p class="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p class="ant-upload-hint">
支持 .jpg.png.gif.webp 格式图片文件
</p>
</NUpload.Dragger>
<NUploadDragger>
<p class="ant-upload-drag-icon">
<span class="icon-[ant-design--inbox-outlined] text-2xl"></span>
</p>
<p class="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p class="ant-upload-hint">
支持 .jpg.png.gif.webp 格式图片文件
</p>
</NUploadDragger>
</NUpload>
</div>
</template>
</Form>

View File

@@ -130,8 +130,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '主动模式', value: 'Active' },
{ label: '被动模式', value: 'Passive' },
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
dependencies: {
@@ -201,8 +199,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '启用', value: true },
{ label: '禁用', value: false },
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
dependencies: {
@@ -220,8 +216,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '公开', value: true },
{ label: '私有', value: false },
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
dependencies: {
@@ -326,7 +320,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
{
title: '操作',
width: 240,
width: 280,
fixed: 'right',
slots: { default: 'actions' },
},

View File

@@ -45,9 +45,7 @@ function handleEdit(row: InfraFileConfigApi.FileConfig) {
async function handleMaster(row: InfraFileConfigApi.FileConfig) {
const hideLoading = message.loading(
$t('ui.actionMessage.updating', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await updateFileConfigMaster(row.id!);
@@ -83,9 +81,7 @@ async function handleTest(row: InfraFileConfigApi.FileConfig) {
async function handleDelete(row: InfraFileConfigApi.FileConfig) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteFileConfig(row.id!);

View File

@@ -110,9 +110,7 @@ function handleLog(row?: InfraJobApi.Job) {
async function handleDelete(row: InfraJobApi.Job) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteJob(row.id!);

View File

@@ -9,8 +9,6 @@ import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { formatDateTime } from '@vben/utils';
import dayjs from 'dayjs';
import { DictTag } from '#/components/dict-tag';
/** 列表的搜索表单 */
@@ -31,12 +29,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'DatePicker',
componentProps: {
clearable: true,
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
defaultTime: '00:00:00',
placeholder: '选择开始执行时间',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
showTime: {
format: 'HH:mm:ss',
defaultValue: dayjs('00:00:00', 'HH:mm:ss'),
},
},
},
{
@@ -45,12 +41,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'DatePicker',
componentProps: {
clearable: true,
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
defaultTime: '23:59:59',
placeholder: '选择结束执行时间',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
showTime: {
format: 'HH:mm:ss',
defaultValue: dayjs('23:59:59', 'HH:mm:ss'),
},
},
},
{

View File

@@ -108,8 +108,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -51,9 +51,7 @@ function handleEdit(row: SystemDeptApi.Dept) {
async function handleDelete(row: SystemDeptApi.Dept) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteDept(row.id!);

View File

@@ -50,8 +50,6 @@ export function useTypeFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
@@ -234,8 +232,6 @@ export function useDataFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
placeholder: '请选择状态',
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -7,6 +7,8 @@ import { ref, watch } from 'vue';
import { confirm, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
import { NTag } from 'naive-ui';
import { message } from '#/adapter/naive';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -173,10 +175,14 @@ watch(
/>
</template>
<template #colorType="{ row }">
<Tag :color="row.colorType">{{ row.colorType }}</Tag>
<NTag v-if="row.colorType" :type="row.colorType as any">
{{ row.colorType }}
</NTag>
</template>
<template #cssClass="{ row }">
<Tag :color="row.cssClass">{{ row.cssClass }}</Tag>
<NTag v-if="row.cssClass" :color="{ color: row.cssClass }">
{{ row.cssClass }}
</NTag>
</template>
<template #actions="{ row }">
<TableAction

View File

@@ -38,8 +38,9 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'password',
label: '密码',
component: 'InputPassword',
component: 'Input',
componentProps: {
type: 'password',
placeholder: '请输入密码',
},
rules: 'required',
@@ -70,8 +71,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.boolean().default(true),
},
@@ -81,8 +80,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.boolean().default(false),
},

View File

@@ -78,8 +78,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
@@ -122,8 +120,9 @@ export function useSendMailFormSchema(): VbenFormSchema[] {
label: '收件邮箱',
component: 'Select',
componentProps: {
mode: 'tags',
clearable: true,
tag: true,
multiple: true,
filterable: true,
placeholder: '请输入收件邮箱,按 Enter 添加',
},
},
@@ -132,8 +131,9 @@ export function useSendMailFormSchema(): VbenFormSchema[] {
label: '抄送邮箱',
component: 'Select',
componentProps: {
mode: 'tags',
clearable: true,
tag: true,
multiple: true,
filterable: true,
placeholder: '请输入抄送邮箱,按 Enter 添加',
},
},
@@ -142,8 +142,9 @@ export function useSendMailFormSchema(): VbenFormSchema[] {
label: '密送邮箱',
component: 'Select',
componentProps: {
mode: 'tags',
clearable: true,
tag: true,
multiple: true,
filterable: true,
placeholder: '请输入密送邮箱,按 Enter 添加',
},
},

View File

@@ -90,8 +90,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(SystemMenuTypeEnum.DIR),
},
@@ -164,14 +162,15 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'componentName',
label: '组件名称',
component: 'AutoComplete',
component: 'Select',
componentProps: {
clearable: true,
filterOption(input: string, option: { value: string }) {
filterable: true,
placeholder: '请选择组件名称',
options: componentKeys.map((v) => ({ label: v, value: v })),
filter(input: string, option: { value: string }) {
return option.value.toLowerCase().includes(input.toLowerCase());
},
placeholder: '请选择组件名称',
options: componentKeys.map((v) => ({ value: v })),
},
dependencies: {
triggerFields: ['type'],
@@ -212,8 +211,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
@@ -226,8 +223,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '总是', value: true },
{ label: '不是', value: false },
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
defaultValue: true,
@@ -248,8 +243,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '缓存', value: true },
{ label: '不缓存', value: false },
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
defaultValue: true,

View File

@@ -29,8 +29,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
},
@@ -46,8 +44,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -75,8 +75,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -61,9 +61,7 @@ function handleSend(row: SystemNotifyTemplateApi.NotifyTemplate) {
async function handleDelete(row: SystemNotifyTemplateApi.NotifyTemplate) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteNotifyTemplate(row.id!);

View File

@@ -65,8 +65,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
@@ -96,7 +94,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE),
mode: 'multiple',
tag: true,
multiple: true,
placeholder: '请输入授权类型',
},
rules: 'required',
@@ -107,8 +106,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
placeholder: '请输入授权范围',
mode: 'tags',
clearable: true,
tag: true,
multiple: true,
filterable: true,
},
},
{
@@ -117,7 +117,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
placeholder: '请输入自动授权范围',
mode: 'multiple',
tag: true,
multiple: true,
filterable: true,
},
dependencies: {
triggerFields: ['scopes'],
@@ -137,7 +139,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
placeholder: '请输入可重定向的 URI 地址',
mode: 'tags',
tag: true,
multiple: true,
filterable: true,
},
rules: 'required',
},
@@ -147,7 +151,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
placeholder: '请输入权限',
mode: 'tags',
tag: true,
multiple: true,
filterable: true,
},
},
{
@@ -155,7 +161,9 @@ export function useFormSchema(): VbenFormSchema[] {
label: '资源',
component: 'Select',
componentProps: {
mode: 'tags',
tag: true,
multiple: true,
filterable: true,
placeholder: '请输入资源',
},
},

View File

@@ -26,9 +26,7 @@ function handleRefresh() {
async function handleDelete(row: SystemOAuth2TokenApi.OAuth2Token) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', ['令牌']),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteOAuth2Token(row.accessToken);

View File

@@ -44,8 +44,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -50,8 +50,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -43,8 +43,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -95,12 +95,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
title: '编号',
minWidth: 100,
},
{
field: 'createTime',
title: '创建时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'mobile',
title: '手机号',

View File

@@ -65,8 +65,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -61,9 +61,7 @@ function handleSend(row: SystemSmsTemplateApi.SmsTemplate) {
async function handleDelete(row: SystemSmsTemplateApi.SmsTemplate) {
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{
duration: 0,
},
{ duration: 0 },
);
try {
await deleteSmsTemplate(row.id!);

View File

@@ -45,8 +45,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'required',
},
@@ -87,8 +85,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -41,10 +41,10 @@ function handleEdit(row: SystemSocialClientApi.SocialClient) {
/** 删除社交客户端 */
async function handleDelete(row: SystemSocialClientApi.SocialClient) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
duration: 0,
});
const hideLoading = message.loading(
$t('ui.actionMessage.deleting', [row.name]),
{ duration: 0 },
);
try {
await deleteSocialClient(row.id!);
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
@@ -57,8 +57,7 @@ async function handleDelete(row: SystemSocialClientApi.SocialClient) {
/** 批量删除社交客户端 */
async function handleDeleteBatch() {
await confirm($t('ui.actionMessage.deleteBatchConfirm'));
const hideLoading = message.loading({
content: $t('ui.actionMessage.deletingBatch'),
const hideLoading = message.loading($t('ui.actionMessage.deletingBatch'), {
duration: 0,
});
try {
@@ -150,6 +149,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
{
label: $t('common.edit'),
type: 'primary',
text: true,
icon: ACTION_ICON.EDIT,
auth: ['system:social-client:update'],
onClick: handleEdit.bind(null, row),

View File

@@ -72,7 +72,10 @@ export function useFormSchema(): VbenFormSchema[] {
{
label: '用户密码',
fieldName: 'password',
component: 'InputPassword',
component: 'Input',
componentProps: {
type: 'password',
},
rules: 'required',
dependencies: {
triggerFields: ['id'],
@@ -90,8 +93,8 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'expireTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD',
valueFormat: 'x',
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
placeholder: '请选择过期时间',
},
rules: 'required',
@@ -102,8 +105,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
placeholder: '请输入绑定域名',
mode: 'tags',
clearable: true,
tag: true,
multiple: true,
filterable: true,
},
},
{
@@ -112,8 +116,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -162,6 +162,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
{
label: $t('common.edit'),
type: 'primary',
text: true,
icon: ACTION_ICON.EDIT,
auth: ['system:tenant:update'],
onClick: handleEdit.bind(null, row),

View File

@@ -36,8 +36,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},

View File

@@ -149,6 +149,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
{
label: $t('common.edit'),
type: 'primary',
text: true,
icon: ACTION_ICON.EDIT,
auth: ['system:tenant-package:update'],
onClick: handleEdit.bind(null, row),

View File

@@ -135,7 +135,7 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
<Modal :title="getTitle" class="w-2/5">
<Form class="mx-6">
<template #menuIds="slotProps">
<NSpin :show="menuLoading" content-class="w-full">
<NSpin :show="menuLoading" class="w-full">
<Tree
class="max-h-96 overflow-y-auto"
:tree-data="menuTree"

View File

@@ -33,7 +33,10 @@ export function useFormSchema(): VbenFormSchema[] {
{
label: '用户密码',
fieldName: 'password',
component: 'InputPassword',
component: 'Input',
componentProps: {
type: 'password',
},
rules: 'required',
dependencies: {
triggerFields: ['id'],
@@ -70,7 +73,8 @@ export function useFormSchema(): VbenFormSchema[] {
api: getSimplePostList,
labelField: 'name',
valueField: 'id',
mode: 'multiple',
tag: true,
multiple: true,
placeholder: '请选择岗位',
},
},
@@ -97,8 +101,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(1),
},
@@ -108,8 +110,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
@@ -219,7 +219,8 @@ export function useAssignRoleFormSchema(): VbenFormSchema[] {
api: getSimpleRoleList,
labelField: 'name',
valueField: 'id',
mode: 'multiple',
tag: true,
multiple: true,
placeholder: '请选择角色',
},
},