From 6ccc1544c820081851f76a6b13435655d57e5641 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Wed, 17 Nov 2021 14:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 4 ++-- src/components/gird/main.js | 3 ++- src/pages/exchangecode/list/list.js | 14 ++++++++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 75b5703d..e8185752 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -2,7 +2,7 @@ export const baseurl = 'http://market.api.system.com' // 通用公用方法(get和post) const req = (method, url, params, responseType) => { - var obj=null; + var obj = null; if (method == "get") { if (params) { let paramsArray = []; @@ -24,7 +24,7 @@ const req = (method, url, params, responseType) => { }) } } - let http = fetch(url,obj).then(res => res.json()); + let http = fetch(url, obj).then(res => res.json()); return http.then(response => response).catch(error => console.error('Error:', error)); } diff --git a/src/components/gird/main.js b/src/components/gird/main.js index 1d7682d8..ce8bffc3 100644 --- a/src/components/gird/main.js +++ b/src/components/gird/main.js @@ -143,6 +143,7 @@ export default class menu extends React.Component { allChecked: false, tableData: props.tableData, Column: props.Column, + dataTotal:props.dataTotal, indeterminate: false, pageNum:0, pageCount:props.dataCount, @@ -559,7 +560,7 @@ export default class menu extends React.Component {
{ - // const - console.log('err',res); + const codeList_data=res.data.data; + const {total}=res.data; + _self.setState({codeList:codeList_data}); + _self.setState({total:8}); }).catch(err=>{ console.log('err',err); }); @@ -237,6 +241,8 @@ componentWillMount(){ maxheight={this.state.tableHeight} countbarVisible={false} isSwitch={false} + + dataCount={this.state.total} isMultiple={false} pageChange={(e)=>{ this.pageChange(e)