Files
admin-vben5/apps/web-antd/src/views/property/room/data.ts
2025-06-27 15:16:06 +08:00

196 lines
3.5 KiB
TypeScript

import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
fieldName: 'floorCode',
label: '所属社区',
},
{
component: 'Select',
fieldName: 'floorCode1',
label: '所属建筑',
},
{
component: 'Select',
fieldName: 'floorCode2',
label: '所属单元',
},
{
component: 'Select',
fieldName: 'floorCode3',
label: '所属楼层',
},
{
component: 'Input',
fieldName: 'roomNumber',
label: '房间号',
},
{
component: 'Input',
fieldName: 'roomCode',
label: '房间编码',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
fieldName: 'roomType',
label: '房间类型',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
fieldName: 'status',
label: '房间状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '所属楼层',
field: 'floorCode',
},
{
title: '房间编码',
field: 'roomCode',
},
{
title: '房间号',
field: 'roomNumber',
},
{
title: '房间类型',
field: 'roomType',
},
{
title: '面积(㎡)',
field: 'area',
},
{
title: '户型',
field: 'layout',
},
{
title: '朝向',
field: 'orientation',
},
{
title: '是否可售',
field: 'isForSale',
},
{
title: '房间状态',
field: 'status',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '所属社区',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属建筑',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属单元',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属楼层',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '房间号',
fieldName: 'roomNumber',
component: 'Input',
rules: 'required',
},
{
label: '房间编码',
fieldName: 'roomCode',
component: 'Input',
rules: 'required',
},
{
label: '房间类型',
fieldName: 'roomType',
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
},
{
label: '面积(㎡)',
fieldName: 'area',
component: 'Input',
},
{
label: '户型',
fieldName: 'layout',
component: 'Input',
},
{
label: '朝向',
fieldName: 'orientation',
component: 'Select',
componentProps: {
options: getDictOptions('direction_towards'),
},
},
{
label: '是否可售',
fieldName: 'isForSale',
component: 'Select',
},
{
label: '房间状态',
fieldName: 'status',
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
},
];