king
2022-06-18 fe21d23b147ed5cec22b4f76a88840b05495d4ad
src/templates/zshare/verifycard/customscript/index.jsx
@@ -45,9 +45,18 @@
  }
  handleConfirm = () => {
    const { type } = this.props
    const { editItem } = this.state
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (type === 'fullscreen' && err) {
        notification.warning({
          top: 92,
          message: '请输入sql!',
          duration: 5
        })
        return
      }
      if (!err) {
        values.uuid = editItem ? editItem.uuid : ''
        values.position = values.position || (editItem ? editItem.position : 'front')
@@ -231,6 +240,7 @@
  render() {
    const { usefulfields, systemScripts, btn, type } = this.props
    const { getFieldDecorator } = this.props.form
    const { editItem } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -300,7 +310,7 @@
          </Col> : null}
          <Col span={6} className="add">
            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}>
              保存
              {_type === 'fullscreen' && !editItem ? '添加' : '保存'}
            </Button>
            <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}>
              取消