From 79508b77b225b1e572fdd1ef94e88b01c92c9064 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期四, 11 十二月 2025 16:20:43 +0800
Subject: [PATCH] 决策分析 BI大屏 员工总数去掉 决策分析 BI大屏 设备待保养,待维修数据没有根据状态统计 协同办公 通知公告 新增公告时可以自行输入公告类型(可输入可选择)
---
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