修复keys查询bug以及grid

This commit is contained in:
wangsongsole 2022-08-24 16:44:20 +08:00
parent f72ee90688
commit 1510ce8664
2 changed files with 20 additions and 13 deletions

View File

@ -199,6 +199,15 @@ export default class menu extends React.Component {
this.setState({ tableData: tabledata })
}
gridPageLoads() {
let clr = null
if (clr) clearTimeout(clr)
this.setState({ pageLoading: true })
clr = setTimeout(() => {
this.setState({ pageLoading: false })
}, 800)
}
checkChange(index, e) {
this.state.tableData[index].checked = e.target.checked
this.setState({
@ -264,11 +273,12 @@ export default class menu extends React.Component {
componentWillReceiveProps(nextProps) {
if (this.state.tableData != nextProps.tableData) {
this.setState({ tableData: nextProps.tableData ,pageLoading:false})
this.setState({ tableData: nextProps.tableData })
this.setState({ page: nextProps.page })
this.setState({ page: nextProps.page, emptyText: nextProps.emptyText })
this.setState({ dataCount: nextProps.dataCount })
this.scrollPosition()
this.gridPageLoads()
}
}
@ -319,7 +329,6 @@ export default class menu extends React.Component {
}
rowItemClick(index) {
console.log(index)
this.setState({ curIndex: index })
}

View File

@ -1,4 +1,4 @@
import React, { useRef,useEffect } from 'react'
import React, { useRef, useEffect } from 'react'
import { useUpdateEffect, useSetState } from 'ahooks'
import { getNowTime } from '@/utils.js'
@ -188,7 +188,7 @@ const UseKeyList = () => {
* 获取表格
*/
const getTable = () => {
plan_list_el.current.gridPageLoad(true);
plan_list_el.current.gridPageLoad(true)
const param = getParam()
getKeysList(param).then((res) => {
handelResponse(
@ -213,12 +213,9 @@ const UseKeyList = () => {
getTable()
}, [state.isQuery])
useEffect(()=>{
plan_list_el.current.gridPageLoad(false);
return ()=>{//
}
}, []);
useEffect(() => {
plan_list_el.current.gridPageLoad(false)
}, [])
/**
* 获取查询值
*/
@ -250,7 +247,8 @@ const UseKeyList = () => {
limit: 10,
hash: '',
tableData: [],
lodgingTable: false
lodgingTable: false,
dataCount: 0
})
}
@ -259,7 +257,7 @@ const UseKeyList = () => {
*/
const clearSelectTableBtn = () => {
plan_list_el.current.allChecked(false)
plan_list_el.current.gridPageLoad(false);
plan_list_el.current.gridPageLoad(false)
setState({ selectTable: [] })
}