| | |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'title', |
| | | // label: '标题' |
| | | // }, |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'assetNo', |
| | | // label: '资产编号' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'title', |
| | | label: '标题' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: '资产编号' |
| | | fieldName: 'params.searchValue', |
| | | componentProps: { |
| | | placeholder: '请输入设备名称或资产编号' |
| | | }, |
| | | label: '关键字' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'planTime', |
| | | label: '保养日期' |
| | | label: '点检日期' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '保养年月', |
| | | field: 'planTime', |
| | | minWidth: 120 |
| | | title: '保养时间', |
| | | field: 'planTimeStr', |
| | | minWidth: 200, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | // 判断是否需要显示时间 |
| | | if (!row.type) return ''; |
| | | |
| | | // 获取原始时间字符串 |
| | | const fullDate = row.planTimeStr; |
| | | |
| | | // 根据条件决定显示格式 |
| | | // 示例条件:如果 status 是某个特定值(例如 'monthly'),则显示 YYYY-MM |
| | | if (row.type === 'Month') { |
| | | return fullDate.slice(0, 7); // 截取前 7 个字符,得到 YYYY-MM |
| | | } |
| | | // 默认显示完整日期 YYYY-MM-DD |
| | | return fullDate; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '状态', |
| | |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (!row.status) return ''; |
| | | return renderDict(row.status, DictEnum.EIMS_INSPECT_STATUS); |
| | | } |
| | | } |