const DICT_TYPE = {
  // KINDERGARTEN_TYPE: 'kindergarten_scale_type',
  // IS_GARDEN: 'isGarden',
  // QUERY_STATUS: 'query_status',
  // YSE_OR_NO: 'yesOrNo',

  TOY_YES_NO: 'toy_yes_no',
  TOY_SYS_STATUS: 'toy_sys_status',
  TOY_RELEASE_CLASS: 'toyReleaseClass',
  TOY_IMPROVED_STATUS: 'toy_improved_status',
  // TOY_IMPROVED_TYPE: 'toy_improved_type',
  TOY_RELEASE_GRADE: 'toy_release_grade',
  TOY_GAMEPLAY_TYPE: 'toy_gameplay_type', // 玩法类别
  TOY_GAMEPLAY_LEVEL: 'toy_gameplay_level', // 玩法级别
  TOY_PUT_AREA: 'toy_put_area',

  // system
  SYSTEM_TENANT_STATUS: 'sys_tenant_status', // 租户状态
  SYS_USER_SEX: 'sys_user_sex', // 性别
  SYS_SEX: 'sys_sex', // 性别(无未知)
  SYS_NORMAL_DISABLE: 'sys_normal_disable', // 启用禁用
  sys_tenant_type: 'sys_tenant_type',

  KINDERGARTEN_LOCATION_TYPE: 'kindergarten_location_type' // 幼儿园位置类型
}

const DEFINE = {
  [DICT_TYPE.TOY_IMPROVED_STATUS]: { IMPROVING: '1', IMPROVED: '2', AUDITING: '3', PASS: '4', REJECT: '5' },
  FILE: {
    VIDEO: '.avi,.wmv,.mpeg,.mp4,.m4v,.mov,.asf,.flv,.f4v,.rmvb,.rm,.3gp,.vob',
    WORD: '.doc,.docx,.txt,.wps',
    EXCEL: '.xls,.xlsx',
    PPT: '.ppt,.pptx,',
    PDF: '.pdf',
    PNG: '.jpg,.jpeg,.png,.gif',
    AUDIO: '.mp3,.wav,.wma,.mp2,.flac,.midi,.ra,.ape,.aac,.cda,.mov',
    TAGS: '.7z,.zip,.rar,.apz,.ar,.bz,.car,.dar,.cpgz,.f,.ha,.hbc,.hbc2,.hbe,.hpk,.hyp'
  },
  USER_TYPE: { administrator: '00', other: '10' }, // 用户类型 00 表示各管理员账号不允许租户修改删除 其他账号为10
  // BUS
  ON_PLATFORM_TOY_REPEAT: 'ON_PLATFORM_TOY_REPEAT', // 玩具查重
  ON_PROCESS_MSG: 'ON_PROCESS_MSG', // 流程管理实时消息推送

  // CACHE
  CACHE_BRAND_LIST: 'CACHE_BRAND_LIST'
}

function getDictLabel(options, v) {
  const find = options.find(d => d.value === v || String(d.value) === String(v))
  if (find) {
    v = find.label
  }
  return v
}
function getkinderLabel(options, v) {
  const find = options.find(d => d.id === v || String(d.id) === String(v))
  if (find) {
    v = find.kindergartenName
  }
  return v
}

export {
  DEFINE,
  DICT_TYPE,
  getDictLabel,
  getkinderLabel
}
