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.

90 lines
1.9 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
1 year ago
import {getSamplingScheme} from "@/api/qms/samplingProcess";
1 year ago
// 表单校验
export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
description: [required],
1 year ago
})
1 year ago
const samplingSchemeList = await getSamplingScheme()
1 year ago
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
1 year ago
isForm: false,
table: {
fixed: 'left'
}
1 year ago
},
{
label: '描述',
field: 'description',
1 year ago
sort: 'custom',
isSearch: true,
},
{
label: '取样类型',
field: 'sampleType',
sort: 'custom',
dictType: DICT_TYPE.SAMPLING_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
1 year ago
component: 'Select'
1 year ago
},
},
{
label: '评估模式',
field: 'evaluationMode',
sort: 'custom',
dictType: DICT_TYPE.EVALUATION_MODE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
1 year ago
component: 'Select'
1 year ago
},
},
{
label: '样品量',
field: 'sampleSize',
sort: 'custom',
},
{
label: '采样方案编码',
field: 'sampleProgCode',
sort: 'custom',
1 year ago
form: {
1 year ago
component: 'Select',
componentProps: {
options: samplingSchemeList,
optionsAlias: {
labelField: 'description',
valueField: 'code'
},
}
1 year ago
},
1 year ago
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
1 year ago
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
1 year ago
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))