公共枚举转换
// 公共枚举转换
export function commonEnumFormat (options: Array<optionsType>, state: string | number) {
if (options.length > 0 && typeof state !== 'undefined' && state !== null) {
const item = options.filter(ele => ele.value === state)
if (item !== null && typeof item !== 'undefined' && item.length > 0) {
return item[0].label
}
}
return ''
}