| | |
| | | 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>; |
| | |
| | | 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 }; |
| | | } |