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

140 lines
2.8 KiB
TypeScript
Raw Normal View History

2025-06-28 02:41:09 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
2025-06-28 22:49:40 +08:00
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
import { DictEnum } from '@vben/constants';
2025-06-26 18:04:51 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
2025-06-28 02:41:09 +08:00
fieldName: 'communityName',
label: '社区',
2025-06-26 18:04:51 +08:00
},
{
component: 'Input',
2025-06-28 02:41:09 +08:00
fieldName: 'orientation',
label: '朝向',
2025-06-28 22:49:40 +08:00
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.wy_direction_towards),
},
2025-06-26 18:04:51 +08:00
},
{
component: 'Select',
2025-06-28 22:49:40 +08:00
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.wy_fjzt),
},
2025-06-26 18:04:51 +08:00
fieldName: 'status',
2025-06-28 02:41:09 +08:00
label: '状态',
2025-06-26 18:04:51 +08:00
},
];
2025-06-28 02:41:09 +08:00
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
2025-06-26 18:04:51 +08:00
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '房间号',
field: 'roomNumber',
},
{
title: '房间类型',
2025-06-28 22:49:40 +08:00
field: 'roomTypeName',
2025-06-26 18:04:51 +08:00
},
{
2025-06-28 22:49:40 +08:00
title: '面积',
2025-06-26 18:04:51 +08:00
field: 'area',
},
{
title: '户型',
field: 'layout',
},
{
title: '朝向',
2025-06-28 22:49:40 +08:00
field: 'orientationName',
2025-06-26 18:04:51 +08:00
},
{
title: '是否可售',
field: 'isForSale',
},
{
2025-06-28 02:41:09 +08:00
title: '状态',
2025-06-28 22:49:40 +08:00
field: 'statusName',
2025-06-26 18:04:51 +08:00
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
2025-06-28 02:41:09 +08:00
label: '',
2025-06-26 18:04:51 +08:00
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
2025-06-28 22:49:40 +08:00
component: 'TreeSelect',
2025-06-28 02:41:09 +08:00
fieldName: 'floorId',
2025-06-28 22:49:40 +08:00
defaultValue: undefined,
label: '社区建筑',
rules: 'selectRequired',
2025-06-26 18:04:51 +08:00
},
{
2025-06-28 22:49:40 +08:00
label: '房间号',
2025-06-26 18:04:51 +08:00
fieldName: 'roomNumber',
component: 'Input',
rules: 'required',
},
{
label: '房间类型',
fieldName: 'roomType',
component: 'Select',
2025-06-28 22:49:40 +08:00
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.wy_room_type),
},
2025-06-26 18:04:51 +08:00
},
{
2025-06-28 22:49:40 +08:00
label: '面积',
2025-06-26 18:04:51 +08:00
fieldName: 'area',
component: 'Input',
},
{
2025-06-27 15:16:06 +08:00
label: '户型',
2025-06-26 18:04:51 +08:00
fieldName: 'layout',
component: 'Input',
},
{
label: '朝向',
fieldName: 'orientation',
2025-06-28 22:49:40 +08:00
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.wy_direction_towards),
},
2025-06-26 18:04:51 +08:00
},
{
label: '是否可售',
fieldName: 'isForSale',
2025-06-28 02:41:09 +08:00
component: 'Input',
2025-06-26 18:04:51 +08:00
},
{
2025-06-28 02:41:09 +08:00
label: '状态',
2025-06-26 18:04:51 +08:00
fieldName: 'status',
component: 'Select',
2025-06-28 22:49:40 +08:00
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.wy_fjzt),
},
2025-06-26 18:04:51 +08:00
},
];