
export default {
  data() {
    return {
      dictList: {}
    }
  },
  methods: {
    initDictList(dictTypeIdList) {
      const allDictList = JSON.parse(localStorage.getItem('dictList'))
      if (!Object.keys(allDictList).length) {
        return this.$message({
          // TODO: i18n
          message: '未能获取数据字典',
          type: 'error',
          duration: 2000
        })
      }
      dictTypeIdList.forEach(id => {
        this.dictList[id] = allDictList[id].map(item => ({ label: item.dictLabel, value: item.dictValue }))
      })
    }
  }
}