From bc4308e222af3e19f721a129ab132fb69909778e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 十二月 2020 18:01:52 +0800 Subject: [PATCH] 2020-12-23 --- src/tabviews/custom/components/share/normalTable/index.jsx | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index e377073..5d403fe 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -387,7 +387,8 @@ columns: null, // 鏄剧ず鍒� activeIndex: null, // 鏍囪褰撳墠閫変腑琛� rowspans: null, // 琛屽悎骞跺瓧娈典俊鎭� - pickup: false + pickup: false, // 鏀惰捣鏈�夋嫨椤� + orderfields: {} // 鎺掑簭id涓巉ield杞崲 } UNSAFE_componentWillMount () { @@ -395,6 +396,7 @@ let radio = 5 // 铏氬寲姣斾緥 let _format = false // 鏄惁铏氬寲澶勭悊 let rowspans = [] + let orderfields = {} if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) { _format = true @@ -424,7 +426,11 @@ if (item.marks && item.marks.length === 0) { item.marks = '' } - + + if (item.field) { + orderfields[item.uuid] = item.field + } + cell = { align: item.Align, dataIndex: item.uuid, @@ -453,7 +459,8 @@ this.setState({ columns: _columns, - rowspans + rowspans, + orderfields }) } @@ -606,6 +613,8 @@ } changeTable = (pagination, filters, sorter) => { + const { orderfields } = this.state + this.setState({ pageIndex: pagination.current, pageSize: pagination.pageSize, @@ -613,6 +622,9 @@ activeIndex: null, pickup: false }) + + sorter.field = orderfields[sorter.field] || '' + this.props.refreshdata(pagination, filters, sorter) } -- Gitblit v1.8.0