RuoYi
2022-02-21 0587b81abd3bdb77e7cb266a4e33f8b04ce40f93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
  })()
}