From 1541647c5dda4aa04ea6b00a691e41d39a76e711 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 07 八月 2025 09:45:07 +0800
Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/flexJobAdmin
---
src/hooks/dic.ts | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/hooks/dic.ts b/src/hooks/dic.ts
index 8935320..8543fa8 100644
--- a/src/hooks/dic.ts
+++ b/src/hooks/dic.ts
@@ -25,6 +25,12 @@
});
}
+ function updateDictionaryCategorySelect() {
+ queryClient.invalidateQueries({
+ queryKey: ['dictionaryServices/getDictionaryCategorySelect'],
+ });
+ }
+
function getDictionaryCategoryById(id: string) {
return dictionaryCategoryList.value.find((x) => x.value === id);
}
@@ -43,12 +49,13 @@
getDictionaryCategoryById,
getDictionaryCategoryNameByCode,
getDictionaryCategoryByCode,
+ updateDictionaryCategorySelect,
};
}
type UseDictionaryDataSelectOptions = {
categoryId?: MaybeRef<string>;
- categoryCode?: MaybeRef<string>;
+ categoryCode?: MaybeRef<CategoryCode>;
};
export function useDictionaryDataSelect({
@@ -56,7 +63,7 @@
categoryCode,
}: UseDictionaryDataSelectOptions) {
const { data: dictionaryDataList, refetch } = useQuery({
- queryKey: ['dictionaryServices/getDictionaryDataSelect'],
+ queryKey: ['dictionaryServices/getDictionaryDataSelect', categoryId, categoryCode],
queryFn: async () => {
let res = await dictionaryServices.getDictionaryDataSelect(
{
@@ -72,8 +79,6 @@
},
placeholderData: () =>
[] as API.SelectQueryResultOptionGuidGetDictionaryDataSelectQueryResultOption[],
-
- enabled: !!unref(categoryId) || !!unref(categoryCode),
});
function getDictionaryDataNameById(id: string) {
@@ -98,6 +103,12 @@
});
}
+ function updateDictionaryDataSelect() {
+ queryClient.invalidateQueries({
+ queryKey: ['dictionaryServices/getDictionaryDataSelect'],
+ });
+ }
+
return {
dictionaryDataList,
ensureQueryData,
@@ -105,5 +116,6 @@
getDictionaryDataNameById,
getDictionaryDataNameByCode,
getDictionaryDataByCode,
+ updateDictionaryDataSelect,
};
}
--
Gitblit v1.9.1