wupengfei
2025-04-02 b5a0b7dfdb610a2c67f28e6ef9fa714b44ed23ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import * as insuranceClaimServices from '@/services/api/InsuranceClaim';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
 
export function useInsuranceClaimChannelList() {
  const { data: insuranceClaimChannelList } = useQuery({
    queryKey: ['insuranceClaimServices/getInsuranceClaimChannelList'],
    queryFn: async () => {
      let res = await insuranceClaimServices.getInsuranceClaimChannelList({ showLoading: false });
      return res;
    },
    placeholderData: () => [] as string[],
  });
 
  const insuranceClaimChannelListForSelect = computed(() => {
    return insuranceClaimChannelList.value.map((item) => ({
      label: item,
      value: item,
    }));
  });
 
  return {
    insuranceClaimChannelList,
    insuranceClaimChannelListForSelect,
  };
}