From ed818fbca1a913065a6a3c2c767714efe5b18685 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 17 八月 2020 11:21:22 +0800 Subject: [PATCH] 2020-08-17 --- src/tabviews/subtabtable/index.jsx | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index a8bb511..2478210 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -27,9 +27,11 @@ 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 // 鍏抽棴妯℃�佹 @@ -138,7 +140,7 @@ // 浠呮敮鎸乪xec銆乸rompt銆乸op 涓夌绫诲瀷鎸夐挳 if (type === 'calendar') { - config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab'].includes(item.OpenType)) + config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) } else { config.action = config.action.filter(item => ['exec', 'prompt', 'pop'].includes(item.OpenType)) } @@ -359,9 +361,15 @@ * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙� */ getCustomParam = () => { + const { mainSearch } = this.props const { pageIndex, pageSize, orderBy, search, setting } = this.state - let _search = Utils.formatCustomMainSearch(search) + let searches = search + if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 + searches = [...mainSearch, ...search] + } + + let _search = Utils.formatCustomMainSearch(searches) let param = { OrderCol: orderBy || setting.order, @@ -402,9 +410,15 @@ * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁� */ getDefaultParam = () => { + const { mainSearch } = this.props const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state - let _search = Utils.joinMainSearchkey(search) + let searches = search + if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 + searches = [...mainSearch, ...search] + } + + let _search = Utils.joinMainSearchkey(searches) _search = _search ? 'where ' + _search : '' let param = { @@ -435,7 +449,7 @@ let regoptions = null if (setting.queryType === 'statistics' || param.custom_script) { - let allSearch = Utils.getAllSearchOptions(search) + let allSearch = Utils.getAllSearchOptions(searches) regoptions = allSearch.map(item => { return { @@ -589,7 +603,7 @@ * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤� */ refreshbyaction = (position) => { - if (position === 'grid') { + if (position === 'grid' || position === 'maingrid') { this.reloadtable() this.props.refreshSupView() } else if (position === 'view') { @@ -612,6 +626,26 @@ data: record } }) + } + + /** + * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁� + */ + getexceloutparam = () => { + const { Tab, mainSearch } = this.props + const { arr_field, orderBy, search, setting} = this.state + + let searches = search + if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 + searches = [...mainSearch, ...search] + } + + return { + arr_field: arr_field, + orderBy: orderBy || setting.order, + search: searches, + menuName: Tab.label + } } /** @@ -682,6 +716,7 @@ logcolumns={this.state.logcolumns} operations={config.gridBtn.operations || []} refreshdata={this.refreshbyaction} + getexceloutparam={this.getexceloutparam} /> </div> <SubTable -- Gitblit v1.8.0