证书类型改为与后端枚举类型匹配的下拉框选择
This commit is contained in:
parent
7f24af3272
commit
70fca26e10
|
@ -94,24 +94,25 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-row :gutter="16">
|
<a-form-item label="证书类型" field="certificationType">
|
||||||
<a-col :span="12">
|
<a-select v-model="formData.certificationType" placeholder="请选择证书类型">
|
||||||
<a-form-item label="证书类型" field="certificationType">
|
<a-option v-for="item in CERTIFICATION_TYPE_OPTIONS" :key="item.value" :value="item.value"
|
||||||
<a-input v-model="formData.certificationType" placeholder="请输入证书类型" />
|
:label="item.label">
|
||||||
</a-form-item>
|
{{ item.label }}
|
||||||
</a-col>
|
</a-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="持证人" field="userId">
|
<a-form-item label="持证人" field="userId">
|
||||||
<a-select v-model="formData.userId" placeholder="请选择持证人" :loading="loadingUsers" allow-search
|
<a-select v-model="formData.userId" placeholder="请选择持证人" :loading="loadingUsers" allow-search
|
||||||
:filter-option="filterUserOption" @="console.log('d', formData)">
|
:filter-option="filterUserOption" @="console.log('d', formData)">
|
||||||
<a-option v-for="user in userList" :key="user.userId" :value="user.userId" :label="user.name">
|
<a-option v-for="user in userList" :key="user.userId" :value="user.userId" :label="user.name">
|
||||||
{{ user.name }}({{ user.account }})
|
{{ user.name }}({{ user.account }})
|
||||||
</a-option>
|
</a-option>
|
||||||
</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: '持证人',
|
||||||
|
|
Loading…
Reference in New Issue