From 3bdcb8da222aaedcc1b6b279d1d038fe3b714570 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 03 十月 2021 12:10:36 +0800 Subject: [PATCH] 2021-10-03 --- src/tabviews/custom/components/card/data-card/index.jsx | 36 +++++++++++++++++++++++++++++------- 1 files changed, 29 insertions(+), 7 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..83cd92d 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -256,7 +256,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, @@ -364,9 +376,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 +431,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