#
luxiaotao1123
2020-11-18 dfd17535bff020595da0f7b98a9d12cf5318a8e6
src/main/webapp/views/monitor/js/monitor.js
@@ -1,13 +1,16 @@
var year = null;
var month = null;
var day = null;
var hour = null;
var minute = null;
var second = null;
var week = null;
var year = '2020';
var month = '05';
var day = '01';
var hour = '08';
var minute = '00';
var second = '00';
var week = '星期一';
setInterval(function () {
    getOther();
    setDate();
    initlinChart();
    initPieChart();
}, 1000);
function setDate() {
@@ -43,4 +46,29 @@
}
getDate();
/**
 * 获取其他数据
 */
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});
        }
    })
}