204 lines
9.2 KiB
Plaintext
204 lines
9.2 KiB
Plaintext
|
|
<%@ 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" %>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<!-- <html lang="zh-CN"> -->
|
||
|
|
<!-- BEGIN HEAD -->
|
||
|
|
<head>
|
||
|
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||
|
|
</title>
|
||
|
|
<!-- 引用页头及CSS页-->
|
||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
|
<!-- bootstrap switch -->
|
||
|
|
<link rel="stylesheet"
|
||
|
|
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||
|
|
<script type="text/javascript"
|
||
|
|
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||
|
|
<script type="text/javascript"
|
||
|
|
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<!-- 引入daterangepicker-->
|
||
|
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<script type="text/javascript"
|
||
|
|
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<!-- 组件自定义js-->
|
||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/jsp/efficiency/assembly/assembly.js"
|
||
|
|
charset="utf-8"></script>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var masterId = '';
|
||
|
|
var tbName = 'tb_efficiency_overviewConfigure_file'; //数据表
|
||
|
|
|
||
|
|
var previews = new Array();
|
||
|
|
var previewConfigs = new Array();
|
||
|
|
var canvas;
|
||
|
|
var context;
|
||
|
|
var height;
|
||
|
|
var width;
|
||
|
|
var beauty;
|
||
|
|
var dataAll;
|
||
|
|
|
||
|
|
//获取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;
|
||
|
|
}
|
||
|
|
|
||
|
|
var picId = "";
|
||
|
|
|
||
|
|
function showImg() {
|
||
|
|
$('#mpConfigure').html("");
|
||
|
|
$.ajax({
|
||
|
|
url: ext.contextPath
|
||
|
|
+ "/base/getInputFileList.do",
|
||
|
|
type: "post",
|
||
|
|
cache: false,
|
||
|
|
data: {masterId: masterId, tbName: tbName},
|
||
|
|
dataType: "json",
|
||
|
|
async: false,
|
||
|
|
success: function (data) {
|
||
|
|
if (data != '') {
|
||
|
|
var abspath = data[0].abspath.split('webapps');
|
||
|
|
picId = data[0].id;
|
||
|
|
//document.getElementById("imgShow").src = ""+getRootPath()+""+abspath[1]+"";
|
||
|
|
canvas = document.getElementById("canvas");
|
||
|
|
context = canvas.getContext('2d');
|
||
|
|
beauty = new Image();
|
||
|
|
beauty.src = "" + getRootPath() + "" + abspath[1] + "";
|
||
|
|
// width = $(window).width();
|
||
|
|
// height = $(window).height();
|
||
|
|
width = beauty.width;
|
||
|
|
height = beauty.height;
|
||
|
|
|
||
|
|
// if (beauty.complete) {
|
||
|
|
// document.getElementById('canvas').width = beauty.width;
|
||
|
|
// document.getElementById('canvas').height = beauty.height;
|
||
|
|
// drawBeauty();
|
||
|
|
// mPointData(picId);
|
||
|
|
// } else {
|
||
|
|
beauty.onload = function () {
|
||
|
|
document.getElementById('canvas').width = beauty.width;
|
||
|
|
document.getElementById('canvas').height = beauty.height;
|
||
|
|
drawBeauty();
|
||
|
|
};
|
||
|
|
beauty.onerror = function () {
|
||
|
|
alert('加载失败,请重试');
|
||
|
|
};
|
||
|
|
// }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function mPointData(picId) {
|
||
|
|
$.ajax({
|
||
|
|
url: ext.contextPath
|
||
|
|
+ "/efficiency/efficiencyOverviewMpConfigure/getJson.do",
|
||
|
|
type: "post",
|
||
|
|
cache: false,
|
||
|
|
data: {
|
||
|
|
picId: picId,
|
||
|
|
unitId: unitId
|
||
|
|
},
|
||
|
|
dataType: "json",
|
||
|
|
async: false,
|
||
|
|
success: function (mpdata) {
|
||
|
|
dataAll = mpdata;
|
||
|
|
if (mpdata != '') {
|
||
|
|
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
|
||
|
|
context.drawImage(beauty, 0, 0, width, height);
|
||
|
|
context.save();
|
||
|
|
for (var m = 0; m < mpdata.length; m++) {
|
||
|
|
var divHtml = "";
|
||
|
|
if (mpdata[m].efficiencyOverviewConfigureAssembly != null) {
|
||
|
|
var assembly = mpdata[m].efficiencyOverviewConfigureAssembly;
|
||
|
|
if (assembly.type != null && assembly.type != '') {
|
||
|
|
if (assembly.type == 'heat') {
|
||
|
|
//热力组件
|
||
|
|
selectAssembly_Heat(mpdata[m]);
|
||
|
|
} else if (assembly.type == 'mpoint') {
|
||
|
|
//测量点组件
|
||
|
|
divHtml = selectAssembly_mpdata_show(mpdata[m]);
|
||
|
|
} else if (assembly.type == 'meter') {
|
||
|
|
//电力表组件
|
||
|
|
divHtml = selectAssembly_meter_show(mpdata[m]);
|
||
|
|
} else if (assembly.type == 'dataFrame') {
|
||
|
|
//数据框组件
|
||
|
|
divHtml = selectAssembly_dataFrame_show(mpdata[m]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
if (mpdata[m].mPoint != '') {
|
||
|
|
//测量点组件
|
||
|
|
divHtml = selectAssembly_mpdata_show(mpdata[m]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
$('#mpConfigure').append(divHtml);
|
||
|
|
}
|
||
|
|
context.save();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
$(function () {
|
||
|
|
if ('${param.unitId}' != null && '${param.unitId}' != '') {
|
||
|
|
unitId = '${param.unitId}';
|
||
|
|
}
|
||
|
|
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/getJson.do', {unitId: unitId}, function (data) {
|
||
|
|
if (data.length > 0) {
|
||
|
|
masterId = data[0].id;
|
||
|
|
showImg();
|
||
|
|
mPointData(masterId);
|
||
|
|
}
|
||
|
|
}, 'json');
|
||
|
|
});
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
|
|
<div class="wrapper">
|
||
|
|
<!-- 引用top -->
|
||
|
|
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||
|
|
<!-- 菜单栏 -->
|
||
|
|
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||
|
|
<div class="content-wrapper">
|
||
|
|
<!-- Content Header (Page header) -->
|
||
|
|
<section class="content-header">
|
||
|
|
<%-- <h1 id="head_title"></h1>--%>
|
||
|
|
<%-- <ol class="breadcrumb">--%>
|
||
|
|
<%-- <li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||
|
|
<%-- <!-- <li class="active">Here</li> -->--%>
|
||
|
|
<%-- </ol>--%>
|
||
|
|
</section>
|
||
|
|
<!-- Main content -->
|
||
|
|
<section class="content container-fluid">
|
||
|
|
<div id="mainAlertdiv"></div>
|
||
|
|
<div id="subDiv"></div>
|
||
|
|
<!-- <div style="width: 100%;height:100%;overflow: auto;" >
|
||
|
|
<div id="mpConfigure" style="position:relative;"></div>
|
||
|
|
<img id="imgShow" src="">
|
||
|
|
</div> -->
|
||
|
|
<div class="demo" style="width: 100%;height:100%;overflow: auto;">
|
||
|
|
<div id="mpConfigure" style="position:relative;"></div>
|
||
|
|
<canvas id="canvas"></canvas>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
<!-- /.content -->
|
||
|
|
</div>
|
||
|
|
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||
|
|
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|