king
2023-01-17 cc1a76df575c18f0d0ee96e8658461efdce3a918
src/menu/datasource/verifycard/customscript/index.jsx
@@ -10,7 +10,6 @@
class CustomForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    defaultsql: PropTypes.string,   // 默认sql
    setting: PropTypes.object,      // 设置
    searches: PropTypes.array,      // 搜索条件
@@ -101,6 +100,15 @@
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        if (/^[\s\n]+$/.test(values.sql)) {
          notification.warning({
            top: 92,
            message: '请输入sql!',
            duration: 5
          })
          return
        }
        values.uuid = this.state.editItem ? this.state.editItem.uuid : ''
        let _quot = values.sql.match(/'{1}/g)
@@ -152,7 +160,9 @@
            loading: false
          })
          MKEmitter.emit('editLineId', values.uuid)
          if (values.uuid) {
            MKEmitter.emit('editLineId', values.uuid)
          }
          this.props.form.setFieldsValue({
            sql: ' '
@@ -256,16 +266,16 @@
            </Button>
          </Col>
          <Col span={24} className="sql">
            <Form.Item label={'sql'}>
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
                initialValue: '',
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + 'sql!'
                    message: '请输入sql!'
                  }
                ]
              })(<CodeMirror />)}
              })(<CodeMirror/>)}
            </Form.Item>
          </Col>
        </Row>