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.

111 lines
2.1 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DictTypeApi from '@/api/system/dict/dict.type'
const dictTypeList = await DictTypeApi.getSimpleDictTypeList()
const dictTypeListData = dictTypeList.map(item => {
return {
label: item.name,
value: item.type
}
})
// 表单校验
export const SelectedProjectRules = reactive({
code: [required],
dictionaryCode: [required],
dictionaryValue: [required],
available: [required],
concurrencyStamp: [required]
})
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
isTableForm: false,
isSearch: true
},
{
label: '字典',
field: 'dictionaryCode',
sort: 'custom',
isSearch: true,
tableForm: {
type: 'Select',
initOptions: dictTypeListData,
},
form: {
component: 'Select',
api: dictTypeListData,
componentProps: {
options: dictTypeListData,
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '字典项值',
field: 'dictionaryValue',
sort: 'custom',
isSearch: true,
tableForm: {
type: 'Select',
},
form: {
component: 'Select',
componentProps: {
options: dictTypeListData,
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '评估代码',
field: 'estimateCode',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DICTIONARY_CLASS,
dictClass: 'string',
tableForm: {
type: 'Select',
},
form: {
component: 'Select',
}
},
{
label: '缺陷级别',
field: 'defectLevel',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DEFECT_LEVEL,
dictClass: 'string',
tableForm: {
type: 'Select',
},
form: {
component: 'Select',
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))