import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; import { list, modalList, huifengids, beiyong, qita, cheliang, dongshi, juejin, caimei } from './workingFace.api'; export const columns: BasicColumn[] = [ { title: '系统名称', dataIndex: 'strname', width: 120, }, // { // title: '系统型号', // dataIndex: 'strinstallpos', // width: 100, // }, { title: '系统Code', dataIndex: 'nwindowtype_dictText', width: 100, }, { title: '类型', dataIndex: 'strtype', width: 80, }, { title: '模型ID', dataIndex: 'fperheight', width: 100, }, { title: '控制策略', dataIndex: 'nwindow', width: 100, }, { title: '风向', width: 150, dataIndex: 'stationname', }, ]; export const recycleColumns: BasicColumn[] = [ { title: '名称', dataIndex: 'strname', width: 100, }, { title: '是否为常闭型', dataIndex: 'bnormalclose', width: 100, }, ]; export const searchFormSchema: FormSchema[] = [ { label: '系统类型', field: 'strtype', component: 'JDictSelectTag', colProps: { span: 6 }, componentProps: { dictCode: 'syskind', placeholder: '请选择系统型号', }, }, { label: '系统名称', field: 'systemname', component: 'Input', colProps: { span: 6 }, }, ]; export const commentFormSchema = (strtype) => { return [ { label: '', field: 'id', component: 'Input', show: false, }, { label: '系统名称', field: 'systemname', component: 'Input', }, { label: '系统Code', field: 'code', component: 'Input', }, { label: '系统类型', field: 'strtype', component: 'JDictSelectTag', defaultValue: strtype, required: true, componentProps: { disabled: true, dictCode: 'syskind', placeholder: '请选择系统型号', }, }, { label: '模型ID', field: 'nmodelid', component: 'ApiSelect', componentProps: () => { return { api: modalList, resultField: 'records', labelField: 'strmodelname', valueField: 'nmodelid', }; }, }, { label: '控制策略', field: 'workmode', component: 'JDictSelectTag', componentProps: { dictCode: 'workmode', placeholder: '请选择控制策略', stringToNumber: true, }, }, { label: '监测类型', field: 'monitorflag_dictText', component: 'JDictSelectTag', componentProps: { dictCode: 'monitorflag', placeholder: '请选择状态', }, }, { label: '风向', field: 'windkind', component: 'JDictSelectTag', componentProps: { dictCode: 'winddir', placeholder: '请选择风向', stringToNumber: true, }, }, { label: '所属回风系统', field: 'huifengid', component: 'ApiSelect', componentProps: () => { return { api: huifengids, labelField: 'huifeng_name', valueField: 'id', resultField: 'obj', }; }, }, { label: '关联需风量地点', field: 'xufengliangid', component: 'ApiSelect', componentProps: ({ formModel }) => { let api; if (formModel['strtype'] == 'sys_dongshi') { api = dongshi; } else if (formModel['strtype'] == 'sys_cheliang') { api = cheliang; } else if (formModel['strtype'] == 'sys_surface_juejin') { api = juejin; } else if (formModel['strtype'] == 'sys_surface_caimei') { api = caimei; } else if (formModel['strtype'] == 'sys_surface_beiyong') { api = beiyong; } else if (formModel['strtype'] == 'sys_other') { api = qita; } if (api) return { api: api.bind(null, { id: formModel['huifengid'] }), labelField: 'work_name', valueField: 'id', resultField: 'obj', }; }, }, { label: '模型类型', field: 'strsystype', component: 'JDictSelectTag', componentProps: ({ formModel }) => { if (formModel['strtype']) { console.log('场景类型---->', formModel['strtype']); return { dictCode: `${formModel['strtype']}_modal`, placeholder: '请选择模型类型', }; } return { options: [], }; }, }, { label: '是否绑定采空区', field: 'linkEmptyFlag', component: 'RadioGroup', defaultValue: 0, componentProps: ({ formActionType }) => { return { options: [ { label: '绑定采空区', value: 1, key: '1' }, { label: '不绑定', value: 0, key: '2' }, ], onChange: (e: any) => { const { updateSchema } = formActionType; updateSchema({ field: 'linkEmpty', label: '绑定采空区ID', component: 'ApiSelect', show: e.target.value == 1 ? true : false, componentProps: () => { return { api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }), labelField: 'systemname', valueField: 'id', resultField: 'records', }; }, }); }, }; }, }, { label: '绑定采空区ID', field: 'linkEmpty', component: 'ApiSelect', show: false, componentProps: () => { return { api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }), labelField: 'systemname', valueField: 'id', resultField: 'records', }; }, }, ]; };