wupengfei
8 天以前 bd20a385dd86cf32735578c4c140a0aebf758e45
src/hooks/dic.ts
@@ -11,6 +11,8 @@
   */
  isSelf?: boolean;
  onSuccess?: (data: API.GetTypeSearchSettingList[]) => any;
  /**不传查全部,true查显示的 */
  status?: boolean;
};
export function useSearchSettingType({
@@ -18,17 +20,19 @@
  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 }
      );
@@ -45,7 +49,7 @@
    return await queryClient.ensureQueryData({
      queryKey: [
        'searchSettingServices/getTypeSearchSettingList',
        { searchType: searchType, belongType: belongType },
        { searchType: searchType, belongType: belongType, status },
      ],
    });
  }