From e4666c46c685ec7eabff25af9890d54c0ff2952b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 六月 2023 17:55:56 +0800 Subject: [PATCH] 2023-06-16 --- src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 1905369..d75ebe9 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -115,6 +115,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) { @@ -150,6 +151,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() @@ -208,6 +210,22 @@ } } + refreshLineData = (menuId, btn, uuid, count) => { + const { config, data } = this.state + + if (config.uuid !== menuId) return + + let _data = fromJS(data).toJS().forEach(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + }) + + this.setState({ + data: _data + }) + } + resetParentParam = (MenuID, id, data) => { const { config } = this.state @@ -219,6 +237,22 @@ } } + refreshLineData = (menuId, btn, uuid, count) => { + const { config, data } = this.state + + if (config.uuid !== menuId) return + + let _data = fromJS(data).toJS().forEach(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + }) + + this.setState({ + data: _data + }) + } + reloadData = (menuId) => { const { config } = this.state -- Gitblit v1.8.0