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: ({ formModel, formActionType, schema }) => { return { dictCode: 'getdatatype', placeholder: '请选择分站用途', onChange: (e: any) => { const { updateSchema } = formActionType; if (e == 'plc' || e == 'modbus') { updateSchema({ field: 'plcType', show: true, }); } else { updateSchema({ field: 'plcType', show: false, }); if (e == 'http') { updateSchema({ label: '请求参数或读取文件名', field: 'reqparam', component: 'Input', required: false, show: true, }); } } }, }; }, }, { 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', show: true, componentProps: { dictCode: 'plcType', placeholder: '请选择PLC类型', }, }, { label: '分站站号', field: 'code', component: 'InputNumber', }, { label: '系统缓存点表下标', field: 'plcTable', component: 'Input', }, { label: '是否从0开始', field: 'isZeroStart', component: 'RadioGroup', defaultValue: 1, componentProps: () => { return { options: [ { label: '是', value: 1, key: '1' }, { label: '否', value: 0, key: '2' }, ], }; }, }, { label: '请求方式', field: 'reqtype', component: 'JDictSelectTag', componentProps: { dictCode: 'reqtype', placeholder: '请选择请求方式', }, }, { label: 'reqHeader请求头', field: 'reqHeader', component: 'Input', }, { label: '请求参数或读取文件名', field: 'reqparam', component: 'Input', }, { label: '数据属性字段(json中数据列表的字段-)', field: 'dataproperty', component: 'Input', }, { label: 'ID字段', field: 'idcode', component: 'Input', }, { label: '名称code', field: 'namecode', component: 'Input', }, { label: '连接用户名', field: 'remoteUser', component: 'Input', }, { label: '连接密码', field: 'remotePass', component: 'Input', }, { label: '数据格式化', field: 'dataformat', component: 'Input', }, { label: '字符串分割符', field: 'splitchar', component: 'Input', }, { label: '控制请求地址', field: 'controlStrip', component: 'Input', }, { label: '控制请求类型', field: 'controlReqtype', component: 'JDictSelectTag', componentProps: { dictCode: 'reqtype', placeholder: '请选择控制请求方式', }, }, { label: '控制请求Header', field: 'controlHeader', component: 'Input', }, { label: '控制请求参数', field: 'controlReqparam', component: 'Input', }, { label: '登录地址', field: 'loginUrl', component: 'Input', }, { label: '登录结果解析(返回的token读取字段)', field: 'loginResult', component: 'Input', }, { label: '备注', field: 'strremark', component: 'InputTextArea', }, ]; export const historyColumns: BasicColumn[] = [];