Newer
Older
jh-business-system / src / commonMethods / useDictCheck.ts
dutingting 28 days ago 287 bytes Initial commit: 项目初始化
import type { IDictType } from '@/commonInterface/resource-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
  }
}