zhengyiming
2 天以前 1d472eb06970c85b0edfb58871956bc2c8d69916
packages/hooks/dic.ts
@@ -57,6 +57,7 @@
  /** 查询所有 */
  all?: MaybeRef<boolean>;
  maxDeep?: number;
  field1?: MaybeRef<string>;
};
export function useDictionaryDataSelect({
@@ -67,6 +68,7 @@
  keywords,
  all,
  maxDeep,
  field1,
}: UseDictionaryDataSelectOptions) {
  const params = computed(() => ({
    categoryId: unref(categoryId),
@@ -75,6 +77,7 @@
    keywords: unref(keywords),
    all: unref(all),
    maxDeep: maxDeep,
    field1: unref(field1),
  }));
  const { data: dictionaryDataList, refetch } = useQuery({
    queryKey: ['dictionaryServices/getDictionaryDataSelect', params],
@@ -109,13 +112,13 @@
    return queryClient.ensureQueryData<
      API.SelectOptionStringGetDictionaryDataSelectQueryResultOption[]
    >({
      queryKey: ['dictionaryServices/getDictionaryDataSelect'],
      queryKey: ['dictionaryServices/getDictionaryDataSelect', params],
    });
  }
  function updateDictionaryDataSelect(categoryId?: string) {
    queryClient.invalidateQueries({
      queryKey: ['dictionaryServices/getDictionaryDataSelect'],
      queryKey: ['dictionaryServices/getDictionaryDataSelect', params],
    });
  }