admin-vben5/apps/web-antd/src/views/sis/deviceManage/data.ts

134 lines
2.6 KiB
TypeScript
Raw Normal View History

2025-06-29 02:59:14 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'deviceName',
label: '设备名称',
},
{
component: 'Input',
fieldName: 'deviceIp',
label: '设备ip',
},
2025-07-19 09:09:14 +08:00
{
component: 'Input',
fieldName: 'deviceType',
label: '设备类型',
},
2025-06-29 02:59:14 +08:00
{
fieldName: 'deviceStatus',
label: '在线状态',
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.sis_device_status),
},
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '设备名称',
field: 'deviceName',
},
2025-07-19 09:09:14 +08:00
{
title: '厂商编号',
field: 'factoryNo',
},
{
title: '设备类型',
field: 'device_type',
},
2025-06-29 02:59:14 +08:00
{
title: '设备ip',
field: 'deviceIp',
},
{
title: '设备端口',
field: 'devicePort',
},
{
2025-07-19 09:09:14 +08:00
title: '设备mac',
2025-06-29 02:59:14 +08:00
field: 'deviceMac',
},
{
title: '在线状态',
field: 'deviceStatus',
},
{
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: 'deviceName',
component: 'Input',
rules: 'required',
},
2025-07-19 09:09:14 +08:00
{
label: '设备厂商',
fieldName: 'facrotyNo',
component: 'Input',
rules: 'required',
},
{
label: '设备类型',
fieldName: 'deviceType',
component: 'Input',
rules: 'required',
},
2025-06-29 02:59:14 +08:00
{
label: '设备ip',
fieldName: 'deviceIp',
component: 'Input',
rules: 'required',
},
{
label: '设备端口',
fieldName: 'devicePort',
component: 'Input',
rules: 'required',
},
{
label: '设备账号',
fieldName: 'deviceAccount',
component: 'Input',
rules: 'required',
},
{
label: '设备密码',
fieldName: 'devicePwd',
component: 'Input',
rules: 'required',
},
2025-07-19 09:09:14 +08:00
2025-06-29 02:59:14 +08:00
{
label: '设备Mac',
fieldName: 'deviceMac',
component: 'Input',
},
];