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: 'accessCode',
|
|
|
|
|
label: '门禁设备编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'accessName',
|
|
|
|
|
label: '门禁名称',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'communityCode',
|
|
|
|
|
label: '园区编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'buildingCode',
|
|
|
|
|
label: '建筑编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'accessIp',
|
|
|
|
|
label: '门禁设备ip',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'accessPort',
|
2025-06-18 16:50:58 +08:00
|
|
|
|
label: '端口',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
|
component: 'Input',
|
2025-06-24 11:11:56 +08:00
|
|
|
|
fieldName: 'accessType',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
label: '门禁设备类型',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'factoryCode',
|
2025-06-18 16:50:58 +08:00
|
|
|
|
label: '工厂编码',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Select',
|
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KZKLX 便于维护
|
|
|
|
|
options: getDictOptions('wy_kzklx'),
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
fieldName: 'controlType',
|
|
|
|
|
label: '控制卡类型:1-系统,2-E8',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'controlCode',
|
|
|
|
|
label: '控制卡类型编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'outCode',
|
|
|
|
|
label: '外部编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'orgCode',
|
|
|
|
|
label: '组织编码',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'dataState',
|
|
|
|
|
label: '数据状态:1有效,0无效',
|
|
|
|
|
},
|
2025-06-18 16:50:58 +08:00
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
|
|
|
|
fieldName: 'searchValue',
|
|
|
|
|
label: '搜索值',
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
|
|
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
|
|
|
export const columns: VxeGridProps['columns'] = [
|
|
|
|
|
{ type: 'checkbox', width: 60 },
|
2025-06-18 16:50:58 +08:00
|
|
|
|
{
|
|
|
|
|
title: '主键',
|
|
|
|
|
field: 'id',
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
{
|
|
|
|
|
title: '门禁设备编码',
|
|
|
|
|
field: 'accessCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '门禁名称',
|
|
|
|
|
field: 'accessName',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '园区编码',
|
|
|
|
|
field: 'communityCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '建筑编码',
|
|
|
|
|
field: 'buildingCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '门禁设备ip',
|
|
|
|
|
field: 'accessIp',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
|
title: '端口',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
field: 'accessPort',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '门禁设备类型',
|
2025-06-24 11:11:56 +08:00
|
|
|
|
field: 'accessType',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
|
title: '工厂编码',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
field: 'factoryCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '控制卡类型:1-系统,2-E8',
|
|
|
|
|
field: 'controlType',
|
2025-06-18 16:50:58 +08:00
|
|
|
|
slots: {
|
|
|
|
|
default: ({ row }) => {
|
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KZKLX 便于维护
|
|
|
|
|
return renderDict(row.controlType, 'wy_kzklx');
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '控制卡类型编码',
|
|
|
|
|
field: 'controlCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '外部编码',
|
|
|
|
|
field: 'outCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '组织编码',
|
|
|
|
|
field: 'orgCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '数据状态:1有效,0无效',
|
|
|
|
|
field: 'dataState',
|
|
|
|
|
},
|
2025-06-18 16:50:58 +08:00
|
|
|
|
{
|
|
|
|
|
title: '搜索值',
|
|
|
|
|
field: 'searchValue',
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
{
|
|
|
|
|
field: 'action',
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
slots: { default: 'action' },
|
|
|
|
|
title: '操作',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const modalSchema: FormSchemaGetter = () => [
|
2025-06-18 16:50:58 +08:00
|
|
|
|
{
|
|
|
|
|
label: '主键',
|
|
|
|
|
fieldName: 'id',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
dependencies: {
|
|
|
|
|
show: () => false,
|
|
|
|
|
triggerFields: [''],
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
{
|
|
|
|
|
label: '门禁设备编码',
|
|
|
|
|
fieldName: 'accessCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '门禁名称',
|
|
|
|
|
fieldName: 'accessName',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '园区编码',
|
|
|
|
|
fieldName: 'communityCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '建筑编码',
|
|
|
|
|
fieldName: 'buildingCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '门禁设备ip',
|
|
|
|
|
fieldName: 'accessIp',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
|
label: '端口',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
fieldName: 'accessPort',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '门禁设备类型',
|
2025-06-24 11:11:56 +08:00
|
|
|
|
fieldName: 'accessType',
|
2025-06-18 16:50:58 +08:00
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2025-06-18 16:50:58 +08:00
|
|
|
|
label: '工厂编码',
|
2025-06-18 11:03:42 +08:00
|
|
|
|
fieldName: 'factoryCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '控制卡类型:1-系统,2-E8',
|
|
|
|
|
fieldName: 'controlType',
|
|
|
|
|
component: 'Select',
|
|
|
|
|
componentProps: {
|
2025-06-18 16:50:58 +08:00
|
|
|
|
// 可选从DictEnum中获取 DictEnum.WY_KZKLX 便于维护
|
|
|
|
|
options: getDictOptions('wy_kzklx'),
|
2025-06-18 11:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
rules: 'selectRequired',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '控制卡类型编码',
|
|
|
|
|
fieldName: 'controlCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '外部编码',
|
|
|
|
|
fieldName: 'outCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '组织编码',
|
|
|
|
|
fieldName: 'orgCode',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '数据状态:1有效,0无效',
|
|
|
|
|
fieldName: 'dataState',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
rules: 'required',
|
|
|
|
|
},
|
2025-06-18 16:50:58 +08:00
|
|
|
|
{
|
|
|
|
|
label: '搜索值',
|
|
|
|
|
fieldName: 'searchValue',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
},
|
2025-06-18 11:03:42 +08:00
|
|
|
|
];
|