194 lines
3.4 KiB
TypeScript
194 lines
3.4 KiB
TypeScript
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||
|
|
||
|
|
||
|
export const querySchema: FormSchemaGetter = () => [
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'name',
|
||
|
label: '入驻单位名称',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'unitNumber',
|
||
|
label: '单位编号',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
},
|
||
|
fieldName: 'type',
|
||
|
label: '企业类型',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'contactPerson',
|
||
|
label: '联系人',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'phone',
|
||
|
label: '联系电话',
|
||
|
},
|
||
|
{
|
||
|
component: 'Textarea',
|
||
|
fieldName: 'location',
|
||
|
label: '入驻位置',
|
||
|
},
|
||
|
{
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
showTime: true,
|
||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
},
|
||
|
fieldName: 'time',
|
||
|
label: '入驻时间',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'state',
|
||
|
label: '状态',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'number',
|
||
|
label: '员工人数',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||
|
export const columns: VxeGridProps['columns'] = [
|
||
|
{ type: 'checkbox', width: 60 },
|
||
|
{
|
||
|
title: 'id',
|
||
|
field: 'id',
|
||
|
},
|
||
|
{
|
||
|
title: '入驻单位名称',
|
||
|
field: 'name',
|
||
|
},
|
||
|
{
|
||
|
title: '单位编号',
|
||
|
field: 'unitNumber',
|
||
|
},
|
||
|
{
|
||
|
title: '企业类型',
|
||
|
field: 'type',
|
||
|
},
|
||
|
{
|
||
|
title: '联系人',
|
||
|
field: 'contactPerson',
|
||
|
},
|
||
|
{
|
||
|
title: '联系电话',
|
||
|
field: 'phone',
|
||
|
},
|
||
|
{
|
||
|
title: '入驻位置',
|
||
|
field: 'location',
|
||
|
},
|
||
|
{
|
||
|
title: '入驻时间',
|
||
|
field: 'time',
|
||
|
},
|
||
|
{
|
||
|
title: '状态',
|
||
|
field: 'state',
|
||
|
},
|
||
|
{
|
||
|
title: '员工人数',
|
||
|
field: 'number',
|
||
|
},
|
||
|
{
|
||
|
title: '备注',
|
||
|
field: 'remark',
|
||
|
},
|
||
|
{
|
||
|
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: 'name',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '单位编号',
|
||
|
fieldName: 'unitNumber',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '企业类型',
|
||
|
fieldName: 'type',
|
||
|
component: 'Input',
|
||
|
componentProps: {
|
||
|
},
|
||
|
rules: 'selectRequired',
|
||
|
},
|
||
|
{
|
||
|
label: '联系人',
|
||
|
fieldName: 'contactPerson',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '联系电话',
|
||
|
fieldName: 'phone',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '入驻位置',
|
||
|
fieldName: 'location',
|
||
|
component: 'Textarea',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '入驻时间',
|
||
|
fieldName: 'time',
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
showTime: true,
|
||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
},
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '状态',
|
||
|
fieldName: 'state',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '员工人数',
|
||
|
fieldName: 'number',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '备注',
|
||
|
fieldName: 'remark',
|
||
|
component: 'Textarea',
|
||
|
},
|
||
|
];
|