update 数据字典相关逻辑“

This commit is contained in:
2022-08-10 10:47:12 +08:00
parent 559cffc5f0
commit ffd095b6b8
6 changed files with 80 additions and 30 deletions

View File

@@ -0,0 +1,24 @@
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 }))
})
}
}
}