|
@@ -314,7 +314,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
|
|
|
|
|
{/* 创建/编辑模态框 */}
|
|
{/* 创建/编辑模态框 */}
|
|
|
<Dialog open={isModalOpen} onOpenChange={setIsModalOpen}>
|
|
<Dialog open={isModalOpen} onOpenChange={setIsModalOpen}>
|
|
|
- <DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
|
|
|
|
|
|
+ <DialogContent className="w-[95vw] max-w-4xl max-h-[80vh] flex flex-col">
|
|
|
<DialogHeader>
|
|
<DialogHeader>
|
|
|
<DialogTitle data-testid={isCreateForm ? 'create-disabled-person-dialog-title' : 'edit-disabled-person-dialog-title'}>
|
|
<DialogTitle data-testid={isCreateForm ? 'create-disabled-person-dialog-title' : 'edit-disabled-person-dialog-title'}>
|
|
|
{isCreateForm ? '新增残疾人' : '编辑残疾人信息'}
|
|
{isCreateForm ? '新增残疾人' : '编辑残疾人信息'}
|
|
@@ -323,11 +323,11 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
{isCreateForm ? '填写残疾人基本信息,带*的为必填项' : '修改残疾人信息'}
|
|
{isCreateForm ? '填写残疾人基本信息,带*的为必填项' : '修改残疾人信息'}
|
|
|
</DialogDescription>
|
|
</DialogDescription>
|
|
|
</DialogHeader>
|
|
</DialogHeader>
|
|
|
-
|
|
|
|
|
- {isCreateForm ? (
|
|
|
|
|
- <Form {...createForm}>
|
|
|
|
|
- <form onSubmit={createForm.handleSubmit(onSubmitCreate, (errors) => console.debug('创建表单验证错误:', errors))} className="space-y-4">
|
|
|
|
|
- <div className="grid grid-cols-2 gap-4">
|
|
|
|
|
|
|
+ <div className="flex-1 overflow-y-auto pr-2 overscroll-contain touch-auto">
|
|
|
|
|
+ {isCreateForm ? (
|
|
|
|
|
+ <Form {...createForm}>
|
|
|
|
|
+ <form id="create-form" onSubmit={createForm.handleSubmit(onSubmitCreate, (errors) => console.debug('创建表单验证错误:', errors))} className="space-y-4">
|
|
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
|
<FormField
|
|
<FormField
|
|
|
control={createForm.control}
|
|
control={createForm.control}
|
|
|
name="name"
|
|
name="name"
|
|
@@ -459,7 +459,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
control={createForm.control}
|
|
control={createForm.control}
|
|
|
name="idAddress"
|
|
name="idAddress"
|
|
|
render={({ field }) => (
|
|
render={({ field }) => (
|
|
|
- <FormItem className="col-span-2">
|
|
|
|
|
|
|
+ <FormItem className="col-span-1 md:col-span-2">
|
|
|
<FormLabel>身份证地址 *</FormLabel>
|
|
<FormLabel>身份证地址 *</FormLabel>
|
|
|
<FormControl>
|
|
<FormControl>
|
|
|
<Input placeholder="请输入身份证地址" {...field} />
|
|
<Input placeholder="请输入身份证地址" {...field} />
|
|
@@ -469,7 +469,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
)}
|
|
)}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- <div className="col-span-2">
|
|
|
|
|
|
|
+ <div className="col-span-1 md:col-span-2">
|
|
|
<FormLabel>居住地址 *</FormLabel>
|
|
<FormLabel>居住地址 *</FormLabel>
|
|
|
<div className="space-y-4">
|
|
<div className="space-y-4">
|
|
|
<AreaSelect
|
|
<AreaSelect
|
|
@@ -536,7 +536,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
)}
|
|
)}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- <div className="col-span-2">
|
|
|
|
|
|
|
+ <div className="col-span-1 md:col-span-2">
|
|
|
<FormLabel>照片上传</FormLabel>
|
|
<FormLabel>照片上传</FormLabel>
|
|
|
<FileSelector
|
|
<FileSelector
|
|
|
value={null}
|
|
value={null}
|
|
@@ -551,21 +551,12 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <DialogFooter>
|
|
|
|
|
- <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
|
|
|
|
|
- 取消
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button type="submit" disabled={createMutation.isPending}>
|
|
|
|
|
- {createMutation.isPending ? '创建中...' : '创建'}
|
|
|
|
|
- </Button>
|
|
|
|
|
- </DialogFooter>
|
|
|
|
|
</form>
|
|
</form>
|
|
|
</Form>
|
|
</Form>
|
|
|
) : (
|
|
) : (
|
|
|
<Form {...updateForm}>
|
|
<Form {...updateForm}>
|
|
|
- <form onSubmit={updateForm.handleSubmit(onSubmitUpdate)} className="space-y-4">
|
|
|
|
|
- <div className="grid grid-cols-2 gap-4">
|
|
|
|
|
|
|
+ <form id="update-form" onSubmit={updateForm.handleSubmit(onSubmitUpdate)} className="space-y-4">
|
|
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
|
<FormField
|
|
<FormField
|
|
|
control={updateForm.control}
|
|
control={updateForm.control}
|
|
|
name="name"
|
|
name="name"
|
|
@@ -697,7 +688,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
control={updateForm.control}
|
|
control={updateForm.control}
|
|
|
name="idAddress"
|
|
name="idAddress"
|
|
|
render={({ field }) => (
|
|
render={({ field }) => (
|
|
|
- <FormItem className="col-span-2">
|
|
|
|
|
|
|
+ <FormItem className="col-span-1 md:col-span-2">
|
|
|
<FormLabel>身份证地址 *</FormLabel>
|
|
<FormLabel>身份证地址 *</FormLabel>
|
|
|
<FormControl>
|
|
<FormControl>
|
|
|
<Input placeholder="请输入身份证地址" {...field} />
|
|
<Input placeholder="请输入身份证地址" {...field} />
|
|
@@ -707,7 +698,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
)}
|
|
)}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- <div className="col-span-2">
|
|
|
|
|
|
|
+ <div className="col-span-1 md:col-span-2">
|
|
|
<FormLabel>居住地址 *</FormLabel>
|
|
<FormLabel>居住地址 *</FormLabel>
|
|
|
<div className="space-y-4">
|
|
<div className="space-y-4">
|
|
|
<AreaSelect
|
|
<AreaSelect
|
|
@@ -774,18 +765,24 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
)}
|
|
)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <DialogFooter>
|
|
|
|
|
- <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
|
|
|
|
|
- 取消
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button type="submit" disabled={updateMutation.isPending}>
|
|
|
|
|
- {updateMutation.isPending ? '更新中...' : '更新'}
|
|
|
|
|
- </Button>
|
|
|
|
|
- </DialogFooter>
|
|
|
|
|
</form>
|
|
</form>
|
|
|
</Form>
|
|
</Form>
|
|
|
)}
|
|
)}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <DialogFooter className="mt-4">
|
|
|
|
|
+ <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
|
|
|
|
|
+ 取消
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ {isCreateForm ? (
|
|
|
|
|
+ <Button type="submit" form="create-form" disabled={createMutation.isPending}>
|
|
|
|
|
+ {createMutation.isPending ? '创建中...' : '创建'}
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Button type="submit" form="update-form" disabled={updateMutation.isPending}>
|
|
|
|
|
+ {updateMutation.isPending ? '更新中...' : '更新'}
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </DialogFooter>
|
|
|
</DialogContent>
|
|
</DialogContent>
|
|
|
</Dialog>
|
|
</Dialog>
|
|
|
|
|
|
|
@@ -832,7 +829,7 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
<label className="text-sm font-medium">身份证地址</label>
|
|
<label className="text-sm font-medium">身份证地址</label>
|
|
|
<p className="text-sm text-muted-foreground">{viewData.idAddress}</p>
|
|
<p className="text-sm text-muted-foreground">{viewData.idAddress}</p>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="col-span-2">
|
|
|
|
|
|
|
+ <div className="col-span-1 md:col-span-2">
|
|
|
<label className="text-sm font-medium">居住地址</label>
|
|
<label className="text-sm font-medium">居住地址</label>
|
|
|
<p className="text-sm text-muted-foreground">
|
|
<p className="text-sm text-muted-foreground">
|
|
|
{viewData.province} {viewData.city} {viewData.district} {viewData.detailedAddress}
|
|
{viewData.province} {viewData.city} {viewData.district} {viewData.detailedAddress}
|