自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-11-19 9fb00ee422c7e1b6bf3712d1fe192af9cdba5975
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
72
73
74
75
76
77
78
79
80
var year = '2020';
var month = '05';
var day = '01';
var hour = '08';
var minute = '00';
var second = '00';
var week = '星期一';
 
setInterval(function () {
    getOther();
    setDate();
    initlineChart();
    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){
 
            // 左
            $('#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);
 
        } else if (res.code === 403){
            parent.location.href = baseUrl+"/login";
        }  else {
            layer.msg("连接服务器失败", {icon: 2});
        }
    })
 
}