| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | |
| | | /** 计量单位类型选项 */ |
| | | export const UNIT_TYPE_OPTIONS = [ |
| | | { label: '48千克', value: '48千克' }, |
| | | { label: '100千克', value: '100千克' }, |
| | | { label: '吨', value: '吨' }, |
| | | ]; |
| | | |
| | | /** 新增/修改的表单 */ |
| | | export function useFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | |
| | | rules: 'required', |
| | | componentProps: { |
| | | placeholder: '请输入单位名称', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'type', |
| | | label: '类型', |
| | | component: 'Select', |
| | | rules: 'required', |
| | | componentProps: { |
| | | placeholder: '请选择类型', |
| | | allowClear: true, |
| | | options: UNIT_TYPE_OPTIONS, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | field: 'type', |
| | | title: '类型', |
| | | minWidth: 100, |
| | | formatter: ({ cellValue }) => cellValue || '-', |
| | | }, |
| | | { |
| | | field: 'status', |
| | | title: '状态', |
| | | minWidth: 80, |