| | |
| | | */ |
| | | isSelf?: boolean; |
| | | onSuccess?: (data: API.GetTypeSearchSettingList[]) => any; |
| | | /**不传查全部,true查显示的 */ |
| | | status?: boolean; |
| | | }; |
| | | |
| | | export function useSearchSettingType({ |
| | |
| | | belongType = null, |
| | | onSuccess, |
| | | isSelf, |
| | | status = true, |
| | | }: UseSearchSettingTypeOptions) { |
| | | const { data, refetch } = useQuery({ |
| | | queryKey: [ |
| | | 'searchSettingServices/getTypeSearchSettingList', |
| | | { searchType, belongType, isSelf }, |
| | | { searchType, belongType, isSelf, status }, |
| | | ], |
| | | queryFn: async () => { |
| | | return await searchSettingServices.getTypeSearchSettingList( |
| | | { |
| | | searchType: searchType, |
| | | belongType: belongType, |
| | | status, |
| | | }, |
| | | { showLoading: false } |
| | | ); |
| | |
| | | return await queryClient.ensureQueryData({ |
| | | queryKey: [ |
| | | 'searchSettingServices/getTypeSearchSettingList', |
| | | { searchType: searchType, belongType: belongType }, |
| | | { searchType: searchType, belongType: belongType, status }, |
| | | ], |
| | | }); |
| | | } |