king
2021-09-01 c29a1e1c8278a25b83b6158c2d426aa26c427569
src/mob/searchconfig/index.jsx
@@ -15,6 +15,7 @@
import SettingForm from './settingform'
import asyncComponent from '@/utils/asyncComponent'
import { SearchItems } from './source'
import MKEmitter from '@/utils/events.js'
import './index.scss'
const { Panel } = Collapse
@@ -43,7 +44,8 @@
    sqlVerifing: false,    // sql验证
    showField: false,      // 显示表单字段值
    group: null,
    editGroup: null
    editGroup: null,
    saving: false
  }
  /**
@@ -59,6 +61,10 @@
    })
  }
  componentDidMount () {
    MKEmitter.addListener('completeSave', this.completeSave)
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -66,6 +72,11 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('completeSave', this.completeSave)
  }
  completeSave = () => {
    this.setState({saving: false})
  }
  /**
@@ -275,13 +286,12 @@
  submitConfig = () => {
    const { config } = this.state
    this.setState({originConfig: fromJS(config).toJS()})
    this.setState({originConfig: fromJS(config).toJS(), saving: true})
    this.props.handleSave(config)
    notification.success({
      top: 92,
      message: '保存成功。',
      duration: 1
    })
    setTimeout(() => {
      MKEmitter.emit('triggerMenuSave')
    }, 100)
  }
  cancelConfig = () => {
@@ -461,7 +471,7 @@
  }
  render () {
    const { dict, group, editGroup } = this.state
    const { dict, group, editGroup, saving } = this.state
    return (
      <div className="mob-search-board">
        <DndProvider backend={HTML5Backend}>
@@ -477,7 +487,7 @@
            </Collapse>
          </div>
          <div className="modal-control">
            <Button type="primary" onClick={this.submitConfig}>保存</Button>
            <Button type="primary" loading={saving} onClick={this.submitConfig}>保存</Button>
            <Button onClick={this.cancelConfig}>关闭</Button>
            {!group.floor ? <Button onClick={this.returnUp}>返回上级</Button> : null}
            <PasteComponent insert={this.insert} />