|
@ -63,7 +63,6 @@ function Index (props) { |
|
|
const mainColor = "rgb(249,179,45)" |
|
|
const mainColor = "rgb(249,179,45)" |
|
|
if (type == 'xy') { |
|
|
if (type == 'xy') { |
|
|
// xy 视图
|
|
|
// xy 视图
|
|
|
console.log(xyCvs, xyCvs.current, canvasHeight); |
|
|
|
|
|
const xyCtx = xyCvs.current.getContext("2d"); |
|
|
const xyCtx = xyCvs.current.getContext("2d"); |
|
|
xyCvs.current.height = canvasHeight |
|
|
xyCvs.current.height = canvasHeight |
|
|
xyCvs.current.width = canvasWidth |
|
|
xyCvs.current.width = canvasWidth |
|
@ -434,13 +433,12 @@ function Index (props) { |
|
|
dispatch(getCrane()) |
|
|
dispatch(getCrane()) |
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|
|
|
|
const root = window.FS_API_ROOT |
|
|
ws = new WebSocket(`ws://10.8.30.183:4100/${ApiTable.dataLive}`); //建立websocket连接
|
|
|
ws = new WebSocket(`${root.replace('http', 'ws')}/${ApiTable.dataLive}`); //建立websocket连接
|
|
|
ws.onopen = function (e) { |
|
|
ws.onopen = function (e) { |
|
|
console.log("websocket 连接成功"); |
|
|
|
|
|
interval = setInterval(() => { |
|
|
interval = setInterval(() => { |
|
|
// console.log("发送心跳保持长连接不超时断开");
|
|
|
// console.log("发送心跳保持长连接不超时断开");
|
|
|
this.send(JSON.stringify({ "act": "ma_get_active_devices" })); |
|
|
this.send(JSON.stringify({ "act": "long_live" })); |
|
|
}, 20000);//20秒一次
|
|
|
}, 20000);//20秒一次
|
|
|
} |
|
|
} |
|
|
ws.onerror = e => { |
|
|
ws.onerror = e => { |
|
@ -448,7 +446,6 @@ function Index (props) { |
|
|
} |
|
|
} |
|
|
ws.onmessage = evt => { |
|
|
ws.onmessage = evt => { |
|
|
let msg = JSON.parse(evt.data); |
|
|
let msg = JSON.parse(evt.data); |
|
|
console.log(msg); |
|
|
|
|
|
|
|
|
|
|
|
if (msg) { |
|
|
if (msg) { |
|
|
setCraneParams(msg) |
|
|
setCraneParams(msg) |
|
@ -464,7 +461,6 @@ function Index (props) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, []) |
|
|
}, []) |
|
|
console.log(darkColor, darkModde ? darkColor.textColor : 'auto'); |
|
|
|
|
|
|
|
|
|
|
|
const cardStyle = { |
|
|
const cardStyle = { |
|
|
boxShadow: `0 0 10px ${darkModde ? darkColor.shadow : 'rgba(0, 0, 0, 0.2)'}`, |
|
|
boxShadow: `0 0 10px ${darkModde ? darkColor.shadow : 'rgba(0, 0, 0, 0.2)'}`, |
|
|