| | |
| | | insurePeopleCountRankList, |
| | | }; |
| | | } |
| | | |
| | | type UseDataBoardOverviewByParkV2 = { |
| | | industrialParkId: MaybeRef<string>; |
| | | onSuccess?: (data: API.GetDataBoardOverviewByParkV2Output) => void; |
| | | }; |
| | | |
| | | export function useGetDataBoardOverviewByParkV2(options: UseDataBoardOverviewByParkV2) { |
| | | const { industrialParkId, onSuccess } = options; |
| | | const { |
| | | data: detail, |
| | | isLoading, |
| | | refetch, |
| | | } = useQuery({ |
| | | queryKey: ['dataBoardServices/getDataBoardOverviewByParkV2', industrialParkId], |
| | | queryFn: async () => { |
| | | let params: API.APIgetDataBoardOverviewByParkV2Params = {}; |
| | | if (!!unref(industrialParkId)) { |
| | | params.industrialParkId = unref(industrialParkId); |
| | | } |
| | | return await dataBoardServices.getDataBoardOverviewByParkV2(params, { |
| | | showLoading: false, |
| | | }); |
| | | }, |
| | | placeholderData: () => ({} as API.GetDataBoardOverviewByParkV2Output), |
| | | onSuccess: (data) => { |
| | | onSuccess?.(data); |
| | | }, |
| | | }); |
| | | |
| | | return { |
| | | detail, |
| | | refetch, |
| | | }; |
| | | } |
| | | |
| | | type UseWanUnitOptions = { |
| | | wanUnit: boolean; |
| | | }; |
| | | |
| | | export function useGetDataBoardLastQuarterOutputValueCount(options: UseWanUnitOptions) { |
| | | const { wanUnit } = options; |
| | | |
| | | const { data: detail, isLoading } = useQuery({ |
| | | queryKey: ['dataBoardServices/getDataBoardLastQuarterOutputValueCount', wanUnit], |
| | | queryFn: async () => { |
| | | return await dataBoardServices.getDataBoardLastQuarterOutputValueCount( |
| | | { wanUnit: wanUnit }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.GetDataBoardLastQuarterOutputValueCountOutput), |
| | | }); |
| | | |
| | | return { |
| | | detail, |
| | | }; |
| | | } |
| | | |
| | | export function useGetDataBoardLastQuarterEnterpriseClientUserCount() { |
| | | const { data: detail, isLoading } = useQuery({ |
| | | queryKey: ['dataBoardServices/getDataBoardLastQuarterEnterpriseClientUserCount'], |
| | | queryFn: async () => { |
| | | return await dataBoardServices.getDataBoardLastQuarterEnterpriseClientUserCount( |
| | | {}, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.GetDataBoardLastQuarterEnterpriseClientUserCountOutput), |
| | | }); |
| | | |
| | | return { |
| | | detail, |
| | | }; |
| | | } |
| | | |
| | | export function useGetDataBoardOutputValueRank(options: UseGetDataBoardBountyUseAmountRankOptions) { |
| | | const { take } = options; |
| | | const { data: detail, isLoading } = useQuery({ |
| | | queryKey: ['dataBoardServices/getDataBoardOutputValueRank', take], |
| | | queryFn: async () => { |
| | | return await dataBoardServices.getDataBoardOutputValueRank( |
| | | { take: take }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.GetDataBoardOutputValueRankOutput), |
| | | }); |
| | | |
| | | const dataBoardOutputValueRankList = computed(() => |
| | | detail.value.items?.map((x) => ({ |
| | | name: x.enterpriseName, |
| | | value: x.outputValue, |
| | | })) |
| | | ); |
| | | |
| | | return { |
| | | dataBoardOutputValueRankList, |
| | | }; |
| | | } |
| | | |
| | | export function useGetDataBoardEnterpriseClientUserRank( |
| | | options: UseGetDataBoardBountyUseAmountRankOptions |
| | | ) { |
| | | const { take } = options; |
| | | const { data: detail, isLoading } = useQuery({ |
| | | queryKey: ['dataBoardServices/getDataBoardEnterpriseClientUserRank', take], |
| | | queryFn: async () => { |
| | | return await dataBoardServices.getDataBoardEnterpriseClientUserRank( |
| | | { take: take }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.GetDataBoardEnterpriseClientUserRankOutput), |
| | | }); |
| | | |
| | | const enterpriseClientUserRankList = computed(() => |
| | | detail.value.items?.map((x) => ({ |
| | | name: x.enterpriseName, |
| | | value: x.count, |
| | | })) |
| | | ); |
| | | |
| | | return { |
| | | enterpriseClientUserRankList, |
| | | }; |
| | | } |