From 79e4981aa6cc9354276fc54cdf6d14eb08ab7fee Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 22 六月 2023 15:59:04 +0800 Subject: [PATCH] Merge branch 'develop' of ssh://121.36.20.145:29418/~jinfei/pc-plat into develop --- src/tabviews/custom/components/table/normal-table/index.jsx | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index ca20ae8..dc99a3a 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -606,6 +606,30 @@ } } + refreshLineData = (menuId, btn, uuid, count) => { + const { config } = this.state + + if (config.uuid !== menuId) return + + let _data = fromJS(this.state.data).toJS().map(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + return item + }) + let _selectedData = fromJS(this.state.selectedData).toJS().map(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + return item + }) + + this.setState({ + data: _data, + selectedData: _selectedData + }) + } + UNSAFE_componentWillReceiveProps(nextProps) { const { sync, config, setting, BID, BData } = this.state @@ -668,6 +692,7 @@ 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) { @@ -722,6 +747,7 @@ 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() -- Gitblit v1.8.0