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/card/prop-card/index.jsx | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 651bd23..681652b 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -135,9 +135,15 @@ } if (_config.wrap.datatype === 'dynamic' && this.loaded) { - this.autoExec() + if (_config.wrap.goback === 'true' && _data.$$empty) { + this.timer && this.timer.stop() + + MKEmitter.emit('closeTabView', _config.$pageId) + } else { + this.autoExec() + } } - if (!_config.wrap.cardType && _data.$$uuid) { + if (_data.$$uuid) { setTimeout(() => { this.transferLine() }, 200) @@ -151,6 +157,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.wrap.datatype === 'public') { @@ -186,6 +193,7 @@ MKEmitter.removeListener('mkPublicData', this.mkPublicData) 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() @@ -213,12 +221,18 @@ this.loaded = true this.setState({sync: false, data: _data}, () => { - if (selected !== 'false') { - this.checkTopLine() - } else if (!config.wrap.cardType && _data.$$uuid) { - this.transferLine() + if (config.wrap.goback === 'true' && _data.$$empty) { + this.timer && this.timer.stop() + + MKEmitter.emit('closeTabView', config.$pageId) + } else { + if (selected !== 'false') { + this.checkTopLine() + } else if (_data.$$uuid) { + this.transferLine() + } + this.autoExec() } - this.autoExec() }) } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { this.setState({}, () => { @@ -240,10 +254,17 @@ this.loaded = true this.setState({data: _data}, () => { - if (selected !== 'false') { - this.checkTopLine() + if (config.wrap.goback === 'true' && _data.$$empty) { + this.timer && this.timer.stop() + + MKEmitter.emit('closeTabView', config.$pageId) } else { - this.transferLine() + if (selected !== 'false') { + this.checkTopLine() + } else { + this.transferLine() + } + this.autoExec() } }) } @@ -307,6 +328,19 @@ } } + refreshLineData = (menuId, btn, uuid, count) => { + const { config, data } = this.state + + if (config.uuid !== menuId) return + + let _data = fromJS(data).toJS() + _data[btn.field] = count + + this.setState({ + data: _data + }) + } + resetParentParam = (MenuID, id, data) => { const { config } = this.state -- Gitblit v1.8.0