From 62287d09f9f5f1135163359fa18fd1fc4f8b2bc6 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 08 七月 2025 17:00:33 +0800
Subject: [PATCH] fix: 江佑保系统健壮性修复

---
 src/hooks/dic.ts |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/hooks/dic.ts b/src/hooks/dic.ts
index 48489a0..e206017 100644
--- a/src/hooks/dic.ts
+++ b/src/hooks/dic.ts
@@ -36,11 +36,24 @@
     return insureProduct?.id ?? '';
   }
 
+  const queryClient = useQueryClient();
+
+  function ensureUserInsureProductSetting() {
+    return queryClient.ensureQueryData<API.InsureProductSettingDto[]>({
+      queryKey: ['dictionaryServices/getUserInsureProductSetting'],
+    });
+  }
+
+  /**鏄惁鏄敓鐓庝繚璐﹀彿 */
+  const isSjbAccount = computed(() => allUserInsureProductSettingList.value.length > 0);
+
   return {
     allUserInsureProductSettingList,
     getInsureProductByIdNumber,
     getInsureProductIdByIdNumber,
     refetch,
+    ensureUserInsureProductSetting,
+    isSjbAccount,
   };
 }
 
@@ -67,8 +80,13 @@
     staleTime: Infinity,
   });
 
+  function getInsureProductSchemeByCode(code: string) {
+    return allInsureProductSchemeList.value.find((x) => x.code === code);
+  }
+
   return {
     allInsureProductSchemeList,
     refetch,
+    getInsureProductSchemeByCode,
   };
 }

--
Gitblit v1.9.1