feat信贷客户家庭关系
This commit is contained in:
46
ruoyi-ui/src/components/EnumTag/index.vue
Normal file
46
ruoyi-ui/src/components/EnumTag/index.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<span v-if="displayLabel">{{ displayLabel }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'EnumTag',
|
||||
props: {
|
||||
// 枚举类型:relationType | certType
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 枚举值
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('ccdiEnum', ['relationTypeOptions', 'certTypeOptions']),
|
||||
|
||||
// 获取对应的选项列表
|
||||
options() {
|
||||
switch (this.type) {
|
||||
case 'relationType':
|
||||
return this.relationTypeOptions
|
||||
case 'certType':
|
||||
return this.certTypeOptions
|
||||
default:
|
||||
return []
|
||||
}
|
||||
},
|
||||
|
||||
// 查找对应的显示标签
|
||||
displayLabel() {
|
||||
if (!this.value) return ''
|
||||
const option = this.options.find(item => item.value === this.value)
|
||||
return option ? option.label : this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user