You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.7 KiB
85 lines
1.7 KiB
1 year ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
|
||
|
// 表单校验
|
||
|
export const SamplingProcessRules = reactive({
|
||
|
code: [required],
|
||
|
sampleType: [required],
|
||
|
evaluationMode: [required],
|
||
|
available: [required],
|
||
|
})
|
||
|
|
||
|
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: 'id',
|
||
|
field: 'id',
|
||
|
sort: 'custom',
|
||
|
isTable: false,
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '编码',
|
||
|
field: 'code',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
},
|
||
|
{
|
||
|
label: '描述',
|
||
|
field: 'describe',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
},
|
||
|
{
|
||
|
label: '取样类型',
|
||
|
field: 'sampleType',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.SAMPLING_TYPE,
|
||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||
|
isSearch: true,
|
||
|
form: {
|
||
|
component: 'SelectV2'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '评估模式',
|
||
|
field: 'evaluationMode',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.EVALUATION_MODE,
|
||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||
|
form: {
|
||
|
component: 'SelectV2'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '样品量',
|
||
|
field: 'sampleSize',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '采样方案编码',
|
||
|
field: 'sampleProgCode',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '是否可用',
|
||
|
field: 'available',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '创建时间',
|
||
|
field: 'createTime',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|