2025-06-19 14:26:08 +08:00
|
|
|
import type { FormSchemaGetter } from '#/adapter/form';
|
|
|
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
2025-06-23 09:39:53 +08:00
|
|
|
import {getDictOptions} from "#/utils/dict";
|
2025-06-19 14:26:08 +08:00
|
|
|
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
|
|
{
|
|
|
|
component: 'Input',
|
|
|
|
fieldName: 'unitId',
|
2025-06-23 09:39:53 +08:00
|
|
|
label: '所属单位',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
component: 'Input',
|
2025-06-23 09:39:53 +08:00
|
|
|
fieldName: 'userName',
|
|
|
|
label: '员工名称',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
component: 'Select',
|
2025-06-19 14:26:08 +08:00
|
|
|
componentProps: {
|
2025-06-23 09:39:53 +08:00
|
|
|
options: getDictOptions('wy_state'),
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
fieldName: 'state',
|
|
|
|
label: '状态',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const columns: VxeGridProps['columns'] = [
|
|
|
|
{ type: 'checkbox', width: 60 },
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
title: '序号',
|
2025-06-19 14:26:08 +08:00
|
|
|
field: 'id',
|
2025-06-23 09:39:53 +08:00
|
|
|
slots: {
|
|
|
|
default: ({ rowIndex }) => {
|
|
|
|
return (rowIndex + 1).toString();
|
|
|
|
},
|
|
|
|
},
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
title: '员工编号',
|
2025-06-19 14:26:08 +08:00
|
|
|
field: 'userId',
|
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
title: '员工名称',
|
2025-06-19 14:26:08 +08:00
|
|
|
field: 'userName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '联系电话',
|
|
|
|
field: 'phone',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '性别',
|
|
|
|
field: 'gender',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'img',
|
2025-06-23 09:39:53 +08:00
|
|
|
title: '人脸图片',
|
|
|
|
slots: { default: 'img' },
|
|
|
|
minWidth: 80,
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
title: '所属单位',
|
2025-06-19 14:26:08 +08:00
|
|
|
field: 'unitName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '入驻位置',
|
|
|
|
field: 'locathon',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '入驻时间',
|
|
|
|
field: 'time',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '车牌号码',
|
|
|
|
field: 'carNumber',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '状态',
|
|
|
|
field: 'state',
|
2025-06-25 11:37:28 +08:00
|
|
|
// slots: { default: 'state' },
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
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: [''],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
label: '入住员工',
|
2025-06-19 14:26:08 +08:00
|
|
|
fieldName: 'userId',
|
2025-06-23 09:39:53 +08:00
|
|
|
component: "Select",
|
|
|
|
rules: 'selectRequired',
|
|
|
|
formItemClass: 'col-span-2'
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
label: '所属单位',
|
|
|
|
fieldName: 'unitId',
|
|
|
|
component: 'Select',
|
|
|
|
formItemClass: 'col-span-2',
|
|
|
|
rules:'selectRequired',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
2025-06-23 09:39:53 +08:00
|
|
|
label: '入驻位置',
|
|
|
|
fieldName: 'locathon',
|
2025-06-19 14:26:08 +08:00
|
|
|
component: 'Input',
|
2025-06-23 09:39:53 +08:00
|
|
|
rules:'required',
|
|
|
|
formItemClass: 'col-span-2',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '人脸图片',
|
|
|
|
fieldName: 'img',
|
2025-06-23 09:39:53 +08:00
|
|
|
component: 'ImageUpload',
|
|
|
|
componentProps: {
|
|
|
|
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
|
|
|
|
maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
|
|
|
},
|
|
|
|
formItemClass: 'col-span-2',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
2025-06-23 09:39:53 +08:00
|
|
|
|
2025-06-19 14:26:08 +08:00
|
|
|
{
|
|
|
|
label: '入驻时间',
|
|
|
|
fieldName: 'time',
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
showTime: true,
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '车牌号码',
|
|
|
|
fieldName: 'carNumber',
|
|
|
|
component: 'Input',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '备注',
|
|
|
|
fieldName: 'remark',
|
|
|
|
component: 'Textarea',
|
2025-06-23 09:39:53 +08:00
|
|
|
formItemClass: 'col-span-2',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
//门禁记录
|
|
|
|
export const accessControlColumns: VxeGridProps['columns'] = [
|
|
|
|
{
|
|
|
|
title: '序号',
|
|
|
|
field: 'id',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '通过时间',
|
|
|
|
field: 'userId',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '进出类型',
|
|
|
|
field: 'userName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '位置',
|
|
|
|
field: 'phone',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '设备名称',
|
|
|
|
field: 'gender',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '门禁类型',
|
|
|
|
field: 'img',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '识别类型',
|
|
|
|
field: 'unitName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '状态',
|
|
|
|
field: 'locathon',
|
|
|
|
},
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
//车辆记录
|
|
|
|
export const carColumns: VxeGridProps['columns'] = [
|
|
|
|
{
|
|
|
|
title: '序号',
|
|
|
|
field: 'id',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '通过时间',
|
|
|
|
field: 'userId',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '进出类型',
|
|
|
|
field: 'userName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '位置',
|
|
|
|
field: 'phone',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '设备名称',
|
|
|
|
field: 'gender',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '进出方式',
|
|
|
|
field: 'img',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '停车类型',
|
|
|
|
field: 'unitName',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '费用(元)',
|
|
|
|
field: 'locathon',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '状态',
|
|
|
|
field: 'state',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '备注',
|
|
|
|
field: 'remark',
|
2025-06-19 14:26:08 +08:00
|
|
|
},
|
|
|
|
];
|