From 4d62306be71cef7d62059f07199426f96353c412 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 一月 2020 16:07:44 +0800 Subject: [PATCH] 2020-01-03 --- src/tabviews/subtable/index.jsx | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 3cdf45e..1923161 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -16,7 +16,7 @@ const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) -export default class NormalTable extends Component { +export default class SubTabViewTable extends Component { static propTpyes = { Tab: PropTypes.object, // 鏍囩淇℃伅 BID: PropTypes.string, // 涓婄骇鏁版嵁ID @@ -56,7 +56,7 @@ */ UNSAFE_componentWillReceiveProps(nextProps) { if (this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) { - this.loadmaindata() + this.loadmaindata(nextProps.BID, 'refresh') } } @@ -265,14 +265,19 @@ /** * @description 瀛愯〃鏁版嵁鍔犺浇 */ - async loadmaindata () { + async loadmaindata (bid, type) { const { setting } = this.state let param = '' + let _BID = this.props.BID + + if (type === 'refresh') { + _BID = bid + } if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { - param = this.getCustomParam() + param = this.getCustomParam(_BID) } else { - param = this.getDefaultParam() + param = this.getDefaultParam(_BID) } this.handleTableId('') @@ -302,7 +307,7 @@ /** * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙� */ - getCustomParam = () => { + getCustomParam = (BID) => { const { pageIndex, pageSize, orderColumn, orderType, search, setting } = this.state let _search = Utils.formatCustomMainSearch(search) @@ -312,6 +317,7 @@ PageSize: pageSize, OrderCol: orderColumn, OrderType: orderType, + BID: BID, ..._search } @@ -330,7 +336,7 @@ /** * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁� */ - getDefaultParam = () => { + getDefaultParam = (BID) => { const { arr_field, pageIndex, pageSize, orderColumn, orderType, search, setting } = this.state let _search = Utils.joinMainSearchkey(search) @@ -340,7 +346,7 @@ func: 'sPC_Get_TableData', obj_name: 'data', arr_field: arr_field, - BID: this.props.BID + BID: BID } let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order @@ -352,12 +358,12 @@ let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` let DateCount = `select count(1) as total from ${_dataresource} ${_search}` - + console.log(LText) param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) param.DateCount = Utils.formatOptions(DateCount) - + console.log(param) return param } -- Gitblit v1.8.0