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', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: true, defaultValue: true,
rules: 'required', rules: 'required',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,8 +9,6 @@ import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
import { formatDateTime } from '@vben/utils'; import { formatDateTime } from '@vben/utils';
import dayjs from 'dayjs';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
/** 列表的搜索表单 */ /** 列表的搜索表单 */
@@ -31,12 +29,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
clearable: true, clearable: true,
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
defaultTime: '00:00:00',
placeholder: '选择开始执行时间', 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', component: 'DatePicker',
componentProps: { componentProps: {
clearable: true, clearable: true,
type: 'datetime',
valueFormat: 'YYYY-MM-dd HH:mm:ss',
defaultTime: '23:59:59',
placeholder: '选择结束执行时间', 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', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

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

View File

@@ -50,8 +50,6 @@ export function useTypeFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
@@ -234,8 +232,6 @@ export function useDataFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
placeholder: '请选择状态', placeholder: '请选择状态',
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), 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 { confirm, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
import { NTag } from 'naive-ui';
import { message } from '#/adapter/naive'; import { message } from '#/adapter/naive';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { import {
@@ -173,10 +175,14 @@ watch(
/> />
</template> </template>
<template #colorType="{ row }"> <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>
<template #cssClass="{ row }"> <template #cssClass="{ row }">
<Tag :color="row.cssClass">{{ row.cssClass }}</Tag> <NTag v-if="row.cssClass" :color="{ color: row.cssClass }">
{{ row.cssClass }}
</NTag>
</template> </template>
<template #actions="{ row }"> <template #actions="{ row }">
<TableAction <TableAction

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -149,6 +149,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
{ {
label: $t('common.edit'), label: $t('common.edit'),
type: 'primary', type: 'primary',
text: true,
icon: ACTION_ICON.EDIT, icon: ACTION_ICON.EDIT,
auth: ['system:tenant-package:update'], auth: ['system:tenant-package:update'],
onClick: handleEdit.bind(null, row), 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"> <Modal :title="getTitle" class="w-2/5">
<Form class="mx-6"> <Form class="mx-6">
<template #menuIds="slotProps"> <template #menuIds="slotProps">
<NSpin :show="menuLoading" content-class="w-full"> <NSpin :show="menuLoading" class="w-full">
<Tree <Tree
class="max-h-96 overflow-y-auto" class="max-h-96 overflow-y-auto"
:tree-data="menuTree" :tree-data="menuTree"

View File

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