update
This commit is contained in:
@@ -6,10 +6,18 @@ class LocStatusWloc extends React.Component {
|
||||
state = {
|
||||
loc: []
|
||||
}
|
||||
tick = null
|
||||
|
||||
componentDidMount() {
|
||||
this.getLocList();
|
||||
}
|
||||
componentWillUnmount(){
|
||||
clearInterval(this.tick);
|
||||
}
|
||||
|
||||
runTick = ()=>{
|
||||
this.getStatus();
|
||||
}
|
||||
|
||||
getLocList = ()=>{
|
||||
let {toggleLoading, showDialog} = this.props;
|
||||
@@ -23,6 +31,7 @@ class LocStatusWloc extends React.Component {
|
||||
loc: json.data.record || []
|
||||
}, ()=>{
|
||||
this.getStatus();
|
||||
this.tick = setInterval(this.runTick, 5000);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user