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

195 lines
3.8 KiB
TypeScript
Raw Normal View History

2025-07-07 17:30:51 +08:00
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
2025-07-04 17:56:14 +08:00
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '会议室名称',
},
2025-07-07 17:30:51 +08:00
{
component: 'InputNumber',
fieldName: 'personNumber',
label: '可容纳人数',
componentProps: {
min: 1,
step: 1,
precision:0,
}
},
2025-07-04 17:56:14 +08:00
{
component: 'Select',
componentProps: {
options: getDictOptions('meeting_room_status'),
},
2025-07-07 17:30:51 +08:00
fieldName: 'status',
2025-07-04 17:56:14 +08:00
label: '状态',
},
];
export const columns: VxeGridProps['columns'] = [
2025-07-07 17:30:51 +08:00
{type: 'checkbox', width: 60},
2025-07-04 17:56:14 +08:00
{
title: '会议室名称',
field: 'name',
2025-07-07 17:30:51 +08:00
minWidth:100,
2025-07-04 17:56:14 +08:00
},
2025-07-23 16:28:30 +08:00
// {
// title: '会议室地址',
// field: 'locationName',
// width:210,
// },
2025-07-04 17:56:14 +08:00
{
2025-07-23 16:28:30 +08:00
title: '配套设备',
field: 'baseService',
2025-07-07 17:30:51 +08:00
width:210,
2025-07-04 17:56:14 +08:00
},
{
title: '可容纳人数',
field: 'personNumber',
2025-07-07 17:30:51 +08:00
width:100,
2025-07-04 17:56:14 +08:00
},
{
2025-07-07 17:30:51 +08:00
title: '费用模式',
field: 'expenseType',
2025-07-04 17:56:14 +08:00
slots: {
2025-07-07 17:30:51 +08:00
default: ({row}) => {
return renderDict(row.expenseType, 'wy_fyms');
2025-07-04 17:56:14 +08:00
},
},
2025-07-07 17:30:51 +08:00
width:100,
2025-07-04 17:56:14 +08:00
},
{
2025-07-07 17:30:51 +08:00
title: '开放时段',
field: 'openHours',
width:100,
2025-07-04 17:56:14 +08:00
},
{
2025-07-07 17:30:51 +08:00
title: '状态',
field: 'status',
slots: {
default: 'status'
},
width:100,
2025-07-04 17:56:14 +08:00
},
{
field: 'action',
fixed: 'right',
2025-07-07 17:30:51 +08:00
slots: {default: 'action'},
2025-07-04 17:56:14 +08:00
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '会议室名称',
fieldName: 'name',
component: 'Input',
rules: 'required',
2025-07-07 17:30:51 +08:00
formItemClass: 'col-span-1',
},
{
label: '可容纳人数',
fieldName: 'personNumber',
component: 'InputNumber',
rules: 'required',
formItemClass: 'col-span-1',
componentProps: {
min: 1,
step: 1,
precision:0,
}
2025-07-04 17:56:14 +08:00
},
{
label: '会议室地址',
fieldName: 'location',
2025-07-07 17:30:51 +08:00
component: 'TreeSelect',
rules: 'selectRequired',
2025-07-04 17:56:14 +08:00
},
{
2025-07-07 17:30:51 +08:00
label: '配套设备',
fieldName: 'baseService',
component: 'Textarea',
2025-07-04 17:56:14 +08:00
rules: 'required',
},
{
2025-07-07 17:30:51 +08:00
label: '负责人',
fieldName: 'principals',
component: 'Select',
rules: 'selectRequired',
},
{
label: '费用模式',
fieldName: 'expenseType',
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
options: getDictOptions('wy_fyms'),
},
formItemClass: 'col-span-1',
2025-07-04 17:56:14 +08:00
rules: 'required',
},
{
2025-07-07 17:30:51 +08:00
label: '付费金额',
2025-07-04 17:56:14 +08:00
fieldName: 'basePrice',
2025-07-07 17:30:51 +08:00
component: 'InputNumber',
componentProps: {
min: 0,
step: 1,
precision:2,
},
formItemClass: 'col-span-1',
dependencies: {
// 仅当 费用模式 为 2付费 时显示
show: (formValues: any) => formValues.expenseType === '2',
triggerFields: ['expenseType'],
},
2025-07-04 17:56:14 +08:00
rules: 'required',
},
{
2025-07-07 17:30:51 +08:00
label: '会议室图片',
fieldName: 'picture',
component: 'ImageUpload',
2025-07-04 17:56:14 +08:00
componentProps: {
2025-07-07 17:30:51 +08:00
maxCount: 10, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
2025-07-04 17:56:14 +08:00
},
},
{
2025-07-07 17:30:51 +08:00
label: '预约是否需要审核',
fieldName: 'isCheck',
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
options: getDictOptions('wy_sf'),
},
labelWidth:130,
2025-07-04 17:56:14 +08:00
rules: 'required',
},
{
2025-07-07 17:30:51 +08:00
label: '开放时段',
fieldName: 'openHours',
2025-07-04 17:56:14 +08:00
component: 'Input',
2025-07-07 17:30:51 +08:00
slots: {default: 'openHours'},
formItemClass: 'col-span-1',
2025-07-04 17:56:14 +08:00
rules: 'required',
},
2025-07-07 17:30:51 +08:00
{
label: '会议室描述',
fieldName: 'descs',
component: 'Textarea',
},
2025-07-04 17:56:14 +08:00
];