From fa381753ef2a2b25b1c0722549ac17e333da79be Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 22:50:54 +0800 Subject: [PATCH] 2022-09-06 --- src/tabviews/subtable/index.jsx | 43 +++++++++++++++++++++---------------------- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index b5fa826..bc460d3 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -46,7 +46,7 @@ searchlist: null, // 鎼滅储鏉′欢 actions: null, // 鎸夐挳闆� columns: null, // 鏄剧ず鍒� - arr_field: '', // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆� + arr_field: '', // 鏌ヨ瀛楁闆� setting: null, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 data: [], // 鍒楄〃鏁版嵁闆� selectedData: [], // 宸查�夎〃鏍兼暟鎹� @@ -133,7 +133,7 @@ config = updateSubTable(config) // 鏉冮檺杩囨护 - if (this.props.menuType !== 'HS') { + if (!window.GLOB.mkHS) { config.action = config.action.filter(item => item.hidden !== 'true' && permAction[item.uuid]) } else { config.action = config.action.filter(item => item.hidden !== 'true') @@ -186,6 +186,15 @@ col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' } else { col.linkThdMenu = '' + } + + if (col.type === 'number') { + col.decimal = col.decimal || 0 + col.round = Math.pow(10, col.decimal) + + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } } col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� @@ -251,6 +260,7 @@ } } if (item.position === 'toolbar') { + item.$toolbtn = true _actions.push(item) } else if (item.position === 'grid') { _operations.push(item) @@ -301,7 +311,6 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -310,8 +319,7 @@ let regs = [ { reg: /@userName@/ig, value: `'${userName}'` }, - { reg: /@fullName@/ig, value: `'${fullName}'` }, - { reg: /@login_city@/ig, value: `'${city}'` } + { reg: /@fullName@/ig, value: `'${fullName}'` } ] regs.forEach(cell => { @@ -431,7 +439,7 @@ loadOutResource = (searches) => { const { setting, BID } = this.state - let param = UtilsDM.getPrevQueryParams(setting, searches, BID, this.props.menuType) + let param = UtilsDM.getPrevQueryParams(setting, searches, BID) if (setting.execType === 'sync') { this.setState({ @@ -545,15 +553,7 @@ `)) sql = sql.join('') - param = UtilsDM.getCallBackQueryParams(setting, sql, errSql) - - if (BID) { - param.BID = BID - } - - if (this.props.menuType === 'HS') { // 鍑芥暟 sPC_TableData_InUpDe 浜戠楠岃瘉 - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) - } + param = UtilsDM.getCallBackQueryParams(setting, sql, errSql, BID) } else { param.func = 's_ex_result_back' param.s_ex_result = lines.map((item, index) => ({ @@ -612,7 +612,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) @@ -692,7 +692,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) { @@ -761,7 +761,7 @@ if (statFields.length === 0 || !(setting.interType === 'system' || (setting.interType === 'custom' && setting.requestMode === 'system')) || !setting.dataresource) return let _orderBy = orderBy || setting.order - let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID, this.props.menuType) + let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID) Api.genericInterface(param).then(res => { if (res.status) { @@ -851,7 +851,7 @@ /** * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁� */ - queryModuleParam = (menuId, btnId) => { + queryModuleParam = (menuId, callback) => { const { Tab, mainSearch, MenuID } = this.props const { arr_field, orderBy, search, setting} = this.state @@ -862,7 +862,7 @@ searches = [...mainSearch, ...search] } - MKEmitter.emit('returnModuleParam', MenuID, btnId, { + callback({ arr_field: arr_field, orderBy: orderBy || setting.order, search: searches, @@ -1000,7 +1000,7 @@ <div className="subtable" id={'subtable' + this.props.MenuID}> {loadingview && <Spin />} {searchlist && searchlist.length ? - <SubSearch BID={BID} setting={setting} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null + <SubSearch BID={BID} setting={setting} searchlist={searchlist} refreshdata={this.refreshbysearch}/> : null } {config && config.charts ? <Row className="chart-view" gutter={16}> {/* 瑙嗗浘缁� */} @@ -1131,7 +1131,6 @@ const mapStateToProps = (state) => { return { - menuType: state.editLevel, permAction: state.permAction, permMenus: state.permMenus, } -- Gitblit v1.8.0