Newer
Older
xc-business-system / src / commonMethods / useDictCheck.ts
tanyue on 23 Jan 2024 287 bytes 20240123 ups测试记录
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
  }
}