import React, { useState, useEffect, useContext } from 'react'; import { Form, Modal, Button, message, Space, Input } from 'antd'; import apiObj from '@api/index'; import RegularContext from './regular-context'; const { post, api, xPost } = apiObj; const { TextArea } = Input; function EditBlock(props) { useEffect(() => { }, []); const [form] = Form.useForm(); const [delvisible, setDelVisible] = useState(false); const { regularDetail, type, flag } = useContext(RegularContext); const initialValues = regularDetail; const onFinish = values => { if (flag == 1) { setDelVisible(true) } else { addRegular(values) } }; //添加 function addRegular(params) { let url if (type == 1) { url = api.addRegular } else { url = api.upRegularById params.id = regularDetail.id } post(url, params).then((res) => { if (res.data.code === 200) { props.userChange() message.success(res.data.message); form.resetFields(); } else { message.error(res.data.message); } }) } function cancel() { props.cancel() } return ( <>
该正则式关联字段校验规则,修改后将同步更新,确认修改?