From d2124efc2b19d309550fc7ff95a16858c54faca0 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期二, 08 七月 2025 17:48:33 +0800 Subject: [PATCH] yys 1.出库管理-分页查询 2.出库管理-导出 3.出库管理-领用 4.出库台账-分页查询 5.出库台账-导出 6.出库台账-删除 7.库存管理-分页查询 8.库存管理-导出 9.库存管理-删除 --- src/utils/dict.js | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/utils/dict.js b/src/utils/dict.js index 0f9144a..a6db068 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -1,17 +1,24 @@ +import useDictStore from '@/store/modules/dict' import { getDicts } from '@/api/system/dict/data' /** * 鑾峰彇瀛楀吀鏁版嵁 */ export function useDict(...args) { - const res = ref({}); + 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, elTagClass: p.cssClass })) - }) + args.forEach((dictType, index) => { + res.value[dictType] = [] + const dicts = useDictStore().getDict(dictType) + if (dicts) { + res.value[dictType] = dicts + } else { + getDicts(dictType).then(resp => { + res.value[dictType] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass })) + useDictStore().setDict(dictType, res.value[dictType]) + }) + } }) - return toRefs(res.value); + return toRefs(res.value) })() } \ No newline at end of file -- Gitblit v1.9.3