From ac3fc53f2c2f69690dbc0b7d5637624bb4457f73 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 25 三月 2022 23:05:18 +0800 Subject: [PATCH] 2022-03-25 --- src/tabviews/custom/components/card/data-card/index.jsx | 80 +++++++++++++++++++++++++--------------- 1 files changed, 50 insertions(+), 30 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 66a25b5..c13c422 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -268,27 +268,14 @@ if (config.uuid !== menuId) return - if (position === 'line' && lines && lines.length === 1) { - this.loadLinedata(lines[0].$$uuid) - } else if (!btn || btn.resetPageIndex !== 'false') { - this.setState({ - pageIndex: 1 - }, () => { - this.loadData() - }) - } else { - this.loadData() - } - - if (supComs) { - if (btn.syncComponentId && btn.syncComponentId !== config.uuid && !supComs.includes(btn.syncComponentId)) { - MKEmitter.emit('reloadData', btn.syncComponentId) // 鍚岀骇鏍囩鍒锋柊 - } - - if (position === 'mainline' || position === 'popclose') { // 涓昏〃琛屽埛鏂� + btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) + + if (position === 'mainline' || position === 'popclose') { // 涓昏〃鍒锋柊锛屽幓闄ゅ悓姝ュ埛鏂扮粍浠� let supNode = supNodes[supNodes.length - 1] supComs.forEach((item, i) => { + if (item === btn.syncComponentId) return + setTimeout(() => { if (supNode && supNode.key === item) { MKEmitter.emit('reloadData', item, supNode.value) @@ -297,21 +284,55 @@ } }, i * 10) }) - if (position === 'popclose') { // 鏍囩鍏抽棴鍒锋柊 - btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) + } else if (!btn.syncComponentId || !supComs.includes(btn.syncComponentId)) { + if (position === 'line') { + if (lines && lines.length === 1) { + this.loadLinedata(lines[0].$$uuid) + } else { + this.loadData() + } + } else if (!btn || btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData() + }) + } else { + this.loadData() } } } else { - if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) { - MKEmitter.emit('reloadData', btn.syncComponentId) // 鍚岀骇鏍囩鍒锋柊 + let supModule = config.setting.supModule + + btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) + + if (!btn.syncComponentId || btn.syncComponentId !== supModule) { + if (position === 'line') { + if (lines && lines.length === 1) { + this.loadLinedata(lines[0].$$uuid) + } else { + this.loadData() + } + } else if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� + if (supModule && BID) { + MKEmitter.emit('reloadData', supModule, BID) + } else { + this.loadData() + } + } else if (!btn || btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData() + }) + } else { + this.loadData() + } } - - if (position === 'mainline' && config.setting.supModule) { // 涓昏〃琛屽埛鏂� - MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty')) - } else if (position === 'popclose') { // 鏍囩鍏抽棴鍒锋柊 - config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty')) - btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) - } + } + + if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」 + btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) } } @@ -377,7 +398,6 @@ const { config } = this.state if (config.uuid !== menuId) return - if (id === 'empty') return if (!id) { this.loadData() -- Gitblit v1.8.0