Files
admin-vben5/apps/web-antd/src/views/property/building/data.ts

178 lines
3.1 KiB
TypeScript
Raw Normal View History

2025-06-18 11:03:42 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
2025-06-28 02:41:09 +08:00
fieldName: 'communityName',
label: '社区',
2025-06-18 11:03:42 +08:00
},
{
component: 'Input',
2025-06-27 15:16:06 +08:00
fieldName: 'buildingName',
label: '建筑名称',
2025-06-18 11:03:42 +08:00
},
{
component: 'Input',
2025-06-28 02:41:09 +08:00
fieldName: 'unitCount',
label: '单元数',
2025-06-19 09:50:46 +08:00
},
2025-06-18 11:03:42 +08:00
];
2025-06-28 02:41:09 +08:00
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
2025-06-18 11:03:42 +08:00
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '建筑名称',
field: 'buildingName',
},
{
2025-06-28 02:41:09 +08:00
title: '省',
field: 'province',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '市',
field: 'city',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '区',
field: 'district',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '总层数',
field: 'floorCount',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '单元数',
field: 'unitCount',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '建筑类型',
field: 'buildType',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '电梯数量',
field: 'elevatorCount',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '竣工日期',
field: 'completionDate',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '地址',
field: 'addr',
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
title: '经度',
field: 'lon',
2025-06-18 11:03:42 +08:00
},
2025-06-19 09:50:46 +08:00
{
2025-06-28 02:41:09 +08:00
title: '维度',
field: 'lat',
2025-06-19 09:50:46 +08:00
},
2025-06-18 11:03:42 +08:00
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
2025-06-19 09:50:46 +08:00
label: '',
2025-06-18 11:03:42 +08:00
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
2025-06-28 02:41:09 +08:00
label: '园区编码',
fieldName: 'communityId',
2025-06-18 11:03:42 +08:00
component: 'Input',
rules: 'required',
},
{
label: '建筑名称',
fieldName: 'buildingName',
component: 'Input',
rules: 'required',
},
{
label: '省',
fieldName: 'province',
component: 'Input',
rules: 'required',
},
{
label: '市',
fieldName: 'city',
component: 'Input',
rules: 'required',
},
{
label: '区',
fieldName: 'district',
component: 'Input',
rules: 'required',
},
{
2025-06-28 02:41:09 +08:00
label: '总层数',
fieldName: 'floorCount',
2025-06-18 11:03:42 +08:00
component: 'Input',
},
{
2025-06-28 02:41:09 +08:00
label: '单元数',
fieldName: 'unitCount',
2025-06-18 11:03:42 +08:00
component: 'Input',
},
{
2025-06-28 02:41:09 +08:00
label: '建筑类型',
fieldName: 'buildType',
2025-06-18 16:50:58 +08:00
component: 'Select',
2025-06-28 02:41:09 +08:00
componentProps: {},
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
label: '电梯数量',
fieldName: 'elevatorCount',
2025-06-18 11:03:42 +08:00
component: 'Input',
},
{
2025-06-28 02:41:09 +08:00
label: '竣工日期',
fieldName: 'completionDate',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
2025-06-18 11:03:42 +08:00
},
{
2025-06-28 02:41:09 +08:00
label: '地址',
fieldName: 'addr',
2025-06-18 11:03:42 +08:00
component: 'Input',
rules: 'required',
},
{
2025-06-28 02:41:09 +08:00
label: '经度',
fieldName: 'lon',
2025-06-18 11:03:42 +08:00
component: 'Input',
rules: 'required',
},
{
2025-06-28 02:41:09 +08:00
label: '维度',
fieldName: 'lat',
2025-06-18 11:03:42 +08:00
component: 'Input',
rules: 'required',
},
{
label: '排序字段',
2025-06-19 09:50:46 +08:00
fieldName: 'sort',
2025-06-18 11:03:42 +08:00
component: 'Input',
2025-06-28 02:41:09 +08:00
},
2025-06-18 11:03:42 +08:00
];