From 1812a9a3d63570cd04dc57df99f1c7b37a41f678 Mon Sep 17 00:00:00 2001
From: 王恒 <318726284@qq.com>
Date: 星期五, 08 八月 2025 17:41:46 +0800
Subject: [PATCH] '调整计划管理新增页面功能'
---
src/utils/dict.ts | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 8673968..4c68db7 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -21,7 +21,24 @@
return toRefs(res.value);
})();
}
-
+export function useDictPer(...args: string[]) {
+ const res = ref<Dict.resDictType>({});
+ return (() => {
+ args.forEach((dictName: string, index: number) => {
+ res.value[dictName] = [] as Array<Dict.dictType>;
+ const dicts: Array<Dict.dictType> = useDictStore().getDict(dictName);
+ if (dicts) {
+ res.value[dictName] = dicts;
+ } else {
+ getDicts(dictName).then((resp) => {
+ res.value[dictName] = resp.data.map((p: any) => ({ label: p.dictLabel, value: p.dictCode, elTagType: p.listClass, elTagClass: p.cssClass,key: p.dictValue }));
+ useDictStore().setDict(dictName, res.value[dictName]);
+ });
+ }
+ });
+ return toRefs(res.value);
+ })();
+}
// export default {
// install(app: App<Element>) {
// app.config.globalProperties.$useDict = useDict;
--
Gitblit v1.9.1