From c51f5e007a3e03c9d6731ab7f28f0080de009990 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 17 十一月 2021 18:38:32 +0800 Subject: [PATCH] 2021-11-17 --- src/tabviews/custom/components/card/data-card/index.jsx | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 9f8963a..5b91693 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -226,12 +226,14 @@ * @param {*} position // 鍒锋柊浣嶇疆 * @param {*} btn // 鎵ц鐨勬寜閽� */ - refreshByButtonResult = (menuId, position, btn) => { + refreshByButtonResult = (menuId, position, btn, id, lines) => { const { config, BID } = this.state if (config.uuid !== menuId) return - if (!btn || btn.resetPageIndex !== 'false') { + if (position === 'line' && lines && lines.length === 1) { + this.loadLinedata(lines[0].$$uuid) + } else if (!btn || btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { @@ -256,7 +258,19 @@ checkTopLine = () => { const { config, data } = this.state - if (!data || data.length === 0) return + if (!data || data.length === 0) { + this.setState({ + activeKey: '', + selectKeys: [], + selectedData: [] + }) + + MKEmitter.emit('resetSelectLine', config.uuid, '', '') + if (config.setting.$hasSyncModule) { + MKEmitter.emit('syncBalconyData', config.uuid, [], false) + } + return + } this.setState({ activeKey: 0, @@ -316,7 +330,7 @@ const { config } = this.state if (!config.setting.supModule || config.setting.supModule !== MenuID) return - if (id !== this.state.BID) { + if (id !== this.state.BID || id !== '') { this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { this.loadData() }) @@ -364,9 +378,19 @@ total: 0, loading: false }) - MKEmitter.emit('resetSelectLine', config.uuid, '', '') - if (config.setting.$hasSyncModule) { - MKEmitter.emit('syncBalconyData', config.uuid, [], false) + + if (selected !== 'false') { + setTimeout(() => { + this.checkTopLine() + }, 200) + if (selected === 'init') { + this.setState({selected: 'false'}) + } + } else { + MKEmitter.emit('resetSelectLine', config.uuid, '', '') + if (config.setting.$hasSyncModule) { + MKEmitter.emit('syncBalconyData', config.uuid, [], false) + } } return } @@ -409,9 +433,9 @@ } } else { MKEmitter.emit('resetSelectLine', config.uuid, '', '') - } - if (config.setting.$hasSyncModule) { - MKEmitter.emit('syncBalconyData', config.uuid, [], false) + if (config.setting.$hasSyncModule) { + MKEmitter.emit('syncBalconyData', config.uuid, [], false) + } } this.setState({ -- Gitblit v1.8.0