|
|
|
|
@ -30,6 +30,17 @@
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#chartDivs {
|
|
|
|
|
height: calc(100vh - 4.2vw - 0.8vw - 15px);
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#chartDivs::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container-div {
|
|
|
|
|
height: calc(100vh - 5vw);
|
|
|
|
|
}
|
|
|
|
|
@ -265,7 +276,18 @@
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: 0;
|
|
|
|
|
border-radius: inherit;
|
|
|
|
|
background: linear-gradient(90deg, #f6c343, #ffd86b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .temperature-progress-bar.temp-green {
|
|
|
|
|
background: linear-gradient(90deg, #27ae60, #2ecc71);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .temperature-progress-bar.temp-yellow {
|
|
|
|
|
background: linear-gradient(90deg, #f39c12, #f6c343);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .temperature-progress-bar.temp-red {
|
|
|
|
|
background: linear-gradient(90deg, #e74c3c, #c0392b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .mileage .num {
|
|
|
|
|
@ -408,6 +430,20 @@
|
|
|
|
|
return Math.max(0, Math.min(100, progress));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTemperatureBarClass(temperature) {
|
|
|
|
|
var temp = parseFloat(temperature);
|
|
|
|
|
if (isNaN(temp)) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
if (temp < 45) {
|
|
|
|
|
return "temp-green";
|
|
|
|
|
} else if (temp < 60) {
|
|
|
|
|
return "temp-yellow";
|
|
|
|
|
} else {
|
|
|
|
|
return "temp-red";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function renderMonitorCards(data) {
|
|
|
|
|
$("#chartDivs").html("");
|
|
|
|
|
data.forEach(function (v) {
|
|
|
|
|
@ -417,6 +453,7 @@
|
|
|
|
|
var maxTemperature = parseTemperature(v.illuminance);
|
|
|
|
|
var avgTemperature = parseTemperature(v.tempreture);
|
|
|
|
|
var progress = getTemperatureProgress(minTemperature, maxTemperature, avgTemperature);
|
|
|
|
|
var tempClass = getTemperatureBarClass(v.tempreture);
|
|
|
|
|
var html = ""
|
|
|
|
|
+ "<div class=\"chartDiv border\" style=\"background-image: url('" + cardImg + "');\">"
|
|
|
|
|
+ "<div class=\"title\">" + (v.monitorName || v.monitorId || "-") + "</div>"
|
|
|
|
|
@ -425,7 +462,7 @@
|
|
|
|
|
+ "<div class=\"card-info\">"
|
|
|
|
|
+ "<div class=\"temperature-min\">最低温度:" + formatValue(v.humidity) + "℃</div>"
|
|
|
|
|
+ "<div class=\"temperature-average\">" + formatValue(v.illuminance) + "<span class=\"unit\">℃</span></div>"
|
|
|
|
|
+ "<div class=\"temperature-progress\"><div class=\"temperature-progress-bar\" style=\"width: " + progress + "%;\"></div></div>"
|
|
|
|
|
+ "<div class=\"temperature-progress\"><div class=\"temperature-progress-bar " + tempClass + "\" style=\"width: " + progress + "%;\"></div></div>"
|
|
|
|
|
+ "<div class=\"temperature-max\">最高温度:" + formatValue(v.tempreture) + "℃</div>"
|
|
|
|
|
+ "</div>"
|
|
|
|
|
+ "</div>"
|
|
|
|
|
|