/* * Author: 黎永顺 * name: 新增校验规则 * Description: * Date: 2022-07-04 11:53:34 */ import React, {Component} from "react"; import {Button, Col, message, Row} from "antd"; import {WeaDialog, WeaFormItem, WeaInput, WeaTextarea} from "ecCom"; import "./index.less"; class AddValidRuleModal extends Component { constructor(props) { super(props); this.state = { value: "", name: "" }; } handleChange = (value) => { this.setState({ value }); }; handleSubmit = () => { if (!this.validateForm()) return; console.log(111); }; validateForm = () => { const {name, value} = this.state; if (_.isEmpty(name)) { message.error("请填写公式名称"); return false; } if (_.isEmpty(value)) { message.error("请填写公式内容"); return false; } return true; }; render() { const {value, name} = this.state; return ( this.props.onCancel()} title={"函数公式"} visible={this.props.visible} style={{width: 800, maxHeight: "70vh", overflow: "auto"}} hasScroll buttons={[ , ]} > this.setState({name})} placeholder={"请输入公式名称"}/> this.contentProps = input} minRows={8} maxRows={8} value={value} onChange={(value) => this.handleChange(value)} noResize={true} style={{fontSize: "14px", lineHeight: 1.2}} /> ); } } export default AddValidRuleModal;