165 lines
2.9 KiB
TypeScript
165 lines
2.9 KiB
TypeScript
import type {FormSchemaGetter} from '#/adapter/form';
|
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
|
import {getDictOptions} from "#/utils/dict";
|
|
import {renderDict} from "#/utils/render";
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'name',
|
|
label: '单位名称',
|
|
},
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'contactPerson',
|
|
label: '联系人',
|
|
},
|
|
{
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: getDictOptions('wy_state'),
|
|
},
|
|
fieldName: 'state',
|
|
label: '状态',
|
|
},
|
|
];
|
|
|
|
export const columns: VxeGridProps['columns'] = [
|
|
{type: 'checkbox', width: 60},
|
|
{
|
|
title: '序号',
|
|
field: 'id',
|
|
slots: {
|
|
default: ({ rowIndex }) => {
|
|
return (rowIndex + 1).toString();
|
|
},
|
|
},
|
|
},
|
|
{
|
|
title: '单位编号',
|
|
field: 'unitNumber',
|
|
slots:{
|
|
default: ({ row }) => {
|
|
return row.id;
|
|
}}
|
|
},
|
|
{
|
|
title: '单位名称',
|
|
field: 'name',
|
|
},
|
|
{
|
|
title: '单位类型',
|
|
field: 'type',
|
|
slots: {
|
|
default: ({ row }) => {
|
|
return renderDict(row.type, 'wy_qylx');
|
|
},
|
|
},
|
|
},
|
|
{
|
|
title: '联系人',
|
|
field: 'contactPerson',
|
|
},
|
|
{
|
|
title: '联系电话',
|
|
field: 'phone',
|
|
},
|
|
{
|
|
title: '入驻位置',
|
|
field: 'location',
|
|
},
|
|
{
|
|
title: '入驻时间',
|
|
field: 'time',
|
|
},
|
|
{
|
|
title: '状态',
|
|
field: 'state',
|
|
slots: {default: 'state'}
|
|
},
|
|
{
|
|
title: '员工数量',
|
|
field: 'number',
|
|
},
|
|
{
|
|
title: '备注',
|
|
field: 'remark',
|
|
},
|
|
{
|
|
title: '创建时间',
|
|
field: 'createTime',
|
|
},
|
|
{
|
|
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: 'type',
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: getDictOptions('wy_qylx'),
|
|
},
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '联系人',
|
|
fieldName: 'contactPerson',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '联系电话',
|
|
fieldName: 'phone',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
|
|
{
|
|
label: '入驻位置',
|
|
fieldName: 'location',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
formItemClass: 'col-span-2'
|
|
},
|
|
{
|
|
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: 'remark',
|
|
component: 'Textarea',
|
|
formItemClass: 'col-span-2'
|
|
},
|
|
];
|