From 76a4300654a18d228838c3f27455dc8e7a8cd616 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 一月 2021 17:04:42 +0800 Subject: [PATCH] Merge branch 'master' into bms --- src/tabviews/subtabtable/index.jsx | 72 ++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 40 deletions(-) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 190922a..f1a937b 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -26,15 +26,12 @@ class SubTabModalTable extends Component { static propTpyes = { - type: PropTypes.any, // 绫诲瀷锛宑alendar闇�鐗规畩澶勭悊 Tab: PropTypes.any, // 鏃ュ巻鏍囩淇℃伅鎴栨爣绛炬寜閽俊鎭� BID: PropTypes.string, // 涓婄骇鏁版嵁ID BData: PropTypes.any, // 涓婄骇鏁版嵁 MenuID: PropTypes.string, // 鑿滃崟Id mainSearch: PropTypes.any, // 涓昏〃鎼滅储鏉′欢 SupMenuID: PropTypes.string, // 涓婄骇鑿滃崟Id - refreshSupView: PropTypes.any, // 鍒锋柊涓婄骇鑿滃崟 - closeModalView: PropTypes.any // 鍏抽棴妯℃�佹 } state = { @@ -48,7 +45,7 @@ columns: null, // 鏄剧ず鍒� arr_field: '', // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆� setting: null, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 - data: null, // 鍒楄〃鏁版嵁闆� + data: [], // 鍒楄〃鏁版嵁闆� selectedData: [], // 宸查�夎〃鏍兼暟鎹� total: 0, // 鎬绘暟 loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� @@ -66,7 +63,7 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { permAction, type, Tab } = this.props + const { permAction, Tab } = this.props let param = { func: 'sPC_Get_LongParam', @@ -112,26 +109,15 @@ // 鐗堟湰鍏煎 config = UtilsUpdate.updateSubTable(config) - // 浠呮敮鎸乪xec銆乸rompt銆乸op 涓夌绫诲瀷鎸夐挳 + // 涓嶆敮鎸乫uncbutton銆乸opview 绫诲瀷鎸夐挳 let labels = [] - if (type === 'calendar') { - config.action = config.action.filter(item => { - if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) return true + config.action = config.action.filter(item => { + if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut', 'innerpage'].includes(item.OpenType)) return true - labels.push(item.label) + labels.push(item.label) - return false - }) - - } else { - config.action = config.action.filter(item => { - if (['exec', 'prompt', 'pop'].includes(item.OpenType)) return true - - labels.push(item.label) - - return false - }) - } + return false + }) if (window.GLOB.systemType !== 'production' && labels.length > 0) { notification.warning({ @@ -217,8 +203,10 @@ subcols.push(colMap.get(sub)) } }) - _col.subcols = subcols - _columns.push(_col) + if (subcols.length > 0) { + _col.subcols = subcols + _columns.push(_col) + } } else { _columns.push(col) } @@ -370,6 +358,9 @@ }) } item.key = index + item.$$uuid = item[setting.primaryKey] || '' + item.$$BID = BID || '' + return item }), total: result.total, @@ -510,18 +501,6 @@ } /** - * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤� - */ - refreshbyaction = (position, btn) => { - if (position === 'grid' || position === 'view' || position === 'maingrid') { - this.reloadtable(btn) - this.props.refreshSupView() - } else if (position === 'trigger') { // 鏃ュ巻瀛愯〃瑙﹀彂鏍囩鐐瑰嚮浜嬩欢 - this.props.closeModalView && this.props.closeModalView() - } - } - - /** * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁� */ getexceloutparam = (menuId, btnId) => { @@ -544,6 +523,21 @@ } /** + * @description 鎸夐挳鎵ц瀹屾垚鍚庨〉闈㈠埛鏂� + * @param {*} menuId // 鑿滃崟Id + * @param {*} position // 鍒锋柊浣嶇疆 + * @param {*} btn // 鎵ц鐨勬寜閽� + */ + refreshByButtonResult = (menuId, position, btn) => { + const { MenuID } = this.props + + if (MenuID !== menuId) return + + this.reloadtable(btn) + MKEmitter.emit('refreshPopButton', this.props.Tab.uuid) + } + + /** * @description 鍥捐〃瑙嗗浘鍒囨崲 */ changeChart = (uuid) => { @@ -561,6 +555,7 @@ componentDidMount () { MKEmitter.addListener('getexceloutparam', this.getexceloutparam) + MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) } /** @@ -571,6 +566,7 @@ return } MKEmitter.removeListener('getexceloutparam', this.getexceloutparam) + MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) } render() { @@ -606,7 +602,6 @@ BData={this.props.BData} selectedData={selectedData} MenuID={this.props.SupMenuID} - refreshdata={this.refreshbyaction} /> </div> <SubTable @@ -614,7 +609,6 @@ setting={setting} columns={columns} pageSize={pageSize} - BID={this.props.BID} data={this.state.data} dict={this.state.dict} BData={this.props.BData} @@ -623,7 +617,6 @@ loading={this.state.loading} refreshdata={this.refreshbytable} statFValue={this.state.statFValue} - refreshbyaction={this.refreshbyaction} chgSelectData={this.changeSelectedData} handleTableId={() => {}} /> @@ -641,7 +634,6 @@ data={this.state.data} BData={this.props.BData} loading={this.state.loading} - refreshdata={this.refreshbyaction} handleTableId={() => {}} /> </Col> -- Gitblit v1.8.0