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});
|
}
|
})
|
|
}
|