| | |
| | | } |
| | | |
| | | reloadData = (menuId, id) => { |
| | | const { config } = this.state |
| | | const { config, group } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | this.loadData() |
| | | if (id === 'focus-refresh' && config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.refocus |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: null, |
| | | group: _group |
| | | }, () => { |
| | | this.setState({data: {$$empty: true}}) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | group: _group |
| | | }, () => { |
| | | this.loadData(true) |
| | | }) |
| | | } |
| | | } else if (id === 'focus-nofresh' && config.wrap.refocus) { |
| | | let formId = '' |
| | | group.fields.forEach(item => { |
| | | if (item.field === config.wrap.refocus) { |
| | | formId = item.uuid |
| | | } |
| | | }) |
| | | MKEmitter.emit('mkFC', 'focus', formId) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else if (position === 'grid' && config.wrap.datatype === 'static') { |
| | | if (config.wrap.refocus && group.setting.focus === config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.focus |
| | | |
| | | this.setState({ |
| | | group: _group |
| | | }) |
| | | } |
| | | this.setState({ |
| | | data: null |
| | | }, () => { |
| | |
| | | } |
| | | } |
| | | |
| | | async loadData () { |
| | | const { config, BID } = this.state |
| | | async loadData (refocus) { |
| | | const { config, BID, group } = this.state |
| | | |
| | | if (config.wrap.refocus && !refocus && group.setting.focus === config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.focus |
| | | |
| | | this.setState({ |
| | | group: _group |
| | | }) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.emit('reloadData', config.wrap.publicId) |