king
2022-11-21 f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89
src/menu/datasource/index.jsx
@@ -5,7 +5,6 @@
import { SettingOutlined } from '@ant-design/icons'
import VerifyCard from './verifycard'
import MKEmitter from '@/utils/events.js'
import './index.scss'
class DataSource extends Component {
@@ -140,8 +139,6 @@
      visible: true,
      mainSearch: search
    })
    MKEmitter.emit('modalStatus', '数据源')
  }
  verifySubmit = () => {
@@ -187,14 +184,22 @@
            }
          })
        })
      } else {
        res.scripts.forEach(item => {
          if (item.status === 'false') return
          if (/exec\s/ig.test(item.sql)) {
            maxScript = 1000
          } else if (item.sql.length > maxScript) {
            maxScript = item.sql.length
          }
        })
      }
      res.setting.maxScript = maxScript
      this.setState({loading: false, visible: false})
      this.props.updateConfig({...config, ...res})
      MKEmitter.emit('modalStatus', false)
    }, () => {
      this.setState({loading: false})
    })
@@ -216,7 +221,7 @@
          okText="提交"
          onOk={this.verifySubmit}
          confirmLoading={loading}
          onCancel={() => { MKEmitter.emit('modalStatus', false);this.setState({ visible: false }) }}
          onCancel={() => {this.setState({ visible: false }) }}
          destroyOnClose
        >
          <VerifyCard