172 lines
3.2 KiB
TypeScript
172 lines
3.2 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: 'roomCode',
|
||
|
label: '房间编码',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'roomNumber',
|
||
|
label: '房间号',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('room_type'),
|
||
|
},
|
||
|
fieldName: 'roomType',
|
||
|
label: '房间类型',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('wy_fjzt'),
|
||
|
},
|
||
|
fieldName: 'status',
|
||
|
label: '房间状态',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||
|
export const columns: VxeGridProps['columns'] = [
|
||
|
{ type: 'checkbox', width: 60 },
|
||
|
{
|
||
|
title: '所属楼层ID',
|
||
|
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: '所属楼层ID',
|
||
|
fieldName: 'floorCode',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '房间编码',
|
||
|
fieldName: 'roomCode',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '房间号(如101,202)',
|
||
|
fieldName: 'roomNumber',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '房间类型',
|
||
|
fieldName: 'roomType',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('room_type'),
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '面积(平方米)',
|
||
|
fieldName: 'area',
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '户型(如2室1厅1卫)',
|
||
|
fieldName: 'layout',
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '朝向',
|
||
|
fieldName: 'orientation',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('direction_towards'),
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '是否可售',
|
||
|
fieldName: 'isForSale',
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '房间状态',
|
||
|
fieldName: 'status',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('wy_fjzt'),
|
||
|
},
|
||
|
},
|
||
|
];
|