From 5ea9708d117848491f0bf4e3f0300f7abb6458d4 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Wed, 24 Aug 2022 17:48:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gird/main.css | 2 -- src/components/gird/main.js | 31 ++++++++++++++----------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/components/gird/main.css b/src/components/gird/main.css index e7f24c84..a752857c 100644 --- a/src/components/gird/main.css +++ b/src/components/gird/main.css @@ -159,8 +159,6 @@ opacity: 1; width: 100%; height: 100px; - display: flex !important ; - justify-content: center; } .grid-loading.show .loading-bar { diff --git a/src/components/gird/main.js b/src/components/gird/main.js index 7e5875a9..d128ed0f 100644 --- a/src/components/gird/main.js +++ b/src/components/gird/main.js @@ -135,7 +135,7 @@ export default class menu extends React.Component { indeterminate: false, pageNum: 0, pageCount: props.dataCount, - pageLoading: true, + pageLoading: false, editShow: false, postion: null, historyrow_id: null, @@ -199,11 +199,9 @@ export default class menu extends React.Component { this.setState({ tableData: tabledata }) } - gridPageLoads() { - let clr = null - if (clr) clearTimeout(clr) + gridPageLoad() { this.setState({ pageLoading: true }) - clr = setTimeout(() => { + setTimeout(() => { this.setState({ pageLoading: false }) }, 800) } @@ -278,7 +276,6 @@ export default class menu extends React.Component { this.setState({ page: nextProps.page, emptyText: nextProps.emptyText }) this.setState({ dataCount: nextProps.dataCount }) this.scrollPosition() - this.gridPageLoads() } } @@ -315,9 +312,7 @@ export default class menu extends React.Component { this.props.countChange(e) this.setState({ pageCount: e }) } - gridPageLoad(flag) { - this.setState({ pageLoading: flag }) - } + pageShow(e) {} gridEditChange(e) {} getSelectData() { @@ -404,14 +399,13 @@ export default class menu extends React.Component { })}{' '} - +
+
+
数据加载中,请耐心等待
+
@@ -570,14 +564,17 @@ export default class menu extends React.Component { count: this.props.dataCount }} onPrevClick={(e) => { + this.gridPageLoad() this.props.pageChange(e) }} page={this.props.page} pageFn={(e) => this.setState({ page: e })} onNextClick={(e) => { + this.gridPageLoad() this.props.pageChange(e) }} onJumpPage={(e) => { + this.gridPageLoad() this.props.pageChange(e) }} onCountChange={(e) => {