| | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import dayjs from 'dayjs'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { REPAIR_REQ_TYPE } from '#/constants/dict'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | const curDateTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | |
| | | // 在drawer里更新 这里不需要默认的componentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'reqDept', |
| | | label: '报修部门', |
| | | label: '报修部门' |
| | | // rules: 'selectRequired', |
| | | }, |
| | | { |
| | |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '设备名称', |
| | | field: 'equName', |
| | | title: '设备(工具)名称', |
| | | sortable: true, |
| | | minWidth: 120 |
| | | minWidth: 150, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.reqType === REPAIR_REQ_TYPE.EQU) { |
| | | return row.equName; |
| | | } else if (row.reqType === REPAIR_REQ_TYPE.FIXTURE) { |
| | | return row.fixtureName; |
| | | } else { |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '故障类别', |
| | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'reqType', |
| | | label: '报修类型', |
| | |
| | | options: getDictOptions(DictEnum.REPAIR_REQ_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | defaultValue: '0', |
| | | label: '处理状态' |
| | | }, |
| | | { |
| | |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | defaultValue: curDateTime, |
| | | fieldName: 'reqTime', |
| | | label: '报修时间' |
| | | }, |