综合管理

This commit is contained in:
FLL
2025-06-27 15:16:06 +08:00
parent ca24234e57
commit 01ddd1174a
20 changed files with 139 additions and 318 deletions

View File

@@ -1,6 +1,5 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
@@ -8,51 +7,47 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'communityName',
label: '区名称',
label: '区名称',
},
{
component: 'Input',
fieldName: 'communityCode',
label: '区编码',
label: '区编码',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
fieldName: 'communityType',
label: '区类型',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态',
label: '区类型',
}
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键',
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '区名称',
title: '区名称',
field: 'communityName',
},
{
title: '区编码',
title: '区编码',
field: 'communityCode',
},
{
title: '区类型',
title: '区类型',
field: 'communityType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
return renderDict(row.communityType, 'wy_sqlx');
},
},
@@ -85,10 +80,6 @@ export const columns: VxeGridProps['columns'] = [
title: '小图图片',
field: 'img',
},
{
title: '数据状态',
field: 'dataState',
},
{
title: '修改时间',
field: 'modifyTime',
@@ -113,23 +104,22 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '区名称',
label: '区名称',
fieldName: 'communityName',
component: 'Input',
rules: 'required',
},
{
label: '区编码',
label: '区编码',
fieldName: 'communityCode',
component: 'Input',
rules: 'required',
},
{
label: '区类型',
label: '区类型',
fieldName: 'communityType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
rules: 'selectRequired',
@@ -175,24 +165,6 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'img',
component: 'ImageUpload',
componentProps: {
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
// maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
},
},
{
label: '数据状态',
fieldName: 'dataState',
component: 'Input',
rules: 'required',
},
{
label: '修改时间',
fieldName: 'modifyTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
}
];