From 8d6f1d97f1f9d8c81313a2b27802be6426436518 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 二月 2020 20:07:19 +0800 Subject: [PATCH] 2020-02-04 --- src/templates/tableshare/verifycard/customscript/index.jsx | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/src/templates/tableshare/verifycard/customscript/index.jsx b/src/templates/tableshare/verifycard/customscript/index.jsx index 9928e47..5379c91 100644 --- a/src/templates/tableshare/verifycard/customscript/index.jsx +++ b/src/templates/tableshare/verifycard/customscript/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Button } from 'antd' +import { Form, Row, Col, Input, Button, notification } from 'antd' import './index.scss' const { TextArea } = Input @@ -33,6 +33,30 @@ if (!err) { values.uuid = this.state.editItem ? this.state.editItem.uuid : '' + 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.scriptsChange(values) this.setState({ editItem: null -- Gitblit v1.8.0