|
|
@@ -23,6 +23,8 @@ import { Checkbox } from '@d8d/shared-ui-components/components/ui/checkbox';
|
|
|
import { Alert, AlertDescription } from '@d8d/shared-ui-components/components/ui/alert';
|
|
|
import { AlertCircle } from 'lucide-react';
|
|
|
import { AreaSelect } from '@d8d/area-management-ui';
|
|
|
+import { Form } from '@d8d/shared-ui-components/components/ui/form';
|
|
|
+import { useForm } from 'react-hook-form';
|
|
|
import { disabilityClient } from '../api/disabilityClient';
|
|
|
import type {
|
|
|
DisabledPersonData,
|
|
|
@@ -59,6 +61,9 @@ const DisabledPersonSelector: React.FC<DisabledPersonSelectorProps> = ({
|
|
|
const [showBlacklistConfirm, setShowBlacklistConfirm] = useState(false);
|
|
|
const [pendingSelection, setPendingSelection] = useState<DisabledPersonData | DisabledPersonData[] | null>(null);
|
|
|
|
|
|
+ // 为AreaSelect创建表单上下文
|
|
|
+ const form = useForm();
|
|
|
+
|
|
|
// 搜索残疾人列表
|
|
|
const { data, isLoading, refetch } = useQuery({
|
|
|
queryKey: ['disabled-persons-search', searchParams],
|
|
|
@@ -270,11 +275,14 @@ const DisabledPersonSelector: React.FC<DisabledPersonSelectorProps> = ({
|
|
|
<div className="grid grid-cols-4 gap-4">
|
|
|
<div className="space-y-2">
|
|
|
<Label>省份/城市</Label>
|
|
|
- <AreaSelect
|
|
|
- value={areaSelection}
|
|
|
- onChange={setAreaSelection}
|
|
|
- data-testid="area-select"
|
|
|
- />
|
|
|
+ {/* AreaSelect需要Form上下文,所以包装在Form中 */}
|
|
|
+ <Form {...form}>
|
|
|
+ <AreaSelect
|
|
|
+ value={areaSelection}
|
|
|
+ onChange={setAreaSelection}
|
|
|
+ data-testid="area-select"
|
|
|
+ />
|
|
|
+ </Form>
|
|
|
</div>
|
|
|
|
|
|
<div className="space-y-2">
|