/**
 * @Description: 字典转换
 * @author GuoXuHui
 * @date 2021-05-21
 * @time 13:44
 */
import { BusinessDictionary } from "@/constants/enum/businessDictionary";
/**
 * @Description: 数据字典转换
 * @author LiuBo
 * @date 2019/8/15
 * @time 17:09
 */
function transformDic(key: any, dicName: string): any {
  if (!dicName) {
    return "请输入字典名";
  }
  const dicArr = (BusinessDictionary as any)[dicName] || [];
  for (const dataValue of dicArr) {
    if (dataValue.code === key) {
      return dataValue.name;
    }
  }
}
const dictionaryConversion = (value: string, arg1: string) => {
  return transformDic(value, arg1);
};

export default dictionaryConversion;
