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/table/edit-table/index.jsx | 52 ++++++++++++++-------------------------------------- 1 files changed, 14 insertions(+), 38 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 98aed40..f130dc6 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { notification } from 'antd' @@ -22,14 +21,12 @@ BID: PropTypes.any, // 鐖剁骇Id config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 - menuType: PropTypes.any, // 鑿滃崟绫诲瀷 } state = { BID: '', // 涓婄骇ID BData: '', // 涓婄骇缁勪欢琛屾暟鎹� config: {}, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 - searchlist: null, // 鎼滅储鏉′欢 actions: null, // 鎸夐挳闆� columns: null, // 鏄剧ず鍒� arr_field: '', // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆� @@ -150,7 +147,6 @@ title: _config.wrap.title, config: _config, setting: setting, - searchlist: _config.search, actions: _config.action, columns: _columns, arr_field: _config.columns.map(col => col.field).join(','), @@ -204,7 +200,7 @@ }) let _orderBy = orderBy || setting.order - let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType) + let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID) let result = await Api.genericInterface(param) if (result.status) { @@ -267,7 +263,7 @@ }) let _orderBy = orderBy || setting.order - let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id) + let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, id) let result = await Api.genericInterface(param) if (result.status) { @@ -358,7 +354,7 @@ } let _orderBy = orderBy || setting.order - let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID, this.props.menuType) + let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID) Api.genericInterface(param).then(res => { if (res.status) { @@ -524,26 +520,16 @@ if (config.uuid !== menuId) return - 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.loadmainLinedata(lines[0].$$uuid) - } else { - this.reloadtable(btn) - } - } else if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� - if (supModule && BID) { - MKEmitter.emit('reloadData', supModule, BID) - } else { - this.reloadtable(btn) - } + if (position === 'line') { + if (lines && lines.length === 1) { + this.loadmainLinedata(lines[0].$$uuid) } else { this.reloadtable(btn) } + } else if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� + MKEmitter.emit('reloadData', config.setting.supModule, BID) + } else { + this.reloadtable(btn) } if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」 @@ -586,13 +572,13 @@ } render() { - const { BID, setting, searchlist, actions, config, columns, BData, selectedData, lock } = this.state + const { BID, setting, actions, config, columns, BData, selectedData, lock } = this.state return ( <div className="custom-edit-table" id={'anchor' + config.uuid} style={config.style}> <NormalHeader config={config}/> - {searchlist && searchlist.length ? - <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null + {config.search && config.search.length ? + <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } <MainAction BID={BID} @@ -623,14 +609,4 @@ } } -const mapStateToProps = (state) => { - return { - menuType: state.editLevel - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(EditableTable) \ No newline at end of file +export default EditableTable \ No newline at end of file -- Gitblit v1.8.0