| | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | import type { DescItem } from '#/components/description'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'faultCode', |
| | | // label: '知识编号' |
| | | // }, |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'equName', |
| | | // label: '设备名称' |
| | | // }, |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'assetNo', |
| | | // label: '资产编号' |
| | | // }, |
| | | // { |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: getDictOptions(DictEnum.EIMS_EQU_PART) |
| | | // }, |
| | | // fieldName: 'equPart', |
| | | // label: '设备部位' |
| | | // }, |
| | | // { |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: getDictOptions(DictEnum.REPAIR_FAULT_TYPE) |
| | | // }, |
| | | // fieldName: 'faultType', |
| | | // label: '故障类别' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'faultCode', |
| | | label: '知识编号' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设备名称' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: '资产编号' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | fieldName: 'params.searchValue', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_EQU_PART) |
| | | placeholder: '请输入设备名称或资产编号' |
| | | }, |
| | | fieldName: 'equPart', |
| | | label: '设备部位' |
| | | label: '关键字' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.REPAIR_FAULT_TYPE) |
| | | }, |
| | | fieldName: 'faultType', |
| | | label: '故障类别' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_FAULT_REASON) |
| | | }, |
| | | fieldName: 'faultReason', |
| | | label: '故障原因' |
| | | }, |
| | | // { |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: getDictOptions(DictEnum.EIMS_FAULT_REASON) |
| | | // }, |
| | | // fieldName: 'faultReason', |
| | | // label: '故障原因' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'reqDesc', |
| | |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '知识编码', |
| | | field: 'faultCode', |
| | | minWidth: 200 |
| | | }, |
| | | |
| | | { |
| | | title: '设备名称', |
| | | field: 'equName', |
| | | minWidth: 140, |
| | | fixed: 'left', |
| | | slots: { default: 'equName' } |
| | | fixed: 'left' |
| | | }, |
| | | |
| | | { |
| | | title: '资产编号', |
| | | field: 'assetNo', |
| | | sortable: true, |
| | | minWidth: 140, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '知识编码', |
| | | field: 'faultCode', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '设备类型', |
| | |
| | | }, |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: '故障原因', |
| | | field: 'faultReason', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.faultReason === null || row.faultReason === '') { |
| | | return ''; |
| | | } |
| | | return renderDict(row.faultReason, DictEnum.EIMS_FAULT_REASON); |
| | | } |
| | | }, |
| | | minWidth: 120 |
| | | }, |
| | | // { |
| | | // title: '故障原因', |
| | | // field: 'faultReason', |
| | | // sortable: true, |
| | | // slots: { |
| | | // default: ({ row }) => { |
| | | // if (row.faultReason === null || row.faultReason === '') { |
| | | // return ''; |
| | | // } |
| | | // return renderDict(row.faultReason, DictEnum.EIMS_FAULT_REASON); |
| | | // } |
| | | // }, |
| | | // minWidth: 120 |
| | | // }, |
| | | { |
| | | title: '报修描述', |
| | | field: 'reqDesc', |
| | |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: '操作', |
| | | width: 200 |
| | | width: 80 |
| | | } |
| | | ]; |
| | | |
| | |
| | | label: '处理措施' |
| | | } |
| | | ]; |
| | | |
| | | |
| | | export const descSchema: DescItem[] = [ |
| | | { |
| | | field: 'equName', |
| | | label: '设备名称' |
| | | }, |
| | | { |
| | | field: 'assetNo', |
| | | label: '资产编号' |
| | | }, |
| | | { |
| | | field: 'resCode', |
| | | label: '维修工单' |
| | | }, |
| | | { |
| | | field: 'faultCode', |
| | | label: '知识编码' |
| | | }, |
| | | { |
| | | field: 'reqDesc', |
| | | label: '报修描述' |
| | | }, |
| | | { |
| | | field: 'resHandle', |
| | | label: '处理措施' |
| | | } |
| | | ]; |