From c6f8e27d35cd31bb6393a1e7f747b6b2593dbd7a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 六月 2022 13:56:57 +0800 Subject: [PATCH] 2022-06-08 --- src/tabviews/custom/components/card/data-card/index.jsx | 60 ++++++++++++++++++++++++------------------------------------ 1 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 3b9a2bc..b654209 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -258,13 +258,9 @@ if (config.uuid !== menuId) return if (supComs) { - 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) @@ -273,7 +269,7 @@ } }, i * 10) }) - } else if (!btn.syncComponentId || !supComs.includes(btn.syncComponentId)) { + } else { if (position === 'line') { if (lines && lines.length === 1) { this.loadLinedata(lines[0].$$uuid) @@ -293,30 +289,22 @@ } else { 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(id) - } - } else if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� - if (supModule && BID) { - MKEmitter.emit('reloadData', supModule, BID) - } else { - this.loadData(id) - } - } else if (!btn || btn.resetPageIndex !== 'false') { - this.setState({ - pageIndex: 1 - }, () => { - this.loadData(id) - }) + if (position === 'line') { + if (lines && lines.length === 1) { + this.loadLinedata(lines[0].$$uuid) } else { this.loadData(id) } + } else if ((position === 'mainline' || position === 'popclose') && supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� + MKEmitter.emit('reloadData', supModule, BID) + } else if (!btn || btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData(id) + }) + } else { + this.loadData(id) } } @@ -328,7 +316,15 @@ checkTopLine = (id) => { const { config, data } = this.state - if (!data || data.length === 0 || data[0].$disabled) { + let index = 0 + if (id && data) { + index = data.findIndex(item => item.$$uuid === id) + if (index === -1) { + index = 0 + } + } + + if (!data || data.length === 0 || data[index].$disabled) { this.setState({ activeKey: '', selectKeys: [], @@ -340,14 +336,6 @@ MKEmitter.emit('syncBalconyData', config.uuid, [], false) } return - } - - let index = 0 - if (id) { - index = data.findIndex(item => item.$$uuid === id) - if (index === -1) { - index = 0 - } } this.setState({ @@ -744,7 +732,7 @@ } return ( - <div className="custom-data-card-box" style={config.style}> + <div className="custom-data-card-box" id={'anchor' + config.uuid} style={config.style}> {loading ? <div className="loading-mask"> {data ? <div className="ant-spin-blur"></div> : null} -- Gitblit v1.8.0