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

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,24 +94,25 @@
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="证书类型" field="certificationType">
<a-input v-model="formData.certificationType" placeholder="请输入证书类型" />
</a-form-item>
</a-col>
<a-form-item label="证书类型" field="certificationType">
<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-col :span="12">
<a-form-item label="持证人" field="userId">
<a-select v-model="formData.userId" placeholder="请选择持证人" :loading="loadingUsers" allow-search
:filter-option="filterUserOption" @="console.log('d', formData)">
<a-option v-for="user in userList" :key="user.userId" :value="user.userId" :label="user.name">
{{ user.name }}({{ user.account }})
</a-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-col :span="12">
<a-form-item label="持证人" field="userId">
<a-select v-model="formData.userId" placeholder="请选择持证人" :loading="loadingUsers" allow-search
:filter-option="filterUserOption" @="console.log('d', formData)">
<a-option v-for="user in userList" :key="user.userId" :value="user.userId" :label="user.name">
{{ user.name }}({{ user.account }})
</a-option>
</a-select>
</a-form-item>
</a-col>
<a-row :gutter="16">
<a-col :span="12">
@ -218,7 +219,15 @@ const formRules = {
{ 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 = [
{
@ -234,7 +243,11 @@ const columns = [
{
title: '证书类型',
dataIndex: 'certificationType',
width: 150
width: 150,
render: ({ record }) => {
const type = CERTIFICATION_TYPE_OPTIONS.find(item => item.value === record.certificationType)
return type ? type.label : '-'
}
},
{
title: '持证人',