This commit is contained in:
wangsongsole 2022-08-24 17:48:04 +08:00
parent 1510ce8664
commit 5ea9708d11
2 changed files with 14 additions and 19 deletions

View File

@ -159,8 +159,6 @@
opacity: 1; opacity: 1;
width: 100%; width: 100%;
height: 100px; height: 100px;
display: flex !important ;
justify-content: center;
} }
.grid-loading.show .loading-bar { .grid-loading.show .loading-bar {

View File

@ -135,7 +135,7 @@ export default class menu extends React.Component {
indeterminate: false, indeterminate: false,
pageNum: 0, pageNum: 0,
pageCount: props.dataCount, pageCount: props.dataCount,
pageLoading: true, pageLoading: false,
editShow: false, editShow: false,
postion: null, postion: null,
historyrow_id: null, historyrow_id: null,
@ -199,11 +199,9 @@ export default class menu extends React.Component {
this.setState({ tableData: tabledata }) this.setState({ tableData: tabledata })
} }
gridPageLoads() { gridPageLoad() {
let clr = null
if (clr) clearTimeout(clr)
this.setState({ pageLoading: true }) this.setState({ pageLoading: true })
clr = setTimeout(() => { setTimeout(() => {
this.setState({ pageLoading: false }) this.setState({ pageLoading: false })
}, 800) }, 800)
} }
@ -278,7 +276,6 @@ export default class menu extends React.Component {
this.setState({ page: nextProps.page, emptyText: nextProps.emptyText }) this.setState({ page: nextProps.page, emptyText: nextProps.emptyText })
this.setState({ dataCount: nextProps.dataCount }) this.setState({ dataCount: nextProps.dataCount })
this.scrollPosition() this.scrollPosition()
this.gridPageLoads()
} }
} }
@ -315,9 +312,7 @@ export default class menu extends React.Component {
this.props.countChange(e) this.props.countChange(e)
this.setState({ pageCount: e }) this.setState({ pageCount: e })
} }
gridPageLoad(flag) {
this.setState({ pageLoading: flag })
}
pageShow(e) {} pageShow(e) {}
gridEditChange(e) {} gridEditChange(e) {}
getSelectData() { getSelectData() {
@ -404,14 +399,13 @@ export default class menu extends React.Component {
})}{' '} })}{' '}
</div> </div>
<InlineLoading <div
loading={this.state.pageLoading} className={
iconSize={16} this.state.pageLoading ? 'grid-loading show' : 'grid-loading'
textSize={14} }>
icon='circle' <div className='loading-bar'></div>
className='grid-loading show' <div className='loading-txt'>数据加载中,请耐心等待</div>
iconText='数据加载中,请耐心等待' </div>
/>
<div <div
className={this.state.pageLoading ? 'th-body hide' : 'th-body'} className={this.state.pageLoading ? 'th-body hide' : 'th-body'}
style={{ maxHeight: this.props.maxheight + 'px' }}> style={{ maxHeight: this.props.maxheight + 'px' }}>
@ -570,14 +564,17 @@ export default class menu extends React.Component {
count: this.props.dataCount count: this.props.dataCount
}} }}
onPrevClick={(e) => { onPrevClick={(e) => {
this.gridPageLoad()
this.props.pageChange(e) this.props.pageChange(e)
}} }}
page={this.props.page} page={this.props.page}
pageFn={(e) => this.setState({ page: e })} pageFn={(e) => this.setState({ page: e })}
onNextClick={(e) => { onNextClick={(e) => {
this.gridPageLoad()
this.props.pageChange(e) this.props.pageChange(e)
}} }}
onJumpPage={(e) => { onJumpPage={(e) => {
this.gridPageLoad()
this.props.pageChange(e) this.props.pageChange(e)
}} }}
onCountChange={(e) => { onCountChange={(e) => {