From 27652573ea8a58d5593791e27b4d326f84187093 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 12 十二月 2025 21:37:30 +0800
Subject: [PATCH] fix: bug

---
 packages/hooks/insurance.ts |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/packages/hooks/insurance.ts b/packages/hooks/insurance.ts
new file mode 100644
index 0000000..7ad3fb0
--- /dev/null
+++ b/packages/hooks/insurance.ts
@@ -0,0 +1,35 @@
+import { useQuery, useQueryClient } from '@tanstack/vue-query';
+import * as enterpriseInsuranceProductServices from '@12333/services/apiV2/enterpriseInsuranceProduct';
+import { compile, computed, MaybeRef, unref } from 'vue';
+
+type UseEnterpriseInsuranceProductSelectOptions = {
+  supplierEnterpriseId: MaybeRef<string>;
+  isConfiguredInsurance: MaybeRef<boolean>;
+};
+
+export function useEnterpriseInsuranceProductSelect(
+  options: UseEnterpriseInsuranceProductSelectOptions
+) {
+  const { supplierEnterpriseId, isConfiguredInsurance } = options;
+  const queryClient = useQueryClient();
+
+  const { data: enterpriseInsuranceProductSelect } = useQuery({
+    queryKey: [
+      'enterpriseInsuranceProductServices/getEnterpriseInsuranceProductSelect',
+      supplierEnterpriseId,
+    ],
+    queryFn: () => {
+      return enterpriseInsuranceProductServices.getEnterpriseInsuranceProductSelect(
+        { supplierEnterpriseId: unref(supplierEnterpriseId) },
+        {
+          showLoading: false,
+        }
+      );
+    },
+    placeholderData: () =>
+      [] as API.SelectOptionNullableGuidGetEnterpriseInsuranceProductSelectQueryOption[],
+    enabled: computed(() => !!unref(supplierEnterpriseId) && unref(isConfiguredInsurance)),
+  });
+
+  return { enterpriseInsuranceProductSelect };
+}

--
Gitblit v1.9.1