#
luxiaotao1123
2020-11-18 dfd17535bff020595da0f7b98a9d12cf5318a8e6
src/main/webapp/views/monitor/js/monitor.js
@@ -7,7 +7,10 @@
var week = '星期一';
setInterval(function () {
    getOther();
    setDate();
    initlinChart();
    initPieChart();
}, 1000);
function setDate() {
@@ -42,3 +45,30 @@
    })
}
/**
 * 获取其他数据
 */
function getOther() {
    http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId")}, 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);
            $('#xSpeed').text(res.data.xSpeed);
            $('#ySpeed').text(res.data.ySpeed);
            // 计数动画
            $('.counter').countUp();
        } else if (res.code === 403){
            parent.location.href = baseUrl+"/login";
        }  else {
            layer.msg("连接服务器失败", {icon: 2});
        }
    })
}