first commit
This commit is contained in:
246
WebRoot/jsp/visual/modules/bigScreen_patrolInspection.jsp
Normal file
246
WebRoot/jsp/visual/modules/bigScreen_patrolInspection.jsp
Normal file
@ -0,0 +1,246 @@
|
||||
<%@ 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!=''){
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i].elementCode=="patrolTaskNum"){
|
||||
$('#patrolTaskNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
|
||||
}else if(data[i].elementCode=="functionPatrolCompleteNum"){
|
||||
$('#functionPatrolCompleteNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
|
||||
}else if(data[i].elementCode=="functionPatrolTotalNum"){
|
||||
$('#functionPatrolTotalNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
|
||||
}else if(data[i].elementCode=="eqPatrolCompleteNum"){
|
||||
$('#eqPatrolCompleteNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
|
||||
}else if(data[i].elementCode=="eqPatrolTotalNum"){
|
||||
$('#eqPatrolTotalNum').text(numOutput((data[i].visualCacheData.value).toFixed(0)));
|
||||
}else if(data[i].elementCode=="functionPatrolCompletionRate"){
|
||||
dochart('chart1',(data[i].visualCacheData.value).toFixed(0),'运行巡检完成率','#EFA103');
|
||||
}else if(data[i].elementCode=="eqPatrolCompletionRate"){
|
||||
dochart('chart2',(data[i].visualCacheData.value).toFixed(0),'设备巡检完成率','#1890FF');
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function dochart(id,value,title,color){
|
||||
var myChart = echarts.init(document.getElementById(id));
|
||||
var option = {
|
||||
title: {
|
||||
text: value+"%",
|
||||
textStyle: {
|
||||
color: color,
|
||||
fontSize: 36
|
||||
},
|
||||
subtext: title,
|
||||
subtextStyle: {
|
||||
color: color,
|
||||
fontSize: 24
|
||||
},
|
||||
itemGap: 120, // 主副标题距离
|
||||
left: 'center',
|
||||
top: '35%'
|
||||
},
|
||||
angleAxis: {
|
||||
max: 100, // 满分
|
||||
clockwise: false, // 逆时针
|
||||
// 隐藏刻度线
|
||||
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%', '40%'],
|
||||
radius: '120%' //图形大小
|
||||
},
|
||||
series: [{
|
||||
type: 'bar',
|
||||
data: [{
|
||||
name: '百分比',
|
||||
value: value,
|
||||
itemStyle: {
|
||||
color: color
|
||||
},
|
||||
}],
|
||||
coordinateSystem: 'polar',
|
||||
roundCap: true,
|
||||
barWidth: 20,
|
||||
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: 25,
|
||||
barGap: '-100%', // 两环重叠
|
||||
z: 1
|
||||
}]
|
||||
};
|
||||
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:40%;height:calc(100% - 80px);">
|
||||
<div style="float:left;width:100%;height:50%;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="patrolTaskNum" 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:100%;height:50%;padding-left:35px;margin-top:-35px;">
|
||||
<table style="width:100%;height:100%;text-align: center;vertical-align: middle;">
|
||||
<tr height="15%">
|
||||
<td width="40%"></td>
|
||||
<td width="50%" style="position:relative;">
|
||||
<div style="position: absolute;top:30%;color: #82BDF3;font-size:24px;">
|
||||
<span id="functionPatrolCompleteNum"></span>
|
||||
<span>/</span>
|
||||
<span id="functionPatrolTotalNum"></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="35%" style="background:#0C3C58;border-radius: 12px;">
|
||||
<td width="40%" style="color: #69F6F9;font-size:20px;border-radius: 12px 0px 0px 12px;">运行巡检任务数</td>
|
||||
<td width="50%" style="padding-right: 10px;border-radius: 0px 12px 12px 0px;">
|
||||
<div style="float: left;background-color:#69F6F9;width: 100%;height:25%;border-radius:8px 0px 0px 8px;"></div>
|
||||
<div style="float: left;background-color:#d8d8d8;width: 0%;height:25%;opacity: 0.44;border-radius:0px 8px 8px 0px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="15%">
|
||||
<td width="40%"></td>
|
||||
<td width="50%" style="position:relative;">
|
||||
<div style="position:absolute;top:30%;color: #82BDF3;font-size:24px;">
|
||||
<span id="eqPatrolCompleteNum"></span>
|
||||
<span>/</span>
|
||||
<span id="eqPatrolTotalNum"></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="35%" style="background:#0C3C58;border-radius: 12px;">
|
||||
<td width="40%" style="color: #69F6F9;font-size:20px;border-radius: 12px 0px 0px 12px;">设备巡检任务数</td>
|
||||
<td width="50%" style="padding-right: 10px;border-radius: 0px 12px 12px 0px;">
|
||||
<div style="float: left;background-color:#69F6F9;width: 100%;height:25%;border-radius:8px 0px 0px 8px;"></div>
|
||||
<div style="float: left;background-color:#d8d8d8;width: 0%;height:25%;opacity: 0.44;border-radius:0px 8px 8px 0px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float:left;width:60%;height:calc(100% - 80px);">
|
||||
<div id="chart1" style="float:left;width:50%;height:100%;"></div>
|
||||
<div id="chart2" style="float:left;width:50%;height:100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user