自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-11-17 90ffa7515c367e9be9a2c41e954757898ad2df94
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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() {
    getDate();
    $('#bar-year').text(year);
    $('#bar-month').text(month);
    $('#bar-day').text(day);
    $('#bar-hour').text(hour);
    $('#bar-minute').text(minute);
    $('#bar-second').text(second);
    $('#bar-week').text(week);
}
 
/**
 * 获取时间
 */
function getDate() {
    http.get(baseUrl+"/monitor/date", null, function (res) {
        if (res.code === 200){
            year = res.data.year;
            month = res.data.month;
            day = res.data.day;
            hour = res.data.hour;
            minute = res.data.minute;
            second = res.data.second;
            week = res.data.week;
        } else if (res.code === 403){
            parent.location.href = baseUrl+"/login";
        }  else {
            layer.msg("连接服务器失败", {icon: 2});
        }
    })
 
}
 
/**
 * 获取其他数据
 */
function getOther() {
    http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId")}, function (res) {
        if (res.code === 200){
 
            $('#totalLoc').text(res.data.totalLoc);
            $('#totalWrk').text(res.data.totalWrk);
 
            $('#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});
        }
    })
 
}