|
@ -11,6 +11,7 @@ const Lefttop = (props) => { |
|
|
const [mass, setMass] = useState() |
|
|
const [mass, setMass] = useState() |
|
|
const [speed, setspeed] = useState() |
|
|
const [speed, setspeed] = useState() |
|
|
const [traffic, setTraffic] = useState() |
|
|
const [traffic, setTraffic] = useState() |
|
|
|
|
|
const [tim, setTim] = useState() |
|
|
const [nums, setNums] = useState() |
|
|
const [nums, setNums] = useState() |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
const shuju = dispatch(getGodshuju()).then((res) => { |
|
|
const shuju = dispatch(getGodshuju()).then((res) => { |
|
@ -32,9 +33,14 @@ const Lefttop = (props) => { |
|
|
setNums(localStorage.getItem("num")) |
|
|
setNums(localStorage.getItem("num")) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, [tim]) |
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
const timer = setInterval(() => { |
|
|
|
|
|
setTim(new Date()) |
|
|
|
|
|
}, 300000); |
|
|
|
|
|
return () => clearInterval(timer); |
|
|
}, []) |
|
|
}, []) |
|
|
// console.log(mass);
|
|
|
// console.log(tim);
|
|
|
// console.log(nums);
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<Module style={style} title={"道路拥堵指数"} > |
|
|
<Module style={style} title={"道路拥堵指数"} > |
|
|