This commit is contained in:
RuoYi
2021-11-30 09:55:37 +08:00
parent aa35fd00da
commit a4656c6154
236 changed files with 16070 additions and 1 deletions

17
src/utils/dict.js Normal file
View File

@ -0,0 +1,17 @@
import { getDicts } from '@/api/system/dict/data'
/**
* 获取字典数据
*/
export function useDict(...args) {
const res = ref({});
return (() => {
args.forEach((d, index) => {
res.value[d] = [];
getDicts(d).then(resp => {
res.value[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass }))
})
})
return toRefs(res.value);
})()
}