#
zjj
2024-04-23 01a2d01abeadef5488a100ddf58a22dbcf7b95d6
src/main/webapp/views/monitor/js/monitor.js
@@ -12,9 +12,9 @@
    initPieChart();
}, 1000);
setInterval(function () {
    getOther();
}, 500);
//setInterval(function () {
//    getOther();
//}, 500);
function setDate() {
    getDate();
@@ -53,7 +53,48 @@
 * 获取其他数据
 */
function getOther() {
    http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId")}, function (res) {
    http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId"), ledId: getUrlVal("ledId")}, function (res) {
        if (res.code === 200){
            // 左
            $('#xDistance').text(res.data.xDistance);
            $('#yDistance').text(res.data.yDistance);
            $('#xDuration').text(res.data.xDuration);
            $('#yDuration').text(res.data.yDuration);
            // 中上
            crnChartOption.series[0].data[0].value = res.data.xSpeed - 0; // 走行
            crnChartOption.series[1].data[0].value = res.data.ySpeed - 0; // 升降
            crnChartOption.series[2].data[0].value = res.data.zSpeed - 0; // 叉牙
            crnChartOption.series[3].data[0].value = res.data.forkPos - 0; // 货叉位置
            // crnChartOption.series[0].data[0].value = (Math.random()*100).toFixed(2) - 0;
            // crnChartOption.series[1].data[0].value = (Math.random()*7).toFixed(2) - 0;
            // crnChartOption.series[2].data[0].value = (Math.random()*2).toFixed(2) - 0;
            // crnChartOption.series[3].data[0].value = (Math.random()*2).toFixed(2) - 0;
            crnChart.setOption(crnChartOption);
            // 中下
            if (res.data.isShow) {
                $('#banner').hide();
                $('#led-content').show();
                $('#led-p-content').text(res.data.content);
            } else {
                $('#led-content').hide();
                $('#banner').show();
                $('#led-p-content').text("");
            }
        } else if (res.code === 403){
            parent.location.href = baseUrl+"/login";
        }  else {
            layer.msg("连接服务器失败", {icon: 2});
        }
    })
}
function getOther2(crnId,ledId) {
    http.get(baseUrl+"/monitor/other", {crnId: crnId, ledId: ledId}, function (res) {
        if (res.code === 200){
            // 左