orgManager/src/utils/dict.js

16 lines
506 B
JavaScript

import { getLocalStorage } from '@/utils/auth'
/**
* 获取字典数据
*/
export function useDict(...args) {
const dictList = getLocalStorage('dict');
const needDict = ref({});
return (() => {
args.forEach((dictType, index) => {
needDict.value[dictType] = dictList.filter(item => item.dictType === dictType).map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass, remark: p.remark }));
})
return needDict.value;
})()
}