| | |
| | | import { useQuery, useQueryClient } from '@tanstack/vue-query'; |
| | | import * as advertisementServices from '@12333/services/apiV2/advertisement'; |
| | | import { EnumAdvertisementPage, CategoryCode } from '@12333/constants'; |
| | | import { EnumAdvertisementPage, CategoryCode, PositionCodeEnum } from '@12333/constants'; |
| | | import { useDictionaryDataSelect } from '@12333/hooks'; |
| | | import _ from 'lodash'; |
| | | |
| | | export function useShowAdvertisements() { |
| | | const { data: advertisements, refetch } = useQuery({ |
| | | queryKey: ['enterpriseWalletServices/getEnterpriseWalletAccessSelect'], |
| | | queryKey: ['advertisementServices/getShowAdvertisements'], |
| | | queryFn: () => { |
| | | return advertisementServices.getShowAdvertisements( |
| | | { |
| | |
| | | export function usePositionGrid() { |
| | | const { dictionaryDataList: positionList } = useDictionaryDataSelect({ |
| | | categoryCode: CategoryCode.Position, |
| | | field1: PositionCodeEnum.Housekeeping, |
| | | }); |
| | | |
| | | const positionListChunk = computed(() => _.chunk(positionList.value, 8)); |
| | | const positionListChunk = computed(() => _.chunk(positionList.value, 10)); |
| | | |
| | | const positionGrid = computed(() => positionList.value.slice(0, 8)); |
| | | const positionGrid = computed(() => positionList.value.slice(0, 10)); |
| | | |
| | | return { |
| | | positionListChunk, |
| | | positionGrid, |
| | | positionList, |
| | | }; |
| | | } |