Newer
Older
CorrOLFront / src / utils / composables / useDictCheck.ts
tanyue on 18 Mar 2024 281 bytes 20240318 点位详情
import type { IDictType } from '@/views/basic/common-interface'

export function findDictNameByCode(code: string, dict: IDictType[]) {
  const target = dict.filter(item => item.value === code)
  if (target.length > 0) {
    return target[0].name
  }
  else {
    return code
  }
}