From a5e34068491995c1a0d9a323a0546d92d91e75a9 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Fri, 17 Oct 2025 11:24:07 +0800 Subject: [PATCH] fix: naive code --- apps/web-naive/src/views/infra/config/data.ts | 2 -- .../src/views/infra/demo/demo01/data.ts | 7 ++-- .../src/views/infra/demo/demo03/erp/data.ts | 7 ++-- .../src/views/infra/demo/demo03/inner/data.ts | 7 ++-- .../views/infra/demo/demo03/inner/index.vue | 4 +-- .../views/infra/demo/demo03/normal/data.ts | 7 ++-- .../views/infra/demo/demo03/normal/index.vue | 4 +-- apps/web-naive/src/views/infra/file/index.vue | 4 +-- .../src/views/infra/file/modules/form.vue | 35 +++++++++++-------- .../src/views/infra/fileConfig/data.ts | 8 +---- .../src/views/infra/fileConfig/index.vue | 8 ++--- apps/web-naive/src/views/infra/job/index.vue | 4 +-- .../src/views/infra/job/logger/data.ts | 18 ++++------ apps/web-naive/src/views/system/dept/data.ts | 2 -- .../web-naive/src/views/system/dept/index.vue | 4 +-- apps/web-naive/src/views/system/dict/data.ts | 4 --- .../views/system/dict/modules/data-grid.vue | 10 ++++-- .../src/views/system/mail/account/data.ts | 7 ++-- .../src/views/system/mail/template/data.ts | 17 ++++----- apps/web-naive/src/views/system/menu/data.ts | 17 +++------ .../web-naive/src/views/system/notice/data.ts | 4 --- .../src/views/system/notify/template/data.ts | 2 -- .../views/system/notify/template/index.vue | 4 +-- .../src/views/system/oauth2/client/data.ts | 26 +++++++++----- .../src/views/system/oauth2/token/index.vue | 4 +-- apps/web-naive/src/views/system/post/data.ts | 2 -- apps/web-naive/src/views/system/role/data.ts | 2 -- .../src/views/system/sms/channel/data.ts | 2 -- .../src/views/system/sms/log/data.ts | 6 ---- .../src/views/system/sms/template/data.ts | 2 -- .../src/views/system/sms/template/index.vue | 4 +-- .../src/views/system/social/client/data.ts | 4 --- .../src/views/system/social/client/index.vue | 12 +++---- .../web-naive/src/views/system/tenant/data.ts | 16 +++++---- .../src/views/system/tenant/index.vue | 1 + .../src/views/system/tenantPackage/data.ts | 2 -- .../src/views/system/tenantPackage/index.vue | 1 + .../system/tenantPackage/modules/form.vue | 2 +- apps/web-naive/src/views/system/user/data.ts | 15 ++++---- 39 files changed, 112 insertions(+), 175 deletions(-) diff --git a/apps/web-naive/src/views/infra/config/data.ts b/apps/web-naive/src/views/infra/config/data.ts index 0b01c24a8..c5aaf85b8 100644 --- a/apps/web-naive/src/views/infra/config/data.ts +++ b/apps/web-naive/src/views/infra/config/data.ts @@ -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', diff --git a/apps/web-naive/src/views/infra/demo/demo01/data.ts b/apps/web-naive/src/views/infra/demo/demo01/data.ts index 1e15da499..a13c0518d 100644 --- a/apps/web-naive/src/views/infra/demo/demo01/data.ts +++ b/apps/web-naive/src/views/infra/demo/demo01/data.ts @@ -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', }, }, { diff --git a/apps/web-naive/src/views/infra/demo/demo03/erp/data.ts b/apps/web-naive/src/views/infra/demo/demo03/erp/data.ts index 384edb312..56d996089 100644 --- a/apps/web-naive/src/views/infra/demo/demo03/erp/data.ts +++ b/apps/web-naive/src/views/infra/demo/demo03/erp/data.ts @@ -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', }, }, { diff --git a/apps/web-naive/src/views/infra/demo/demo03/inner/data.ts b/apps/web-naive/src/views/infra/demo/demo03/inner/data.ts index 843e67f28..e5662a0bd 100644 --- a/apps/web-naive/src/views/infra/demo/demo03/inner/data.ts +++ b/apps/web-naive/src/views/infra/demo/demo03/inner/data.ts @@ -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', }, }, { diff --git a/apps/web-naive/src/views/infra/demo/demo03/inner/index.vue b/apps/web-naive/src/views/infra/demo/demo03/inner/index.vue index 059dd2a70..976b2da1a 100644 --- a/apps/web-naive/src/views/infra/demo/demo03/inner/index.vue +++ b/apps/web-naive/src/views/infra/demo/demo03/inner/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/infra/demo/demo03/normal/data.ts b/apps/web-naive/src/views/infra/demo/demo03/normal/data.ts index 3a1f04e44..f8b8bccb4 100644 --- a/apps/web-naive/src/views/infra/demo/demo03/normal/data.ts +++ b/apps/web-naive/src/views/infra/demo/demo03/normal/data.ts @@ -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', }, }, { diff --git a/apps/web-naive/src/views/infra/demo/demo03/normal/index.vue b/apps/web-naive/src/views/infra/demo/demo03/normal/index.vue index d21b0ccee..35de85ddf 100644 --- a/apps/web-naive/src/views/infra/demo/demo03/normal/index.vue +++ b/apps/web-naive/src/views/infra/demo/demo03/normal/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/infra/file/index.vue b/apps/web-naive/src/views/infra/file/index.vue index b0cccd21d..0e9bbe99a 100644 --- a/apps/web-naive/src/views/infra/file/index.vue +++ b/apps/web-naive/src/views/infra/file/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/infra/file/modules/form.vue b/apps/web-naive/src/views/infra/file/modules/form.vue index bdc7f7b7e..a1a93e122 100644 --- a/apps/web-naive/src/views/infra/file/modules/form.vue +++ b/apps/web-naive/src/views/infra/file/modules/form.vue @@ -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; } @@ -62,21 +65,23 @@ function beforeUpload(file: UploadFileInfo) { diff --git a/apps/web-naive/src/views/infra/fileConfig/data.ts b/apps/web-naive/src/views/infra/fileConfig/data.ts index 01b8dd01d..85e5fb3cd 100644 --- a/apps/web-naive/src/views/infra/fileConfig/data.ts +++ b/apps/web-naive/src/views/infra/fileConfig/data.ts @@ -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' }, }, diff --git a/apps/web-naive/src/views/infra/fileConfig/index.vue b/apps/web-naive/src/views/infra/fileConfig/index.vue index 47eee8237..e37ba8eda 100644 --- a/apps/web-naive/src/views/infra/fileConfig/index.vue +++ b/apps/web-naive/src/views/infra/fileConfig/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/infra/job/index.vue b/apps/web-naive/src/views/infra/job/index.vue index f8afb03c2..139d4e3e3 100644 --- a/apps/web-naive/src/views/infra/job/index.vue +++ b/apps/web-naive/src/views/infra/job/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/infra/job/logger/data.ts b/apps/web-naive/src/views/infra/job/logger/data.ts index 1dfcd5f68..cf1ec6d88 100644 --- a/apps/web-naive/src/views/infra/job/logger/data.ts +++ b/apps/web-naive/src/views/infra/job/logger/data.ts @@ -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'), - }, }, }, { diff --git a/apps/web-naive/src/views/system/dept/data.ts b/apps/web-naive/src/views/system/dept/data.ts index 2357d958b..4db10e0f6 100644 --- a/apps/web-naive/src/views/system/dept/data.ts +++ b/apps/web-naive/src/views/system/dept/data.ts @@ -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), }, diff --git a/apps/web-naive/src/views/system/dept/index.vue b/apps/web-naive/src/views/system/dept/index.vue index 43d090192..5850e0947 100644 --- a/apps/web-naive/src/views/system/dept/index.vue +++ b/apps/web-naive/src/views/system/dept/index.vue @@ -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!); diff --git a/apps/web-naive/src/views/system/dict/data.ts b/apps/web-naive/src/views/system/dict/data.ts index 3cc948443..a6412bd1f 100644 --- a/apps/web-naive/src/views/system/dict/data.ts +++ b/apps/web-naive/src/views/system/dict/data.ts @@ -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), }, diff --git a/apps/web-naive/src/views/system/dict/modules/data-grid.vue b/apps/web-naive/src/views/system/dict/modules/data-grid.vue index f36df5b2e..4f2eeb25e 100644 --- a/apps/web-naive/src/views/system/dict/modules/data-grid.vue +++ b/apps/web-naive/src/views/system/dict/modules/data-grid.vue @@ -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( />