证书类型改为与后端枚举类型匹配的下拉框选择

This commit is contained in:
何德超 2025-07-24 22:02:13 +08:00
parent 7f24af3272
commit 70fca26e10
1 changed files with 32 additions and 19 deletions

View File

@ -94,12 +94,14 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="证书类型" field="certificationType"> <a-form-item label="证书类型" field="certificationType">
<a-input v-model="formData.certificationType" placeholder="请输入证书类型" /> <a-select v-model="formData.certificationType" placeholder="请选择证书类型">
<a-option v-for="item in CERTIFICATION_TYPE_OPTIONS" :key="item.value" :value="item.value"
:label="item.label">
{{ item.label }}
</a-option>
</a-select>
</a-form-item> </a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="持证人" field="userId"> <a-form-item label="持证人" field="userId">
@ -111,7 +113,6 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
@ -218,7 +219,15 @@ const formRules = {
{ required: true, message: '请选择有效期结束日期' } { required: true, message: '请选择有效期结束日期' }
] ]
} }
const CERTIFICATION_TYPE_OPTIONS = [
{ label: '高处作业', value: 'height-operation' },
{ label: '低压电工', value: 'low-voltage-operation' },
{ label: '高压电工', value: 'high-voltage-operation' },
{ label: '海上交通安全', value: 'maritime-traffic-safety' },
{ label: '驾驶证', value: 'driving-license' },
{ label: '防雷检测', value: 'lightning-protection-detection' },
{ label: '无人机驾驶', value: 'drone-driving' }
]
// //
const columns = [ const columns = [
{ {
@ -234,7 +243,11 @@ const columns = [
{ {
title: '证书类型', title: '证书类型',
dataIndex: 'certificationType', dataIndex: 'certificationType',
width: 150 width: 150,
render: ({ record }) => {
const type = CERTIFICATION_TYPE_OPTIONS.find(item => item.value === record.certificationType)
return type ? type.label : '-'
}
}, },
{ {
title: '持证人', title: '持证人',