2025-06-18 11:03:42 +08:00
|
|
|
import type { FormSchemaGetter } from '#/adapter/form';
|
|
|
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
|
|
|
2025-06-18 16:50:58 +08:00
|
|
|
import { getDictOptions } from '#/utils/dict';
|
|
|
|
import { renderDict } from '#/utils/render';
|
2025-06-18 11:03:42 +08:00
|
|
|
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomName',
|
|
|
|
label: '会议室名称',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomNo',
|
|
|
|
label: '会议室编号',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomLocation',
|
|
|
|
label: '会议室位置',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomArea',
|
|
|
|
label: '会议室面积',
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'Input',
|
2025-06-18 11:03:42 +08:00
|
|
|
fieldName: 'roomType',
|
|
|
|
label: '会议室类型',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomNumber',
|
|
|
|
label: '会议室容纳人数',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'roomFacilities',
|
|
|
|
label: '会议室配套设施',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Select',
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_HYSJGLX 便于维护
|
|
|
|
options: getDictOptions('wy_hysjglx'),
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
fieldName: 'feeType',
|
|
|
|
label: '会议室价格类型',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'feePrice',
|
|
|
|
label: '费用金额',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'responsiblePerson',
|
|
|
|
label: '负责人',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'contactNumber',
|
|
|
|
label: '联系电话',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'pictures',
|
|
|
|
label: '会议室照片',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'description',
|
|
|
|
label: '会议室描述',
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'RadioGroup',
|
|
|
|
componentProps: {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
|
|
|
options: getDictOptions('wy_sf'),
|
|
|
|
buttonStyle: 'solid',
|
|
|
|
optionType: 'button',
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
fieldName: 'review',
|
|
|
|
label: '是否需要审核',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'RadioGroup',
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
|
|
|
|
options: getDictOptions('wy_kg'),
|
2025-06-18 11:03:42 +08:00
|
|
|
buttonStyle: 'solid',
|
|
|
|
optionType: 'button',
|
|
|
|
},
|
|
|
|
fieldName: 'enabledStatus',
|
|
|
|
label: '启用状态',
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'Select',
|
|
|
|
componentProps: {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_XQ 便于维护
|
|
|
|
options: getDictOptions('wy_xq'),
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
fieldName: 'openingWeek',
|
|
|
|
label: '开放星期',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
showTime: true,
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
},
|
|
|
|
fieldName: 'openingBeginTime',
|
|
|
|
label: '开放开始时间',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
showTime: true,
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
},
|
|
|
|
fieldName: 'openingEndTime',
|
|
|
|
label: '开放结束时间',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
|
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
|
|
export const columns: VxeGridProps['columns'] = [
|
|
|
|
{ type: 'checkbox', width: 60 },
|
|
|
|
{
|
|
|
|
title: '会议室名称',
|
|
|
|
field: 'roomName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室编号',
|
|
|
|
field: 'roomNo',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室位置',
|
|
|
|
field: 'roomLocation',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室面积',
|
|
|
|
field: 'roomArea',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室类型',
|
|
|
|
field: 'roomType',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室容纳人数',
|
|
|
|
field: 'roomNumber',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室配套设施',
|
|
|
|
field: 'roomFacilities',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室价格类型',
|
|
|
|
field: 'feeType',
|
2025-06-18 16:50:58 +08:00
|
|
|
slots: {
|
|
|
|
default: ({ row }) => {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_HYSJGLX 便于维护
|
|
|
|
return renderDict(row.feeType, 'wy_hysjglx');
|
|
|
|
},
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '费用金额',
|
|
|
|
field: 'feePrice',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '负责人',
|
|
|
|
field: 'responsiblePerson',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '联系电话',
|
|
|
|
field: 'contactNumber',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室照片',
|
|
|
|
field: 'pictures',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '会议室描述',
|
|
|
|
field: 'description',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '是否需要审核',
|
|
|
|
field: 'review',
|
2025-06-18 16:50:58 +08:00
|
|
|
slots: {
|
|
|
|
default: ({ row }) => {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
|
|
|
return renderDict(row.review, 'wy_sf');
|
|
|
|
},
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '启用状态',
|
|
|
|
field: 'enabledStatus',
|
2025-06-18 16:50:58 +08:00
|
|
|
slots: {
|
|
|
|
default: ({ row }) => {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
|
|
|
|
return renderDict(row.enabledStatus, 'wy_kg');
|
|
|
|
},
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '开放星期',
|
|
|
|
field: 'openingWeek',
|
2025-06-18 16:50:58 +08:00
|
|
|
slots: {
|
|
|
|
default: ({ row }) => {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_XQ 便于维护
|
|
|
|
return renderDict(row.openingWeek, 'wy_xq');
|
|
|
|
},
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '开放开始时间',
|
|
|
|
field: 'openingBeginTime',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '开放结束时间',
|
|
|
|
field: 'openingEndTime',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'action',
|
|
|
|
fixed: 'right',
|
|
|
|
slots: { default: 'action' },
|
|
|
|
title: '操作',
|
|
|
|
width: 180,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const modalSchema: FormSchemaGetter = () => [
|
|
|
|
{
|
|
|
|
label: 'id',
|
|
|
|
fieldName: 'id',
|
|
|
|
component: 'Input',
|
|
|
|
dependencies: {
|
|
|
|
show: () => false,
|
|
|
|
triggerFields: [''],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室名称',
|
|
|
|
fieldName: 'roomName',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室编号',
|
|
|
|
fieldName: 'roomNo',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室位置',
|
|
|
|
fieldName: 'roomLocation',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室面积',
|
|
|
|
fieldName: 'roomArea',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室类型',
|
|
|
|
fieldName: 'roomType',
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室容纳人数',
|
|
|
|
fieldName: 'roomNumber',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室配套设施',
|
|
|
|
fieldName: 'roomFacilities',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室价格类型',
|
|
|
|
fieldName: 'feeType',
|
|
|
|
component: 'Select',
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_HYSJGLX 便于维护
|
|
|
|
options: getDictOptions('wy_hysjglx'),
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
rules: 'selectRequired',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '费用金额',
|
|
|
|
fieldName: 'feePrice',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '负责人',
|
|
|
|
fieldName: 'responsiblePerson',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '联系电话',
|
|
|
|
fieldName: 'contactNumber',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室照片',
|
|
|
|
fieldName: 'pictures',
|
|
|
|
component: 'Input',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '会议室描述',
|
|
|
|
fieldName: 'description',
|
|
|
|
component: 'Input',
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否需要审核',
|
|
|
|
fieldName: 'review',
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'RadioGroup',
|
|
|
|
componentProps: {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
|
|
|
options: getDictOptions('wy_sf'),
|
|
|
|
buttonStyle: 'solid',
|
|
|
|
optionType: 'button',
|
|
|
|
},
|
|
|
|
rules: 'selectRequired',
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '启用状态',
|
|
|
|
fieldName: 'enabledStatus',
|
|
|
|
component: 'RadioGroup',
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
|
|
|
|
options: getDictOptions('wy_kg'),
|
2025-06-18 11:03:42 +08:00
|
|
|
buttonStyle: 'solid',
|
|
|
|
optionType: 'button',
|
|
|
|
},
|
|
|
|
rules: 'selectRequired',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '开放星期',
|
|
|
|
fieldName: 'openingWeek',
|
2025-06-18 16:50:58 +08:00
|
|
|
component: 'Select',
|
|
|
|
componentProps: {
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_XQ 便于维护
|
|
|
|
options: getDictOptions('wy_xq'),
|
|
|
|
},
|
|
|
|
rules: 'selectRequired',
|
2025-06-18 11:03:42 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '开放开始时间',
|
|
|
|
fieldName: 'openingBeginTime',
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
showTime: true,
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
},
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '开放结束时间',
|
|
|
|
fieldName: 'openingEndTime',
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
showTime: true,
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
},
|
|
|
|
rules: 'required',
|
|
|
|
},
|
|
|
|
];
|