From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 八月 2022 11:42:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/custom/components/card/data-card/index.jsx | 69 ++++++++++++++-------------------- 1 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index ff0e6b9..ff124ec 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -22,7 +22,6 @@ data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 - menuType: PropTypes.any, // 鑿滃崟绫诲瀷 } state = { @@ -258,13 +257,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 +268,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 +288,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 +315,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 +335,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({ @@ -465,7 +452,7 @@ } async loadData (id) { - const { mainSearch, menuType } = this.props + const { mainSearch } = this.props const { config, arr_field, pageIndex, search, BID, BData, selected } = this.state if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� @@ -515,7 +502,7 @@ }) let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, menuType) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID) let result = await Api.genericInterface(param) if (result.status) { @@ -576,7 +563,7 @@ * @description 鑾峰彇鍗曡鏁版嵁 */ async loadLinedata (id) { - const { mainSearch, menuType } = this.props + const { mainSearch } = this.props const { config, arr_field, pageIndex, search, BID, BData } = this.state let searches = fromJS(search).toJS() @@ -594,7 +581,7 @@ }) let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, menuType, id) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, id) let result = await Api.genericInterface(param) if (result.status) { @@ -751,7 +738,7 @@ <Spin /> </div> : null } - <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> + <NormalHeader config={config} BID={BID} refresh={this.refreshSearch} /> {config.action && config.action.length > 0 ? <MainAction BID={BID} -- Gitblit v1.8.0