This commit is contained in:
Jay
2017-04-10 15:55:16 +08:00
parent 59331f9b1c
commit 5c02a34897
2 changed files with 17 additions and 0 deletions
@@ -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);
})
})
}