From a90dfa654f7c841c08a2bad1227a073d721f8af2 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Wed, 24 Aug 2022 18:10:02 +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.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/components/gird/main.js b/src/components/gird/main.js index 662bd117..e618a0bd 100644 --- a/src/components/gird/main.js +++ b/src/components/gird/main.js @@ -199,6 +199,13 @@ export default class menu extends React.Component { this.setState({ tableData: tabledata }) } + gridPageLoad() { + this.setState({ pageLoading: true }) + setTimeout(() => { + this.setState({ pageLoading: false }) + }, 800) + } + checkChange(index, e) { this.state.tableData[index].checked = e.target.checked this.setState({ @@ -268,10 +275,16 @@ export default class menu extends React.Component { this.setState({ page: nextProps.page }) this.setState({ page: nextProps.page, emptyText: nextProps.emptyText }) this.setState({ dataCount: nextProps.dataCount }) - this.gridPageLoad() + this.scrollPosition() } } + /* 重置grid滚动条 */ + scrollPosition() { + document.getElementById('grid').scrollLeft = 0 + document.getElementById('grid').scrollTop = 0 + } + onConfirm = () => {} onCancel = () => {} @@ -303,7 +316,7 @@ export default class menu extends React.Component { this.setState({ pageLoading: true }) setTimeout(() => { this.setState({ pageLoading: false }) - }, 800) + }, 500) } pageShow(e) {} gridEditChange(e) {} @@ -316,7 +329,6 @@ export default class menu extends React.Component { } rowItemClick(index) { console.log(index) - this.setState({ curIndex: index }) } @@ -392,14 +404,13 @@ export default class menu extends React.Component { })}{' '} - +
+
+
数据加载中,请耐心等待
+