king
2020-02-04 8d6f1d97f1f9d8c81313a2b27802be6426436518
src/templates/tableshare/verifycard/customform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Button } from 'antd'
import { Form, Row, Col, Input, Select, Button, notification } from 'antd'
import './index.scss'
const { TextArea } = Input
@@ -36,6 +36,30 @@
      if (!err) {
        values.uuid = this.state.editItem ? this.state.editItem.uuid : ''
        values.resultName = values.result === 'false' ? '不存在' : '存在'
        let _quot = values.sql.match(/'{1}/g)
        let _lparen = values.sql.match(/\({1}/g)
        let _rparen = values.sql.match(/\){1}/g)
        _quot = _quot ? _quot.length : 0
        _lparen = _lparen ? _lparen.length : 0
        _rparen = _rparen ? _rparen.length : 0
        if (_quot % 2 !== 0) {
          notification.warning({
            top: 92,
            message: 'sql中\'必须成对出现',
            duration: 10
          })
          return
        } else if (_lparen !== _rparen) {
          notification.warning({
            top: 92,
            message: 'sql中()必须成对出现',
            duration: 10
          })
          return
        }
        this.props.customChange(values)
        this.setState({
@@ -108,6 +132,10 @@
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '提示信息!'
                  },
                  {
                    pattern: /^[^']*$/ig,
                    message: '提示信息不允许包含\''
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}