| | |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | | const { config } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let _data = fromJS(this.state.data).toJS().forEach(item => { |
| | | if (item.$$uuid === uuid) { |
| | | item[btn.field] = count |
| | | } |
| | | }) |
| | | let _selectedData = fromJS(this.state.selectedData).toJS().forEach(item => { |
| | | if (item.$$uuid === uuid) { |
| | | item[btn.field] = count |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | data: _data, |
| | | selectedData: _selectedData |
| | | }) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { sync, config, setting, BID, BData } = this.state |
| | | |
| | |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.addListener('refreshLineData', this.refreshLineData) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | if (config.timer) { |
| | |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.removeListener('refreshLineData', this.refreshLineData) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | this.timer && this.timer.stop() |