king
2022-05-09 28ebe609e47b28794450cefc72d3e0f62fd904e7
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -20,7 +20,8 @@
    dict: PropTypes.object,         // 字典项
    menu: PropTypes.object,         // 菜单信息
    config: PropTypes.object,       // 页面配置信息
    search: PropTypes.array         // 搜索条件
    search: PropTypes.array,        // 搜索条件
    updRecord: PropTypes.func
  }
  state = {
@@ -126,6 +127,10 @@
      cbScripts: _cbScripts,
      status
    })
  }
  componentDidMount () {
    this.props.updRecord(this.state.status)
  }
  getRegOptions = (searches) => {
@@ -257,26 +262,6 @@
    if (activeKey === 'setting') {
      return new Promise((resolve, reject) => {
        this.settingForm.handleConfirm().then(res => {
          if (trigger === 'func' && res.interType !== 'inner') {
            notification.warning({
              top: 92,
              message: '使用内部接口,才可以创建存储过程!',
              duration: 5
            })
            this.setState({loading: false})
            reject()
            return
          } else if (trigger === 'interface' && res.interType !== 'system') {
            notification.warning({
              top: 92,
              message: '使用系统接口时,才可以创建接口!',
              duration: 5
            })
            this.setState({loading: false})
            reject()
            return
          }
          this.setState({
            setting: res
          }, () => {
@@ -295,23 +280,13 @@
      })
    } else if (activeKey === 'scripts') {
      return new Promise((resolve, reject) => {
        if (trigger === 'func' && setting.interType !== 'inner') {
          notification.warning({
            top: 92,
            message: '使用内部接口,才可以创建存储过程!',
            duration: 5
          })
        this.sqlverify(() => {
          this.setState({loading: false})
          resolve({...setting, scripts, preScripts, cbScripts})
        }, () => {
          this.setState({loading: false})
          reject()
        } else {
          this.sqlverify(() => {
            this.setState({loading: false})
            resolve({...setting, scripts, preScripts, cbScripts})
          }, () => {
            this.setState({loading: false})
            reject()
          }, 'submit')
        }
        }, 'submit')
      })
    } else {
      this.setState({loading: false})
@@ -519,7 +494,9 @@
  }
  updateStatus = (status) => {
    this.setState({status: {...this.state.status, ...status}})
    let _status = {...this.state.status, ...status}
    this.setState({status: _status})
    this.props.updRecord(_status)
  }
  render() {