From c1d6dff8bf8340fe030d3089cf5dff0e9cffcf58 Mon Sep 17 00:00:00 2001 From: zhangyongtian <1181606322@qq.com> Date: Thu, 29 Aug 2024 10:24:12 +0800 Subject: [PATCH] Revert "更改命名" --- gz-customerSystem/src/views/register/visit/component/applyDialog.jsx | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 39 insertions(+), 16 deletions(-) diff --git a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx index 57e321f..95eca5e 100644 --- a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx +++ b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, useRef, Fragment } from "react"; -import * as $$ from '../../../../utils/utility'; +import * as $$ from '@/utils/utility'; import { Row, Col, Space } from 'antd'; import { CheckOutlined, @@ -11,7 +11,7 @@ caseperfection_legal_active, caseperfection_organize, caseperfection_organize_active, -} from '../../../../assets/images/icon'; +} from '@/assets/images/icon'; import { Form, Input, Button, Radio, Select, Modal, Cascader, Upload, Message } from '@arco-design/web-react'; import KeyVisits from "./keyVisits"; import SelectUnitDialog from "./selectUnitDialog"; @@ -28,6 +28,15 @@ const formRef = useRef(); const [perClass, setPerClass] = useState('09_01001-1'); const [visible, setVisible] = useState(false); + + useEffect(() => { + if (props.editData) { + //编辑 + formRef.current.setFieldsValue({ + ...props.editData + }) + } + }, []) const personIconType = (v) => { @@ -137,12 +146,16 @@ label='民族' field='nation' > - <Select placeholder='请选择' allowClear> - {['汉族',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} + <Select + placeholder='请选择' + allowClear + showSearch + options={$$.options.nation} + filterOption={(inputValue, option) => + option.props.value.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 || + option.props.children.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 + } + > </Select> </FormItem> </Col> @@ -270,13 +283,22 @@ const handleSave = () => { if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { - props.handleAddParty({ - ...values, - partyType: props.dialogType, - perClass: perClass, - perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人' - }) - props.onClose() + if (!errors) { + if (props.editData) { + props.handleAddParty({ + ...props.editData, + ...values + }) + } else { + props.handleAddParty({ + ...values, + partyType: props.dialogType, + perClass: perClass, + perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人' + }) + } + props.onClose() + } }); } } @@ -317,6 +339,7 @@ requiredSymbol={false} initialValues={{ }}//默认值 + scrollToFirstError > <Row gutter={[32, 0]} style={{ margin: '0 -10px' }}>{formType(perClass)}</Row> </Form> @@ -334,7 +357,7 @@ className="dialogPrimary" onClick={handleSave} > - 保存信息 + 保存 </Button> <Button className="dialogBack"> 重置 -- Gitblit v1.8.0