| | |
| | | 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 |
| | |
| | | sqlVerifing: false, // sql验证 |
| | | showField: false, // 显示表单字段值 |
| | | group: null, |
| | | editGroup: null |
| | | editGroup: null, |
| | | saving: false |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | completeSave = () => { |
| | | this.setState({saving: false}) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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 = () => { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { dict, group, editGroup } = this.state |
| | | const { dict, group, editGroup, saving } = this.state |
| | | return ( |
| | | <div className="mob-search-board"> |
| | | <DndProvider backend={HTML5Backend}> |
| | |
| | | </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} /> |