Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/visual/modules/bigScreen_equipmentCondition2.jsp

378 lines
15 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="com.sipai.entity.base.ServerObject"%>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
<%@page import="com.sipai.entity.visual.JspElement"%>
<%request.setAttribute("Type_GetValue", JspElement.Type_GetValue); %>
<%request.setAttribute("Type_Get7dayHistory", JspElement.Type_GetHourHistory); %>
<%request.setAttribute("Type_Get7dayHistory", JspElement.Type_Get7dayHistory); %>
<%request.setAttribute("Type_GetModbus", JspElement.Type_GetModbus); %>
<%request.setAttribute("Type_GetHttp", JspElement.Type_GetHttp); %>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title></title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
//获取url地址根目录 当前taomcat下路径
function getRootPath(){
var pathName = window.location.pathname.substring(1);
// var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
return window.location.protocol + '//' + window.location.host;
}
//获取url地址根目录 当前taomcat下路径
function getRootPath2(){
var pathName = window.location.pathname.substring(1);
var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
return window.location.protocol + '//' + window.location.host +"/"+webName;
}
function numOutput(num){
var numpart=String(num).split(".");//将数字通过jq split用小数点分隔为数组对象
numpart[0]=numpart[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)','ig'),"$1,");
//将数组对象第一个数据(整数部分)通过正则表达式每三位用逗号分隔
return numpart.join(".");//把数组通过join方法用.进行拼接
}
/* 请求数据 */
function getValue() {
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
// console.log(data);
if(data!=''){
var eqTypedata =[];
for(var i=0;i<data.length;i++){
if(data[i].elementCode=="totalEqNum"){
$('#totalEqNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
}else if(data[i].elementCode=="usingTotalEqNum"){
$('#usingTotalEqNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
}else if(data[i].elementCode=="AEqNum"){
$('#AEqNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
eqTypedata.push({
name:'A类设备数量',
value:(data[i].visualCacheData.value).toFixed(0)
})
}else if(data[i].elementCode=="BEqNum"){
$('#BEqNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
eqTypedata.push({
name:'B类设备数量',
value:(data[i].visualCacheData.value).toFixed(0)
})
}else if(data[i].elementCode=="CEqNum"){
$('#CEqNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
eqTypedata.push({
name:'C类设备数量',
value:(data[i].visualCacheData.value).toFixed(0)
})
}else if(data[i].elementCode=="eqCompletionRate"){
dochart('chart1',(data[i].visualCacheData.value).toFixed(0),'设备完好率','#FFE538');
}else if(data[i].elementCode=="maintainCompletionRate"){
dochart('chart2',(data[i].visualCacheData.value).toFixed(0),'保养完成率','#3883FF');
}else if(data[i].elementCode=="repairCompletionRate"){
dochart('chart3',(data[i].visualCacheData.value).toFixed(0),'维修完成率','#3883FF');
}
}
}
doequtype("chart4",eqTypedata);
}, 'json');
}
function dochart(id,value,title,color){
var myChart = echarts.init(document.getElementById(id));
var option = {
title: {
text: value+"%",
textStyle: {
color: '#3883FF',
fontSize: 26
},
subtext: title,
subtextStyle: {
color: '#E0E1E1',
fontSize: 14
},
itemGap: 5, // 主副标题距离
left: 'center',
top: 'center'
},
angleAxis: {
max: 100, // 满分
clockwise: true, // 逆时针
// 隐藏刻度线
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
radiusAxis: {
type: 'category',
// 隐藏刻度线
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
polar: {
center: ['50%', '50%'],
radius: '150%' //图形大小
},
series: [{
type: 'bar',
data: [{
name: '百分比',
value: value,
itemStyle: {
color: color
},
}],
coordinateSystem: 'polar',
roundCap: true,
barWidth: 15,
barGap: '-100%', // 两环重叠
z: 2
},{ // 灰色环
type: 'bar',
data: [{
value: 100,
itemStyle: {
color: '#2B3F69',
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 5,
shadowOffsetY: 2
}
}],
coordinateSystem: 'polar',
roundCap: true,
barWidth: 18,
barGap: '-100%', // 两环重叠
z: 1
}]
};
myChart.setOption(option, true);
}
//设备类型pie
function doequtype(id,val){
const colorList = ['#3883FF', '#A84ECB', '#FE8840'];
var data = val;
var legendName = new Array;
data.forEach(function(value,i){
legendName[i] = value.name;
});
var myChart = echarts.init(document.getElementById(id));
var option = {
title: {
text: '设备',
textStyle: {
fontSize: 17,
color: '#61798F',
lineHeight: 24
},
subtextStyle: {
fontSize: 28,
color: '#333'
},
textAlign: 'center',
left: '48%',
top: '41%'
},
grid: {
top:0,
left:0,
right:0,
bottom:0,
},
tooltip: {
trigger: 'item',
},
// legend: {
// type: 'scroll',
// orient: 'vertical',
// right: 20,
// top: '20%',
// itemGap: 10,
// selectedMode: false,
// data: legendName,
// textStyle: {
// rich: {
// uname: {
// fontSize: 14,
// color: '#61798F',
// },
// unum: {
// fontSize: 20,
// color: '#FFFFFF',
// }
// }
// }
// // formatter(name) {
// // var index = 0;
// // data.forEach(function(value,i){
// // if(value.name == name){
// // index = i;
// // }
// // });
// // var value = data[index].value;
// // return ' {uname|'+name+'}{unum|'+value+'}';
// // }
// },
color: colorList,
series: [
{
name: '设备',
type: 'pie',
radius: ['60%', '85%'],
center: ['50%', '50%'],
label: {
show: false
},
labelLine: {
show: false
},
itemStyle: {
borderWidth: 3,
borderColor: '#0D436A'
},
data: data,
}
]
};
myChart.clear();
myChart.setOption(option, true);
}
/* 定时器 */
//setInterval(change, 60000); //每1分钟切换
setInterval(getValue, 3600000); //每一小时切换
/* 初始化 */
$(function () {
if('${param.backgroundColor}'=='transparent'){
document.body.style.backgroundColor = '${param.backgroundColor}';
}else{
document.body.style.backgroundColor = "#" + '${param.backgroundColor}';
}
document.getElementById("main").style.width = document.documentElement.clientWidth + "px";
document.getElementById("main").style.height = (document.documentElement.clientHeight) + "px";
document.getElementById("backImage").src = ""+getRootPath()+"/images/大屏/设备情况.png";
getValue();
//console.log("height",document.body.scrollHeight);
});
</script>
</head>
<body style="width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:hidden;">
<div id="main" style="height:100%;width:100%;padding-left:30px;padding-right:30px;padding-bottom:30px;">
<div style="height:100%;width:100%;background:#16314C;border-radius: 8px;">
<div style="float:left;width:100%;height:80px;"><img id="backImage" src="" style="z-index:999;position:relative;height:100%;width: 25%;"/></div>
<div style="float:left;width:100%;height:calc((100% - 80px)/2);">
<div style="float:left;width:23%;height:100%;padding-left:35px;padding-top:30px;">
<table style="width: 185px;height:102px;background: linear-gradient(134deg,#3023ae, #c86dd7 102%);border-radius: 18px;text-align: center;vertical-align: middle;">
<tr height="70%">
<td id="totalEqNum" width="100%" style="color: #ffffff;font-size:36px;"></td>
</tr>
<tr height="30%">
<td width="100%" style="color: #ffffff;font-size:16px;vertical-align:top;">总设备数量</td>
</tr>
</table>
</div>
<div style="float:left;width:23%;height:100%;padding-left:35px;padding-top:30px;">
<table style="width: 185px;height:102px;background: linear-gradient(50deg,#427dfe 15%, #74d6ff 104%);border-radius: 18px;text-align: center;vertical-align: middle;">
<tr height="70%">
<td id="usingTotalEqNum" width="100%" style="color: #ffffff;font-size:36px;"></td>
</tr>
<tr height="30%">
<td width="100%" style="color: #ffffff;font-size:16px;vertical-align:top;">投运设备数量</td>
</tr>
</table>
</div>
<div style="float:left;width:18%;height:100%;">
<div id="chart1" style="width: 100%;height: 100%;"></div>
</div>
<div style="float:left;width:18%;height:100%;">
<div id="chart2" style="width: 100%;height: 100%;"></div>
</div>
<div style="float:left;width:18%;height:100%;">
<div id="chart3" style="width: 100%;height: 100%;"></div>
</div>
</div>
<div style="float:left;width:100%;height:calc((100% - 80px)/2);">
<div style="float:left;width:40%;height:100%;">
<div id="chart4" style="width: 100%;height: 100%;"></div>
</div>
<div style="float:left;width:20%;height:100%;">
<table style="width: 100%;height:100%;text-align: left;vertical-align: middle;">
<tr height="20%">
<td width="100%" ><div style="width:52px;height:24px;background: #3883FF;border-radius: 8px;"></div></td>
</tr>
<tr height="30%">
<td width="100%" style="color: #ffffff;font-size:24px;">A类设备数量</td>
</tr>
<tr height="50%">
<td id="AEqNum" width="100%" style="color: #ffffff;font-size:34px;vertical-align:top;"></td>
</tr>
</table>
</div>
<div style="float:left;width:20%;height:100%;">
<table style="width: 100%;height:100%;text-align: left;vertical-align: middle;">
<tr height="20%">
<td width="100%" ><div style="width:52px;height:24px;background: #A84ECB;border-radius: 8px;"></div></td>
</tr>
<tr height="30%">
<td width="100%" style="color: #ffffff;font-size:24px;">B类设备数量</td>
</tr>
<tr height="50%">
<td id="BEqNum" width="100%" style="color: #ffffff;font-size:34px;vertical-align:top;"></td>
</tr>
</table>
</div>
<div style="float:left;width:20%;height:100%;">
<table style="width: 100%;height:100%;text-align: left;vertical-align: middle;">
<tr height="20%">
<td width="100%" ><div style="width:52px;height:24px;background: #FE8840;border-radius: 8px;"></div></td>
</tr>
<tr height="30%">
<td width="100%" style="color: #ffffff;font-size:24px;">C类设备数量</td>
</tr>
<tr height="50%">
<td id="CEqNum" width="100%" style="color: #ffffff;font-size:34px;vertical-align:top;"></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
</html>