This commit is contained in:
2025-06-18 16:50:58 +08:00
parent 1262d4c745
commit 06a0e3649d
46 changed files with 3048 additions and 545 deletions

View File

@@ -1,6 +1,8 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
@@ -16,6 +18,8 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
fieldName: 'communityType',
label: '社区类型 1园区2小区',
@@ -71,10 +75,6 @@ export const querySchema: FormSchemaGetter = () => [
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键id',
field: 'id',
},
{
title: '社区名称',
field: 'communityName',
@@ -86,6 +86,12 @@ export const columns: VxeGridProps['columns'] = [
{
title: '社区类型 1园区2小区',
field: 'communityType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
return renderDict(row.communityType, 'wy_sqlx');
},
},
},
{
title: '省',
@@ -119,10 +125,6 @@ export const columns: VxeGridProps['columns'] = [
title: '组织编码',
field: 'orgCode',
},
{
title: '数据状态1有效0无效',
field: 'dataState',
},
{
field: 'action',
fixed: 'right',
@@ -159,6 +161,8 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'communityType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
rules: 'selectRequired',
},
@@ -201,7 +205,11 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '小图图片',
fieldName: 'img',
component: 'Input',
component: 'ImageUpload',
componentProps: {
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
// maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
},
},
{
label: '组织编码',
@@ -209,10 +217,4 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
fieldName: 'dataState',
component: 'Input',
rules: 'required',
},
];