|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
import { useQuery } from '@tanstack/react-query';
|
|
import { useQuery } from '@tanstack/react-query';
|
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@d8d/shared-ui-components/components/ui/select';
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@d8d/shared-ui-components/components/ui/select';
|
|
|
import { FormControl, FormDescription, FormItem, FormLabel, FormMessage } from '@d8d/shared-ui-components/components/ui/form';
|
|
import { FormControl, FormDescription, FormItem, FormLabel, FormMessage } from '@d8d/shared-ui-components/components/ui/form';
|
|
|
-import { areaClient } from '../api/areaClient';
|
|
|
|
|
|
|
+import { areaClient, areaClientManager } from '../api/areaClient';
|
|
|
import type { InferResponseType } from 'hono/client';
|
|
import type { InferResponseType } from 'hono/client';
|
|
|
|
|
|
|
|
// 类型定义
|
|
// 类型定义
|
|
@@ -46,7 +46,7 @@ export const AreaSelect4Level: React.FC<AreaSelect4LevelProps> = ({
|
|
|
const { data: provinces, isLoading: isLoadingProvinces } = useQuery({
|
|
const { data: provinces, isLoading: isLoadingProvinces } = useQuery({
|
|
|
queryKey: ['areas', 'provinces'],
|
|
queryKey: ['areas', 'provinces'],
|
|
|
queryFn: async () => {
|
|
queryFn: async () => {
|
|
|
- const res = await areaClient.$get({
|
|
|
|
|
|
|
+ const res = await areaClientManager.get().$get({
|
|
|
query: {
|
|
query: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
@@ -70,7 +70,7 @@ export const AreaSelect4Level: React.FC<AreaSelect4LevelProps> = ({
|
|
|
queryKey: ['areas', 'cities', selectedProvince],
|
|
queryKey: ['areas', 'cities', selectedProvince],
|
|
|
queryFn: async () => {
|
|
queryFn: async () => {
|
|
|
if (!selectedProvince) return { data: [] };
|
|
if (!selectedProvince) return { data: [] };
|
|
|
- const res = await areaClient.$get({
|
|
|
|
|
|
|
+ const res = await areaClientManager.get().$get({
|
|
|
query: {
|
|
query: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
@@ -96,7 +96,7 @@ export const AreaSelect4Level: React.FC<AreaSelect4LevelProps> = ({
|
|
|
queryKey: ['areas', 'districts', selectedCity],
|
|
queryKey: ['areas', 'districts', selectedCity],
|
|
|
queryFn: async () => {
|
|
queryFn: async () => {
|
|
|
if (!selectedCity) return { data: [] };
|
|
if (!selectedCity) return { data: [] };
|
|
|
- const res = await areaClient.$get({
|
|
|
|
|
|
|
+ const res = await areaClientManager.get().$get({
|
|
|
query: {
|
|
query: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
@@ -122,7 +122,7 @@ export const AreaSelect4Level: React.FC<AreaSelect4LevelProps> = ({
|
|
|
queryKey: ['areas', 'towns', selectedDistrict],
|
|
queryKey: ['areas', 'towns', selectedDistrict],
|
|
|
queryFn: async () => {
|
|
queryFn: async () => {
|
|
|
if (!selectedDistrict) return { data: [] };
|
|
if (!selectedDistrict) return { data: [] };
|
|
|
- const res = await areaClient.$get({
|
|
|
|
|
|
|
+ const res = await areaClientManager.get().$get({
|
|
|
query: {
|
|
query: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 100,
|
|
pageSize: 100,
|