From 6fc60fcdccd4c99e43be482ecf3757108e833c34 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 04 十一月 2025 17:27:34 +0800
Subject: [PATCH] fix: 四流
---
src/views/StatisticalReport/hooks/rewardStatistics.ts | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/views/StatisticalReport/hooks/rewardStatistics.ts b/src/views/StatisticalReport/hooks/rewardStatistics.ts
index b1d4324..681ed8c 100644
--- a/src/views/StatisticalReport/hooks/rewardStatistics.ts
+++ b/src/views/StatisticalReport/hooks/rewardStatistics.ts
@@ -2,6 +2,8 @@
import { useTable } from '@bole-core/components';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import { OrderInputType } from '@bole-core/core';
+import { useQuery } from '@tanstack/vue-query';
+import dayjs from 'dayjs';
type UseRewardStatisticsDetailOptions = {
scene?: Ref<EnumParkRewardStatisticsDetailScene>;
@@ -54,3 +56,35 @@
reset,
};
}
+
+type UseRewardStatisticsMonthsOptions = {
+ industrialParkId?: MaybeRef<string>;
+ enabled?: MaybeRef<boolean>;
+};
+
+export function useRewardStatisticsMonths(options: UseRewardStatisticsMonthsOptions = {}) {
+ const { industrialParkId, enabled } = options;
+
+ const { data: rewardStatisticsMonths } = useQuery({
+ queryKey: ['parkBountyApplyServices/getRewardStatisticsMonths', industrialParkId],
+ queryFn: async () => {
+ let params: API.APIgetRewardStatisticsMonthsParams = {
+ industrialParkId: unref(industrialParkId),
+ };
+ let res = await parkBountyApplyServices.getRewardStatisticsMonths(params, {
+ showLoading: false,
+ });
+ return res;
+ },
+ placeholderData: [] as string[],
+ enabled: enabled,
+ });
+
+ const disabledDate = computed(() => {
+ return (time: Date) => {
+ return rewardStatisticsMonths.value.every((x) => !dayjs(x).isSame(dayjs(time), 'month'));
+ };
+ });
+
+ return { rewardStatisticsMonths, disabledDate };
+}
--
Gitblit v1.9.1