| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- import { BasicColumn } from '/@/components/Table';
- import { FormSchema } from '/@/components/Table';
- import { rules } from '/@/utils/helper/validator';
- import { render } from '/@/utils/common/renderUtils';
- export const columns: BasicColumn[] = [
- {
- title: '名称',
- dataIndex: 'strname',
- width: 120,
- },
- {
- title: '安装位置',
- dataIndex: 'strinstallpos',
- width: 100,
- },
- {
- title: '读取数据方式',
- dataIndex: 'strtype',
- width: 100,
- },
- {
- title: '分站IP地址',
- dataIndex: 'strip',
- width: 100,
- },
- {
- title: '链接状态',
- dataIndex: 'linkstatus',
- width: 100,
- },
- {
- title: '备注',
- width: 150,
- dataIndex: 'strremark',
- },
- ];
- export const recycleColumns: BasicColumn[] = [
- {
- title: '名称',
- dataIndex: 'strname',
- width: 100,
- },
- {
- title: '安装位置',
- dataIndex: 'strinstallpos',
- width: 100,
- },
- {
- title: '链接状态',
- dataIndex: 'linkstatus',
- width: 80,
- customRender: render.renderAvatar,
- },
- ];
- export const searchFormSchema: FormSchema[] = [
- {
- label: '监测类型',
- field: 'monitorparam',
- component: 'MTreeSelect',
- componentProps: {
- virtual: false,
- },
- colProps: { span: 6 },
- },
- {
- label: '安装位置',
- field: 'strinstallpos',
- component: 'Input',
- colProps: { span: 6 },
- },
- {
- label: '链接状态',
- field: 'linkstatus',
- component: 'JDictSelectTag',
- componentProps: {
- dictCode: 'user_status',
- placeholder: '请选择读写类型',
- stringToNumber: true,
- },
- colProps: { span: 6 },
- },
- ];
- export const formSchema: FormSchema[] = [
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
- {
- label: '名称',
- field: 'strname',
- component: 'Input',
- required: true,
- },
- {
- label: '安装位置',
- field: 'strinstallpos',
- component: 'Input',
- required: true,
- },
- {
- label: '读取数据方式',
- field: 'strtype',
- component: 'JDictSelectTag',
- required: true,
- componentProps: {
- dictCode: 'getdatatype',
- placeholder: '请选择读取数据方式',
- },
- },
- {
- label: '监测类型',
- field: 'monitorparam',
- component: 'MTreeSelect',
- componentProps: {
- virtual: false,
- },
- },
- {
- label: '分站IP或请求地址',
- field: 'strip',
- component: 'Input',
- required: true,
- },
- {
- label: '分站端口',
- field: 'nport',
- component: 'Input',
- },
- {
- label: 'PLC类型',
- field: 'plcType',
- component: 'JDictSelectTag',
- ifShow: ({ values }) => values.strtype === 'plc',
- componentProps: {
- dictCode: 'plcType',
- placeholder: '请选择PLC类型',
- },
- },
- {
- label: '分站站号',
- field: 'code',
- component: 'InputNumber',
- ifShow: ({ values }) => ['modbus', 'modbusRtu'].includes(values.strtype),
- },
- {
- label: '节点码',
- field: 'code',
- component: 'Input',
- ifShow: ({ values }) => values.strtype === 'opc_ua',
- },
- {
- label: '是否从0开始',
- field: 'isZeroStart',
- component: 'RadioGroup',
- defaultValue: 1,
- ifShow: ({ values }) => ['modbus', 'modbusRtu'].includes(values.strtype),
- componentProps: () => {
- return {
- options: [
- { label: '是', value: 1, key: '1' },
- { label: '否', value: 0, key: '2' },
- ],
- };
- },
- },
- {
- label: '分站类型',
- field: 'reqparam',
- component: 'Input',
- ifShow: ({ values }) => ['modbus', 'modbusRtu'].includes(values.strtype),
- componentProps: {
- placeholder: '请填写158/130/235',
- },
- },
- {
- label: '请求方式',
- field: 'reqtype',
- component: 'JDictSelectTag',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- componentProps: {
- dictCode: 'reqtype',
- placeholder: '请选择请求方式',
- },
- },
- {
- label: 'reqHeader请求头',
- field: 'reqHeader',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- !['plc', 'modbus', 'modbusRtu', 'opc_ua', 'txt'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '请求参数',
- field: 'reqparam',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '读取文件名',
- field: 'reqparam',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('txt'),
- },
- {
- label: '请求参数或读取文件名',
- field: 'reqparam',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- !['plc', 'modbus', 'modbusRtu', 'opc_ua', 'txt', 'http'].some((type) => values.strtype && values.strtype.startsWith(type)) &&
- !values.strtype?.startsWith('http') &&
- !values.strtype?.startsWith('txt'),
- },
- {
- label: '返回数据解析',
- field: 'dataproperty',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && (values.strtype.startsWith('http') || values.strtype.startsWith('txt')),
- },
- {
- label: 'ID字段',
- field: 'idcode',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype.startsWith('txt') ||
- !['plc', 'modbus', 'modbusRtu', 'opc_ua'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '名称code',
- field: 'namecode',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype.startsWith('txt') ||
- !['plc', 'modbus', 'modbusRtu', 'opc_ua'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '连接用户名',
- field: 'remoteUser',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype === 'opc_ua' ||
- !['plc', 'modbus', 'modbusRtu', 'txt'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '连接密码',
- field: 'remotePass',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype === 'opc_ua' ||
- !['plc', 'modbus', 'modbusRtu', 'txt'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '数据格式化',
- field: 'dataformat',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype.startsWith('txt') ||
- !['plc', 'modbus', 'modbusRtu', 'opc_ua'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '字符串分隔符',
- field: 'splitchar',
- component: 'Input',
- ifShow: ({ values }) =>
- values.strtype &&
- (values.strtype.startsWith('http') ||
- values.strtype.startsWith('txt') ||
- !['plc', 'modbus', 'modbusRtu', 'opc_ua'].some((type) => values.strtype && values.strtype.startsWith(type))),
- },
- {
- label: '控制请求地址',
- field: 'controlStrip',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '控制请求类型',
- field: 'controlReqtype',
- component: 'JDictSelectTag',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- componentProps: {
- dictCode: 'reqtype',
- placeholder: '请选择控制请求方式',
- },
- },
- {
- label: '控制请求Header',
- field: 'controlHeader',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '控制请求参数',
- field: 'controlReqparam',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '登录地址',
- field: 'loginUrl',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '登录结果解析',
- field: 'loginResult',
- component: 'Input',
- ifShow: ({ values }) => values.strtype && values.strtype.startsWith('http'),
- },
- {
- label: '是否自动同步设备',
- field: 'isAutoSyn',
- component: 'RadioGroup',
- defaultValue: 0,
- ifShow: ({ values }) => values.strtype && (values.strtype.startsWith('http') || values.strtype.startsWith('txt')),
- componentProps: () => {
- return {
- options: [
- { label: '否', value: 0, key: '0' },
- { label: '是', value: 1, key: '1' },
- ],
- };
- },
- },
- {
- label: '备注',
- field: 'strremark',
- component: 'InputTextArea',
- },
- ];
- export const historyColumns: BasicColumn[] = [
- {
- title: '名称',
- dataIndex: 'devicename',
- key: 'devicename',
- width: 120,
- align: 'center',
- },
- {
- title: '安装位置',
- dataIndex: 'stationname',
- key: 'stationname',
- width: 120,
- align: 'center',
- },
- {
- title: '开始报警时间',
- dataIndex: 'starttime',
- key: 'starttime',
- width: 120,
- align: 'center',
- },
- {
- title: '结束报警时间',
- dataIndex: 'endtime',
- key: 'endtime',
- width: 120,
- align: 'center',
- },
- {
- title: '报警状态',
- dataIndex: 'nwartype_dictText',
- key: 'nwartype_dictText',
- width: 120,
- align: 'center',
- },
- ];
|