orgManager/src/utils/dict.js

16 lines
506 B
JavaScript
Raw Normal View History

2025-08-26 10:54:01 +08:00
import { getLocalStorage } from '@/utils/auth'
2025-08-14 10:38:42 +08:00
/**
* 获取字典数据
*/
export function useDict(...args) {
2025-08-26 10:54:01 +08:00
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;
})()
2025-08-14 10:38:42 +08:00
}