From 50030f826efe2e1dbf3b3fbcb50cff6ff94c1559 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期日, 19 十月 2025 15:57:34 +0800
Subject: [PATCH] fix: 验收管理
---
packages/hooks/user.ts | 43 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/packages/hooks/user.ts b/packages/hooks/user.ts
index 476e815..1c703a5 100644
--- a/packages/hooks/user.ts
+++ b/packages/hooks/user.ts
@@ -1,24 +1,28 @@
import { MaybeRef, computed, unref } from 'vue';
import * as userResumeServices from '@12333/services/apiV2/userResume';
+import * as enterpriseEmployeeServices from '@12333//services/apiV2/enterpriseEmployee';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
type UseUserResumeOptions = {
- userId: MaybeRef<string>;
+ userId?: MaybeRef<string>;
+ enterpriseEmployeeId?: MaybeRef<string>;
};
-export function useUserResume({ userId }: UseUserResumeOptions) {
+export function useUserResume(options: UseUserResumeOptions = {}) {
+ const { userId, enterpriseEmployeeId } = options;
+
const { data, refetch, isLoading, isError } = useQuery({
- queryKey: ['userResumeServices/getUserResume', userId],
+ queryKey: ['userResumeServices/getUserResume', userId, enterpriseEmployeeId],
queryFn: async () => {
return await userResumeServices.getUserResume(
- { userId: unref(userId) },
+ { userId: unref(userId), enterpriseEmployeeId: unref(enterpriseEmployeeId) },
{
showLoading: false,
}
);
},
placeholderData: () => ({} as API.GetUserResumeQueryResult),
- enabled: computed(() => !!unref(userId)),
+ enabled: computed(() => !!unref(userId) || !!unref(enterpriseEmployeeId)),
});
return {
@@ -49,3 +53,32 @@
updateUserResume,
};
}
+
+type UseGetEnterpriseEmployeeOptions = {
+ id?: MaybeRef<string>;
+};
+
+export function useGetEnterpriseEmployee(options: UseGetEnterpriseEmployeeOptions = {}) {
+ const { id } = options;
+
+ const { data, refetch, isLoading, isError } = useQuery({
+ queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployee', id],
+ queryFn: async () => {
+ return await enterpriseEmployeeServices.getEnterpriseEmployee(
+ { id: unref(id) },
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as API.GetEnterpriseEmployeeQueryResult),
+ enabled: computed(() => !!unref(id)),
+ });
+
+ return {
+ enterpriseEmployeeInfo: data,
+ refetch,
+ isLoading,
+ isError,
+ };
+}
--
Gitblit v1.9.1