Commit 0b1fad65 authored by krysent's avatar krysent

timeout

parent e3673625
......@@ -22,10 +22,11 @@ import { message } from "antd";
const { NODE_ENV } = process.env;
const websocketUrl =
NODE_ENV == "development"
? "http://192.168.40.41:7001" : 'http://192.168.40.41:7001'
// : `${window.location.protocol == "http:" ? "ws" : "wss"}://${
// window.location.host
// }`;
? "http://192.168.40.41:7001"
: "http://192.168.40.41:7001";
// : `${window.location.protocol == "http:" ? "ws" : "wss"}://${
// window.location.host
// }`;
let socket;
export default (second) => {
const ref = useRef(null);
......@@ -63,7 +64,6 @@ export default (second) => {
console.log("socketIO", data);
setsocketType(data?.wsMsgModel);
});
}, []);
useAsyncEffect(() => {
if (!isFullscreen) {
......@@ -169,39 +169,41 @@ export default (second) => {
});
useEffect(() => {
switch (socketType) {
case "INDEX_BOARD_INSTORE":
InstoreDataFetch.run();
break;
case "INDEX_BOARD_OUTSTORE":
OutstoreDataFetch.run();
break;
case "INDEX_BOARD_MONITOR":
queryMonitorFetch.run();
break;
case "INDEX_BOARD_STORE":
queryStoreFetch.run();
break;
case "INDEX_BOARD_INVENTORYSTATISTICS":
StationStatisticsFetch.run();
break;
case "INDEX_BOARD_INOUTSTORENUM":
InOutstoreNumFetch.run();
break;
case "INDEX_BOARD_INOUTSTOREWEIGHT":
InOutstoreWeightFetch.run();
break;
case "INDEX_BOARD_REALITYWEIGHT":
RealityWeightFetch.run();
break;
default:
return;
}
setTimeout(() => {
switch (socketType) {
case "INDEX_BOARD_INSTORE":
InstoreDataFetch.run();
break;
case "INDEX_BOARD_OUTSTORE":
OutstoreDataFetch.run();
break;
case "INDEX_BOARD_MONITOR":
queryMonitorFetch.run();
break;
case "INDEX_BOARD_STORE":
queryStoreFetch.run();
break;
case "INDEX_BOARD_INVENTORYSTATISTICS":
StationStatisticsFetch.run();
break;
case "INDEX_BOARD_INOUTSTORENUM":
InOutstoreNumFetch.run();
break;
case "INDEX_BOARD_INOUTSTOREWEIGHT":
InOutstoreWeightFetch.run();
break;
case "INDEX_BOARD_REALITYWEIGHT":
RealityWeightFetch.run();
break;
default:
return;
}
}, 1000);
}, [socketType]);
return (
<>
<div key={common} className="kb-container" ref={ref}>
<div key={common} className="kb-container" ref={ref}>
<header>
<div className="kb-time">
<Clock />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment