first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1,443 @@
/**
* 热力区域组件
*/
function windowToCanvas(e) {
var x = e.x || e.clientX,
y = e.y || e.clientY,
bbox = canvas.getBoundingClientRect();
return { x: x - bbox.left * (canvas.width / bbox.width),
y: y - bbox.top * (canvas.height / bbox.height)
};
}
//热力区域点击时间
function drawBeauty(){
context.save();
context.drawImage(beauty, 0, 0, width, height);
//点击获取坐标
canvas.onmousedown = function (e) {
var loc = windowToCanvas(e);
e.preventDefault(); // prevent cursor change
var lnglat = new Array;
lnglat[0]=loc.x;
lnglat[1]=loc.y;
var id = "";
var type = "";
if(dataAll != null && dataAll != undefined && dataAll != ''){
for(var i=0;i<dataAll.length;i++){
var data = dataAll[i];
var lnglats= eval("["+data.lnglats+"]");
var res = checkHeatCanvas(lnglat,lnglats);
if(res){
var assembly =data.efficiencyOverviewConfigureAssembly;
if(assembly.type!=null && assembly.type!=''){
type = assembly.type;
}
id = data.id;
break;
}
}
if(type=='heat'){
editps(id);
}
}
};
}
function checkHeatCanvas(checkPoint, polygonPoints) {
var counter = 0;
var i;
var xinters;
var p1, p2;
var pointCount = polygonPoints.length;
p1 = polygonPoints[0];
for (i = 1; i <= pointCount; i++) {
p2 = polygonPoints[i % pointCount];
if (
checkPoint[0] > Math.min(p1[0], p2[0]) &&
checkPoint[0] <= Math.max(p1[0], p2[0])
) {
if (checkPoint[1] <= Math.max(p1[1], p2[1])) {
if (p1[0] != p2[0]) {
xinters =
((checkPoint[0] - p1[0]) * (p2[1] - p1[1])) / (p2[0] - p1[0]) +
p1[1];
if (p1[1] == p2[1] || checkPoint[1] <= xinters) {
counter++;
}
}
}
}
p1 = p2;
}
return !(counter % 2 == 0);
}
function selectAssembly_Heat(efficiencyOverviewMpConfigure) {
var colors = ["RGBA(251,255,205,0.8)","RGBA(250,232,126,0.8)",
"RGBA(252,203,84,0.8)", "RGBA(251,169,97,0.8)",
"RGBA(232,75,34,0.8)","RGBA(175,0,18,0.8)"];
var data=efficiencyOverviewMpConfigure;
var lnglats= eval("["+data.lnglats+"]");
var scale = 1
var count = data.showParmValue;
if(count==null || count== undefined || count==''){
count=100;
}
var color="RGBA(175,0,18,0.8)";
//根据数据与最大值比例选择区域颜色
if(count>8){
color = colors[5];
};
if(count>6 && count<=8){
color = colors[4];
}
if(count>4 && count<=6){
color = colors[3];
}
if(count>2 && count<=4){
color = colors[1];
}
if(count<=2){
color = colors[0];
}
//绘制区域颜色
context.fillStyle = color;
context.strokeStyle = "RGBA(232,75,34,0.6)";
context.lineWidth=3;
//绘制区域开始
context.beginPath();
if(data.lnglats!=null
&& data.lnglats!=undefined
&& data.lnglats!=''){
for(var a=0;a<lnglats.length;a++){
if(a==0){
//绘制区域初始坐标点
context.moveTo(lnglats[a][0]*scale, lnglats[a][1]*scale);
}else{
//绘制区域后续坐标点
context.lineTo(lnglats[a][0]*scale, lnglats[a][1]*scale);
}
}
}
//绘制区域结束
context.closePath();
context.fill();
context.stroke();
}
/**
* 测量点组件
*/
function selectAssembly_mpdata(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var signaltype=mpdata.mPoint.signaltype;//AI DI
var ledtype=mpdata.mPoint.ledtype;//DI的情况下类别状态 1运行点0故障点
var ledcolor=mpdata.mPoint.ledcolor;//颜色状态 1红开绿停0绿开红停;黄色永远表示故障
// var directtype=mpdata.mPoint.directtype;//判断是否信号接反 1正常0反过来
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
if(signaltype=='AI'){
var height=mpdata.height;
var width=mpdata.width;
if(height>0&&width>0){
divHtml="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: move;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">"+mpdata.mpname+":"+parmValue+""+unit+"</div>";
}else{//未设置长宽,则自适应显示
divHtml+="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";border: 1px solid #E8EBEC;border-radius: 6px;cursor: move;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">";
divHtml+="<label style='padding:5px;cursor: move;font-weight:400;'>"+mpdata.mpname+":"+parmValue+""+unit+"</label>";
divHtml+="</div>";
}
}else if(signaltype=='DI'){
var showColor="#000000";
if(ledtype=='1'){//运行点
if(ledcolor=='1'){//红开绿停
if(Number(parmValue)==0){
showColor='green';
}else if(Number(parmValue)==1){
showColor='red';
}else if(Number(parmValue)==2){
showColor='yellow';
}
}else if(ledcolor=='0'){//绿开红停
if(Number(parmValue)==0){
showColor='red';
}else if(Number(parmValue)==1){
showColor='green';
}else if(Number(parmValue)==2){
showColor='yellow';
}
}
}else if(ledtype=='0'){//故障点
//透明正常黄故障
if(Number(parmValue)==0){
showColor='transparent';
}else if(Number(parmValue)==1){
showColor='yellow';
}
}
divHtml+="<div class=\"moveDiv\" style=\"position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;cursor:move;overflow: hidden;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">";
divHtml+="<span style='position:relative;padding:5px;'>"
divHtml+="<i style='padding:5px;display:block;background:"+showColor+";border-radius:50%;width:8px;height:8px;top:8px;right:0px;position:absolute;'></i>";
divHtml+="</span>"
divHtml+="</div>";
}
}else{
divHtml="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: move;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\"></div>";
}
return divHtml;
}
function selectAssembly_mpdata_show(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var signaltype=mpdata.mPoint.signaltype;//AI DI
var ledtype=mpdata.mPoint.ledtype;//DI的情况下类别状态 1运行点0故障点
var ledcolor=mpdata.mPoint.ledcolor;//颜色状态 1红开绿停0绿开红停;黄色永远表示故障
// var directtype=mpdata.mPoint.directtype;//判断是否信号接反 1正常0反过来
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
if(signaltype=='AI'){
var height=mpdata.height;
var width=mpdata.width;
if(height>0&&width>0){
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<span onclick=\"showDetailData('"+mpdata.id+"','"+mpdata.mPoint.parmname+"');\">"+mpdata.mpname+"</span>";
divHtml+="<span onclick=\"showDetail('"+mpdata.id+"','"+mpdata.mpid+"');\">"+parmValue+""+unit+"</span>";
divHtml+="</div>";
}else{//未设置长宽,则自适应显示
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<label style='padding:5px;cursor: move;font-weight:400;'>"+mpdata.mpname+":"+parmValue+""+unit+"</label>";
divHtml+="</div>";
}
}else if(signaltype=='DI'){
var showColor="#000000";
if(ledtype=='1'){//运行点
if(ledcolor=='1'){//红开绿停
if(Number(parmValue)==0){
showColor='green';
}else if(Number(parmValue)==1){
showColor='red';
}else if(Number(parmValue)==2){
showColor='yellow';
}
}else if(ledcolor=='0'){//绿开红停
if(Number(parmValue)==0){
showColor='red';
}else if(Number(parmValue)==1){
showColor='green';
}else if(Number(parmValue)==2){
showColor='yellow';
}
}
}else if(ledtype=='0'){//故障点
//透明正常黄故障
if(Number(parmValue)==0){
showColor='transparent';
}else if(Number(parmValue)==1){
showColor='yellow';
}
}
divHtml+="<div style=\"position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;cursor:pointer;overflow: hidden;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<span style='position:relative;padding:5px;'>"
divHtml+="<i style='padding:5px;display:block;background:"+showColor+";border-radius:50%;width:8px;height:8px;top:8px;right:0px;position:absolute;'></i>";
divHtml+="</span>"
divHtml+="</div>";
}
}else{
divHtml="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ></div>";
}
return divHtml;
}
/**
* 电力表组件
*/
function selectAssembly_meter(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
divHtml+="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color:#CDCCCC;width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 5px solid #CDCCCC;border-radius: 6px;cursor: move;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">";
divHtml+="<div style='float:left;width:40%;height:100%;line-height:"+(mpdata.height-10)+"px;background-color:#9BE2FF;border-radius: 6px;box-shadow:inset 1px 1px 8px 0px #000;color:#000000;font-weight:bold;'>"+mpdata.mpname+"</div>";
divHtml+="<div style='float:left;width:60%;height:100%;line-height:"+(mpdata.height-10)+"px;background-color:#1B1B1B;border-left: 5px solid #CDCCCC;border-radius: 6px;box-shadow:inset 1px 1px 3px 0px #CDCCCC;color:#F6E660;font-weight:bold;'>"+parmValue+""+unit+"</div>";
divHtml+="</div>";
}else{
divHtml+="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color:#CDCCCC;width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 5px solid #CDCCCC;border-radius: 6px;cursor: move;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">";
divHtml+="<div style='float:left;width:40%;height:100%;line-height:"+(mpdata.height)+"px;background-color:#9BE2FF;border-radius: 6px;box-shadow:inset 1px 1px 8px 0px #000;'></div>";
divHtml+="<div style='float:left;width:60%;height:100%;line-height:"+(mpdata.height)+"px;background-color:#1B1B1B;border-left: 5px solid #CDCCCC;border-radius: 6px;box-shadow:inset 1px 1px 3px 0px #CDCCCC;'></div>";
divHtml+="</div>";
}
return divHtml;
}
function selectAssembly_meter_show(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color:#CDCCCC;width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 5px solid #CDCCCC;border-radius: 6px;cursor: pointer;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<div onclick=\"showDetailData('"+mpdata.id+"','"+mpdata.mPoint.parmname+"');\" style='float:left;width:40%;height:100%;line-height:"+(mpdata.height-10)+"px;background-color:#9BE2FF;border-radius: 6px;box-shadow:inset 1px 1px 8px 0px #000;color:#000000;font-weight:bold;'>"+mpdata.mpname+"</div>";
divHtml+="<div onclick=\"showDetail('"+mpdata.id+"','"+mpdata.mpid+"');\" style='float:left;width:60%;height:100%;line-height:"+(mpdata.height-10)+"px;background-color:#1B1B1B;border-left: 5px solid #CDCCCC;border-radius: 6px;box-shadow:inset 1px 1px 3px 0px #CDCCCC;color:#F6E660;font-weight:bold;'>"+parmValue+""+unit+"</div>";
divHtml+="</div>";
}else{
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color:#CDCCCC;width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 5px solid #CDCCCC;border-radius: 6px;cursor: pointer;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<div style='float:left;width:40%;height:100%;line-height:"+(mpdata.height)+"px;background-color:#9BE2FF;border-radius: 6px;box-shadow:inset 1px 1px 8px 0px #000;'></div>";
divHtml+="<div style='float:left;width:60%;height:100%;line-height:"+(mpdata.height)+"px;background-color:#1B1B1B;border-left: 5px solid #CDCCCC;border-radius: 6px;box-shadow:inset 1px 1px 3px 0px #CDCCCC;'></div>";
divHtml+="</div>";
}
return divHtml;
}
/**
* 数据框组件
*/
function selectAssembly_dataFrame(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
var height=mpdata.height;
var width=mpdata.width;
if(height>0&&width>0){
divHtml="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: move;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">"+parmValue+""+unit+"</div>";
}else{//未设置长宽,则自适应显示
divHtml+="<div class=\"moveDiv\" style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";border: 1px solid #E8EBEC;border-radius: 6px;cursor: move;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\">";
divHtml+="<label style='padding:5px;cursor: move;font-weight:400;'>"+parmValue+""+unit+"</label>";
divHtml+="</div>";
}
}else{
divHtml="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ondblclick=\"editps('"+mpdata.id+"');\"></div>";
}
return divHtml;
}
function selectAssembly_dataFrame_show(mpdata){
var divHtml="";
if(mpdata.mPoint!=null){
var unit="";
var parmValue="";
if(mpdata.showUnit!=''){
unit="("+mpdata.showUnit+")";
}
if(mpdata.showParmValue!=''&&mpdata.showParmValue!=null){
parmValue=mpdata.showParmValue;
}
var height=mpdata.height;
var width=mpdata.width;
if(height>0&&width>0){
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<span onclick=\"showDetail('"+mpdata.id+"','"+mpdata.mpid+"');\">"+parmValue+""+unit+"</span>";
divHtml+="</div>";
}else{//未设置长宽,则自适应显示
divHtml+="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" >";
divHtml+="<label style='padding:5px;cursor: move;font-weight:400;'>"+parmValue+""+unit+"</label>";
divHtml+="</div>";
}
}else{
divHtml="<div style=\"font-size:"+mpdata.txtsize+"px;color:"+mpdata.textcolor+";position:absolute;top:"+(mpdata.y)+"px;left:"+mpdata.x+"px;background-color: "+(mpdata.bkcolor)+";width:"+(mpdata.width)+"px;height:"+(mpdata.height)+"px;border: 1px solid #E8EBEC;border-radius: 6px;cursor: pointer;text-align:center;line-height:"+(mpdata.height)+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\" id=\""+mpdata.id+"\" name=\""+mpdata.id+"\" ></div>";
}
return divHtml;
}
/**
* 展示界面附属数据
*/
function showDetailData(id,parmname) {
var index = layer.open({
type: 1,
title: false,
closeBtn: 0,
area: '30%',
// offset:"auto",
fixed: false,
skin: 'bgfff', //没有背景色
shadeClose: true,
content: '<div id="detailData" style="height:400px;overflow:auto;"></div>',
success:function(){
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/getList.do",{picId:id,unitId:unitId}, function(data) {
var jsonData=data.rows;
// console.log(jsonData);
var html="";
html+="<table style='width: 100%;border-collapse: collapse; padding:2px;'>";
html+="<tr style='height:35px;font-size: 14px;color: #61798f;text-align:center;background:#ffffff;border:1px solid #ddd;' >";
html+="<th colspan='3'>&nbsp;&nbsp;&nbsp;"+parmname+"</th>";
html+="</tr>";
html+="<tr style='height:45px;font-size: 14px;color: #61798f;text-align:center;background:#ECF0F5;border:1px solid #ddd;' >";
html+="<td >测量点名称</td>";
html+="<td width='20%'>当前值</td>";
html+="<td width='20%'>单位</td>";
html+="</tr>";
if(jsonData!=''){
for(var i=0;i<jsonData.length;i++){
if(i%2==0){
html+="<tr style='height:45px;font-size: 14px;color: #61798f;text-align:center;background:#ffffff;border:1px solid #ddd;' >";
}else{
html+="<tr style='height:45px;font-size: 14px;color: #61798f;text-align:center;background:#ECF0F5;border:1px solid #ddd;' >";
}
html+="<td style='border:1px solid #ddd;'>"+jsonData[i].mPoint.parmname+"</td>";
html+="<td style='border:1px solid #ddd;'>"+jsonData[i].showParmValue+"</td>";
html+="<td style='border:1px solid #ddd;'>"+jsonData[i].showUnit+"</td>";
html+="</tr>";
}
}else{
html+="<tr style='height:45px;font-size: 14px;color: #61798f;text-align:center;background:#ffffff;border:1px solid #ddd;' >";
html+="<td >无关联测量点</td>";
html+="</tr>";
}
$('#detailData').html(html);
},'json');
},
end:function(){
layer.closeAll();
},
});
}
/**
* 展示界面打开界面
*/
function showDetail(id,mpid){
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/efficiency/efficiencyOverview/showDetailView.do', {id:id,mpid:mpid} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
}

View File

@ -0,0 +1,109 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var showMenu4SelectFun = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigure/showTree4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#menu4SelectDiv").html(data);
openModal("menu4SelectModal")
});
};
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/constituteConfigure/dosave.do", $("#subForm").serialize(), function (result) {
if (result.code == 1) {
initTreeView();
//showAlert('s','保存成功');
} else {
showAlert('d', '保存失败');
}
},'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '顺序不能为空'
},
regexp: {
regexp: /^[0-9]*$/,
message: '顺序必须为数字'
}
}
}
}
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">新增</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="unitid" name="unitid" type="hidden" value="${param.unitId}"/>
<input id="schemeId" name="schemeId" type="hidden" value="${param.schemeId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${constituteConfigure.name }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showMenu4SelectFun()" value="${pname}" readonly>
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">单位</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="unit" name ="unit" placeholder="单位" >
</div>
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="排序" value="0">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">备注</label>
<div class="col-sm-10">
<textarea class="form-control" rows="3" id ="remark" name ="remark" placeholder="请输入">${constituteConfigure.remark}</textarea>
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,140 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@page import="com.sipai.entity.efficiency.ConstituteConfigureDetail"%>
<%request.setAttribute("Type_Day", ConstituteConfigureDetail.Type_Day); %>
<%request.setAttribute("Type_Month", ConstituteConfigureDetail.Type_Month); %>
<%request.setAttribute("Type_Hour", ConstituteConfigureDetail.Type_Hour); %>
<%request.setAttribute("Type_Empty", ConstituteConfigureDetail.Type_Empty); %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
function dosave() {
$("#subDetailForm").bootstrapValidator('validate');//提交验证
if ($("#subDetailForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/constituteConfigureDetail/doupdate.do", $("#subDetailForm").serialize(), function(data) {
if (data.code == 1){
closeModal('subDetailModal');
$("#table").bootstrapTable('refresh');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}
//输入框验证
$("#subDetailForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
mpname: {
validators: {
notEmpty: {
message: '测量点名称不能为空'
}
}
},
mpid: {
validators: {
notEmpty: {
message: '测量点编号不能为空'
}
}
}
}
});
// $(function(){
// $("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
// })
var selectMPint = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/showMPointSingle4Select.do', {formId:'subDetailForm',hiddenId:'mpid',textId:'mpname'} , function(data) {
$("#mpSelectSubDiv").html(data);
openModal('mpSelectSubModal');
});
};
var selectMPint2 = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/showMPointSingle4Select.do', {formId:'subDetailForm',hiddenId:'dsmpid',textId:'text'} , function(data) {
$("#mpSelectSubDiv").html(data);
openModal('mpSelectSubModal');
});
};
var selectMPint3 = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/showMPointSingle4Select.do', {formId:'subDetailForm',hiddenId:'xlmpid',textId:'text'} , function(data) {
$("#mpSelectSubDiv").html(data);
openModal('mpSelectSubModal');
});
};
</script>
<div class="modal fade" id="subDetailModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subDetailForm -->
<form class="form-horizontal" id="subDetailForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" name="id" value= "${constituteConfigureDetail.id}">
<div class="form-group">
<label class="col-sm-2 control-label">测量点名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpname" name ="mpname" placeholder="测量点名称" value="${constituteConfigureDetail.mpname}" onclick="selectMPint()">
</div>
<label class="col-sm-2 control-label">测量点编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpid" name ="mpid" placeholder="测量点编号" value="${constituteConfigureDetail.mpid}" onclick="selectMPint()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">吨水电耗测量点</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="dsmpid" name ="dsmpid" placeholder="吨水电耗测量点" value="${constituteConfigureDetail.dsmpid}" onclick="selectMPint2()">
</div>
<label class="col-sm-2 control-label">效率测量点</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="xlmpid" name ="xlmpid" placeholder="效率测量点" value="${constituteConfigureDetail.xlmpid}" onclick="selectMPint3()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">取值类型</label>
<div class="col-sm-4">
<select class="form-control select2" id="type" name ="type" style="width: 170px;">
<option value= "${Type_Day}" <c:if test="${constituteConfigureDetail.type==Type_Day}">selected = "selected"</c:if> >_day</option>
<option value= "${Type_Month}" <c:if test="${constituteConfigureDetail.type==Type_Month}">selected = "selected"</c:if> >_month</option>
<option value= "${Type_Hour}" <c:if test="${constituteConfigureDetail.type==Type_Hour}">selected = "selected"</c:if> >_hour</option>
<option value= "${Type_Empty}" <c:if test="${constituteConfigureDetail.type==Type_Empty}">selected = "selected"</c:if> ></option>
</select>
</div>
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="排序" value="${constituteConfigureDetail.morder}">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,266 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<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>
<script type="text/javascript">
var showMenu4SelectFun = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigure/showTree4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#menu4SelectDiv").html(data);
openModal("menu4SelectModal")
});
};
function dosave() {
$.post(ext.contextPath + "/efficiency/constituteConfigure/doupdate.do", $("#subForm").serialize(), function(result) {
var data= $.parseJSON(result);
if (data.code == 1) {
initTreeView();
}else{
showAlert('d',data.result);
}
});
}
function dodel() {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/constituteConfigure/dodel.do', $("#subForm").serialize(), function(result) {
// var data= $.parseJSON(result);
if(result.code==1){
initTreeView();
}else{
showAlert('d',result.msg);
}
},'json');
}
});
}
$(function() {
// getFileList();
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/efficiency/constituteConfigureDetail/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [5, 10,15], // 设置页面可以显示的数据条数
pageSize: 5, // 页面数据条数
pageNumber: 1, // 首页页码
paginationDetailHAlign:' hidden',//去除分页的显示
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
pid:'${constituteConfigure.id}'
}
},
sortName: 'morder', // 要排序的字段
sortOrder: 'asc', // 排序规则
columns: [
{
field: 'mpname', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'mpid', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'type', // 返回json数据中的name
title: '取值类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 100, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>'+
'<button class="btn btn-default btn-sm" onclick="delDetailFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
}
}
],
onLoadSuccess: function(){ //加载成功时执行
$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
},
onReorderRow: function (newData) {
//这里的newData是整个表格数据数组形式
// console.log("data",newData); //调试用代码
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/dosort.do',{ jsondata: JSON.stringify(newData) },//将整张表数据 不能分页
function(data) {
if (data == 1) {
//$("#table").bootstrapTable('refresh');
}else{
showAlert('d','数据错误','mainAlertdiv');
}
});
}
})
$("#table").tableDnD();
});
var editDetailFun = function (id) {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/doedit.do', {
id: id,
unitId: unitId
}, function (data) {
$("#detailDiv").html(data);
openModal('subDetailModal');
});
};
function delDetailFun(id) {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/dodel.do', {id:id}, function(data) {
console.log(data);
if(data.code==1){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','alertDiv');
}
},'json');
}
});
}
var addMpointFuns = function () {
$.post(ext.contextPath + '/efficiency/constituteConfigureDetail/showMPoint4Select.do', {pid:'${constituteConfigure.id}'}, function (data) {
$("#detailMpDiv").html(data);
openModal('MPointModel');
});
};
</script>
<div class="box box-primary" style="margin-bottom:0px;">
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${constituteConfigure.id}"/>
<input id="unitid" name="unitid" type="hidden" value="${constituteConfigure.unitid}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv1"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${constituteConfigure.name }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showMenu4SelectFun()" value="${pname}" readonly>
<input id="pid" name="pid" type="hidden" value="${constituteConfigure.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">单位</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="unit" name ="unit" placeholder="单位" value="${constituteConfigure.unit}">
</div>
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${constituteConfigure.morder}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">备注</label>
<div class="col-sm-10">
<textarea class="form-control" rows="3" id ="remark" name ="remark" placeholder="请输入">${constituteConfigure.remark}</textarea>
</div>
</div>
</form>
</div>
</div>
<c:if test="${constituteConfigure.pid!='-1'}">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">附表配置</h3>
<div class="box-tools pull-right">
</div>
</div>
<div class="box-body ">
<div >
<div id="detailDiv"></div>
<div id="detailMpDiv"></div>
<div id="mpSelectSubDiv"></div>
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default" onclick="addMpointFuns();"><i class="fa fa-plus"></i> 新增</button>
</div>
<table id="table" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
</div>
</div>
</div>
</c:if>

View File

@ -0,0 +1,254 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.sipai.entity.efficiency.ConstituteConfigureDetail"%>
<%request.setAttribute("Type_Day", ConstituteConfigureDetail.Type_Day); %>
<%request.setAttribute("Type_Month", ConstituteConfigureDetail.Type_Month); %>
<%request.setAttribute("Type_Hour", ConstituteConfigureDetail.Type_Hour); %>
<%request.setAttribute("Type_Empty", ConstituteConfigureDetail.Type_Empty); %>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchPatrolPoint = function() {
$("#table_patrolPoint4Select").bootstrapTable('refresh');
};
function doSelect(dialog,grid) {
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
var datas="";
datas_name="";
$.each(selectionIds, function(index, item){
if(datas!=""){
datas+=",";
}
datas+=item;
});
if(datas==''){
showAlert('d','请选择测量点');
}else{
$.post(ext.contextPath + "/efficiency/constituteConfigureDetail/dosaves.do",{datas:datas,pid:'${param.pid}',unitId:unitId,type:$('#type').val()}, function(data) {
closeModal("MPointModel");
$("#table").bootstrapTable('refresh');
},'json');
}
};
var $table;
var selectionIds = [];
function initialSelectionIds(){
var check_array =eval('${mPoints}');
if(check_array!=null&& check_array.length>0){
selectionIds =new Array(check_array.length);
for(var i=0;i<check_array.length;i++){
selectionIds[i]=check_array[i].id;
}
}
}
function getCheckedIds(){
var ids="";
var check_array =eval('${mPoints}');
$.each(check_array, function(index, item){
if(ids!=""){
ids+=",";
}
ids+=item.id;
});
return ids;
}
function queryParams(params) {
var temp={
rows: params.limit,
page: params.offset/params.limit+1,
sort: params.sort,
order: params.order,
search_name: $('#search_name_mpoint').val(),
companyId: unitId
}
return temp;
}
$(function() {
$("#searchForm_MPoint").attr("onsubmit", "return false;");
$("#search_name_mpoint").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
doSearchPatrolPoint();
event.stopPropagation();
}
});
// $('#searchBox').boxWidget();
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
initialSelectionIds();
$table=$("#table_patrolPoint4Select").bootstrapTable({
url: ext.contextPath + '/work/mpoint/getlist.do',
striped: true,
pagination: true,
pageList: [10, 20],
pageSize: 20,
pageNumber: 1,
sidePagination: 'server',
clickToSelect:true,
responseHandler:responseHandler,
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id',
sortOrder: 'asc',
columns: [
{
checkbox: true,
formatter: function (i,row) {
if($.inArray(row.id,Array.from(selectionIds))!=-1){
return {
checked : true
}
}
}
},{
field: 'parmname',
title: "名称",
align: 'center',
valign: 'middle'
},{
field: 'mpointcode',
title: "测量点Code",
align: 'center',
valign: 'middle'
},{
field: 'parmvalue',
title: "最新值",
align: 'center',
valign: 'middle'
},{
field: 'measuredt',
title: "最新时间",
align: 'center',
valign: 'middle',
width:'145px',
formatter: function (value, row, index) {
return value.substring(0,16)
}
},{
field: 'unit',
title: "单位",
align: 'center',
valign: 'middle'
}
],
onLoadSuccess: function(){
adjustBootstrapTableView("table_patrolPoint4Select");
},
onLoadError: function(){
console.info("加载数据失败");
}
});
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
return row.id;
});
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
selectionIds = _[func](selectionIds, ids);
if('check'==e.type){
obj.parent().addClass("checked");
}else{
obj.parent().removeClass("checked");
}
});
});
//选中事件操作数组
var union = function(array,ids){
$.each(ids, function (i, id) {
if($.inArray(id,array)==-1){
array[array.length] = id;
}
});
return array;
};
//取消选中事件操作数组
var difference = function(array,ids){
$.each(ids, function (i, id) {
var index = $.inArray(id,array);
if(index!=-1){
array.splice(index, 1);
}
});
return array;
};
var _ = {"union":union,"difference":difference};
//表格分页之前处理多选框数据
function responseHandler(res) {
$.each(res.rows, function (i, row) {
row.checkStatus = $.inArray(row.id, selectionIds) != -1;
});
return res;
}
</script>
<div class="modal fade" id="MPointModel">
<div class="modal-dialog" style="width: 850px;">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择测量点</h4>
</div>
<div class="modal-body " style="width:100%">
<div id="alertDiv"></div>
<!-- <div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
<div class="box-header">
<div class="pull-right box-tools">
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
style="margin-right: 5px;">
<i class="fa fa-plus"></i></button>
</div>
<i class="fa fa-search"></i>
</div> -->
<div >
<form class="form-horizontal " id="searchForm_MPoint">
<div class="form-group" style="margin-right: 20px;">
<!-- <label class="col-sm-2 control-label">部门</label>
<div class="col-sm-4">
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
</div> -->
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-3">
<input type="text" id="search_name_mpoint" name="search_name_mpoint" class="form-control input-sm" placeholder="名称" >
</div>
<label class="col-sm-2 control-label">取值类型</label>
<div class="col-sm-3">
<select class="form-control select2" id="type" name ="type" >
<option value= "${Type_Day}" selected = "selected">_day</option>
<option value= "${Type_Month}">_month</option>
<option value= "${Type_Hour}">_hour</option>
<option value= "${Type_Empty}"></option>
</select>
</div>
<div class="col-sm-2 " >
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchPatrolPoint();"><i class="fa fa-search"> 搜索</i></button>
</div>
</div>
<!-- <div class="form-group" style="margin-right: 20px;">
</div> -->
</form>
</div>
<!-- </div> -->
<div>
<table id="table_patrolPoint4Select" style="height:230px;overflow:auto;width:100%"></table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,264 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<%@page import="com.sipai.entity.scada.MPoint"%>
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
<script type="text/javascript">
var dosearchMp = function() {
$("#table_mpoint").bootstrapTable('refresh');
};
function doselect(dialog,grid) {
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
var datas_name="";
var value_name="";
var datas_code="";
if(checkedItem!= null && checkedItem!=""){
$.post(ext.contextPath + '/work/mpoint/getlist.do', {companyId:unitId,checkedIds : checkedItem.id,page:1,rows:50}, function(resp) {
//console.info(checkedItem.id)
$.each(resp.rows, function(index, item){
datas_name=item.parmname;//测量点一次只能添加一个
value_name=item.parmvalue;
datas_code=item.mpointcode;
});
// console.log("formid","${param.formId}");
// console.log("formid","${param.hiddenId}");
// console.log(companyId);
$('#${param.formId} #${param.hiddenId}' ).val(checkedItem.id);
$('#${param.formId} #${param.textId}').val(datas_name);
if('${param.valueId}'!=''){
$('#${param.formId} #${param.valueId}').val(value_name);
}
if('${param.codeId}'!=''){
$('#${param.formId} #${param.codeId}').val(datas_code);
}
if('${param.unitId}'!=''){
$('#${param.formId} #${param.unitId}').val(unitId);
}
closeModal('mpSelectSubModal');
},'json');
}else{
showAlert('d','尚未选择测量点!','mpoint_mainAlertdiv');
}
};
//显示已经勾选的数据
function stateFormatter(value, row, index) {
var flag=false;
if(row.id=='${mpid}'){
flag=true;
checkedItem = "";
}
if (flag)
return {
checked : true//设置选中
};
return value;
}
var $table;
function queryParams(params) {
var temp={
pid:params.pid,
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
search_name: $('#search_mpointname').val(),
search_mpointcode: $('#search_mpointcode').val(),
companyId:unitId
};
/* var status =$('#switchBtn').bootstrapSwitch('state')
if(status){
temp.checkedIds=getCheckedIds();
}
*/ return temp;
}
$(function() {
/* $.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
if(data.length == 1){
//选择厂区为一个厂时隐藏选择框
$("#search_code").css("display", "none");
$("#company").text(data[0].text);
companyId=data[0].id;
dosearchMp();
}else{
$("#company").css("display", "none");
var selelct=$("#search_code").select2({
data : data ,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
//refreshSelect();
selelct.on("change",function(e){
companyId= $(this).val();
dosearchMp();
});
}
},'json'); */
//简易公司combotree
//initialSelectionIds();
//alert();
$table=$("#table_mpoint").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
clickToSelect:true,
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
/* showColumns: true,
showRefresh: true, */
columns: [
{
checkbox: true, // 显示一个勾选框
formatter: stateFormatter
},{
field: 'mpointcode', // 返回json数据中的name
title: '测量点Code', // 表格表头显示文字
sortable : true,
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'parmname', // 返回json数据中的name
title: '名称', // 表格表头显示文字
sortable : true,
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'signaltype', // 返回json数据中的name
title: '信号类型', // 表格表头显示文字
sortable : true,
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'active', // 返回json数据中的name
title: '启用状态', // 表格表头显示文字
sortable : true,
align: 'center', // 左右居中
valign: 'middle',
formatter : function(value, row) {
if('${Flag_Enable}'==value){
return "启用";
}else{
return "禁用";
}
} // 上下居中
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table_mpoint");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
//绑定选中事件、取消事件、全部选中、全部取消
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
if('check'==e.type){
$('#table_mpoint .checked').removeClass("checked");
obj.parent().addClass("checked");
checkedItem = rows;
}else{
obj.parent().removeClass("checked");
checkedItem = "";
}
});
});
</script>
<div class="modal fade" id="mpSelectSubModal" >
<div class="modal-dialog modal-md" >
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择测量点</h4>
</div>
<div class="modal-body">
<div id="mpoint_mainAlertdiv"></div>
<div id="menu4SelectDiv"></div>
<div id="modal-body">
<!-- <div class="form-group">
<label class="form-label" id="companylabel">水厂:</label>
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
</div> -->
<div class="form-group " style="margin-bottom:10px;">
<input id="search_code" name="search_code" type="hidden" />
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
</div>
<div class="form-group pull-right form-inline" >
<div class="input-group input-group-sm " style="width: 220px;margin-left:30px">
<input type="text" id="search_mpointname" name="search_mpointname" class="form-control pull-right" placeholder="点位名称">
</div>
<div class="input-group input-group-sm " style="width: 220px;">
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control " placeholder="点位编码">
<div class="input-group-btn">
<button class="btn btn-default" onclick="dosearchMp();"><i class="fa fa-search"></i></button>
</div>
</div>
<!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->
</div>
<!-- <div class="form-group " style="padding:0;">
<label class="form-label">班组</label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
<div class="form-group pull-right" >
<div class="input-group input-group-sm" style="width: 500px;">
<input type="text" id="search_pid" name="search_pid" class="form-control pull-right" style="width: 200px;" placeholder="所属车间">
<input type="text" id="search_name" name="search_name" class="form-control pull-right" style="width: 200px;margin-right:10px" placeholder="系统名称">
<div class="input-group-btn">
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div> -->
<div class="table-scrollable">
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_mpoint"></table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doselect()" id="btn_save">确定</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,160 @@
<%@ 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>
<!-- 文件上传-->
<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>
<!-- 拖拽排序-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js"
charset="utf-8"></script>
<script type="text/javascript"
src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js"
charset="utf-8"></script>
<link rel="stylesheet"
href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
<script type="text/javascript">
var addFun = function () {
var node = $('#tree').treeview('getSelected');
console.log(node);
var pid = "";
var type = "";
if (node != null && node.length > 0) {
pid = node[0].id;
type = node[0].type;
} else {
// pid = "-1";
type = "-1";
}
// console.log(type)
if (type == "-1") {
$.post(ext.contextPath + '/efficiency/constituteConfigureScheme/doadd.do', {
unitId: unitId,
pid: pid
}, function (data) {
$("#menuBox").html(data);
});
} else {
if (type == "0") {
pid = "-1";
}
let schemeId = "";
if(node[0].schemeId!=null&&node[0].schemeId!=''){
schemeId =node[0].schemeId;
}else{
schemeId = node[0].id;
}
// console.log(schemeId)
$.post(ext.contextPath + '/efficiency/constituteConfigure/doadd.do', {
unitId: unitId,
pid: pid,
schemeId:schemeId
}, function (data) {
$("#menuBox").html(data);
});
}
};
var editFun = function (id, type) {
if (type == '0') {
$.post(ext.contextPath + '/efficiency/constituteConfigureScheme/doedit.do', {id: id}, function (data) {
$("#menuBox").html(data);
});
} else {
$.post(ext.contextPath + '/efficiency/constituteConfigure/doedit.do', {id: id}, function (data) {
$("#menuBox").html(data);
});
}
};
var initTreeView = function () {
$.post(ext.contextPath + '/efficiency/constituteConfigure/getTreeJson.do', {unitId: unitId}, function (data) {
console.info(data)
$('#tree').treeview({
data: data
});
$('#tree').on('nodeSelected', function (event, data) {
editFun(data.id, data.type);
//var node=$('#tree').treeview('getSelected');
});
}, 'json');
$("#menuBox").html("");
};
$(function () {
initTreeView();
});
</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 id="menu4SelectDiv"></div>
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">构成分析架构</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i
class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body no-padding">
<div id="tree" style="height:550px;overflow:auto;"></div>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-md-9" id="menuBox">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
</html>

View File

@ -0,0 +1,89 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var showMenu4SelectFun = function() {
$.post(ext.contextPath + '/efficiency/constituteConfigureScheme/showTree4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#menu4SelectDiv").html(data);
openModal("menu4SelectModal")
});
};
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/constituteConfigureScheme/dosave.do", $("#subForm").serialize(), function (result) {
if (result.code == 1) {
initTreeView();
//showAlert('s','保存成功');
} else {
showAlert('d', '保存失败');
}
},'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '顺序不能为空'
},
regexp: {
regexp: /^[0-9]*$/,
message: '顺序必须为数字'
}
}
}
}
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">新增</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="unitid" name="unitid" type="hidden" value="${param.unitId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">方案名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="方案名称" value="${constituteConfigureScheme.name }">
</div>
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="排序" value="0">
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,95 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<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>
<script type="text/javascript">
function dosave() {
$.post(ext.contextPath + "/efficiency/constituteConfigureScheme/doupdate.do", $("#subForm").serialize(), function(result) {
var data= $.parseJSON(result);
if (data.code == 1) {
initTreeView();
}else{
showAlert('d',data.result);
}
});
}
function dodel() {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/constituteConfigureScheme/dodel.do', $("#subForm").serialize(), function(result) {
// var data= $.parseJSON(result);
if(result.code==1){
initTreeView();
}else{
showAlert('d',result.msg);
}
},'json');
}
});
}
</script>
<div class="box box-primary" style="margin-bottom:0px;">
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${constituteConfigureScheme.id}"/>
<input id="unitid" name="unitid" type="hidden" value="${constituteConfigureScheme.unitid}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv1"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">方案名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="方案名称" value="${constituteConfigureScheme.name }">
</div>
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${constituteConfigureScheme.morder}">
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,44 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
$.post(ext.contextPath + '/efficiency/constituteConfigure/getTreeJson.do', {unitId:unitId} , function(data) {
if(data.length>0){
$('#menu_select_tree').treeview({
data: data,
});
$('#menu_select_tree').on('nodeSelected', function(event, data) {
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
$('#${param.formId} #${param.textId}').val(data.text);
closeModal("menu4SelectModal")
});
}
},'json');
});
function choiceRoot(){
$('#${param.formId} #${param.hiddenId}' ).val("-1");
$('#${param.formId} #${param.textId}').val("根节点");
closeModal("menu4SelectModal")
}
</script>
<div class="modal fade" id="menu4SelectModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">选择菜单</h4>
</div>
<div class="btn-group" style="width: 220px;padding-left:10px;padding-top:5px;">
<button type="button" class="btn btn-default" onclick="choiceRoot();"><i class="fa fa-plus"></i> 根节点</button>
</div>
<div class="modal-body">
<div id="menu_select_tree" style="height:430px;overflow:auto;width:100%"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,179 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
var windowghight=$(window).height();
$('#DetailViewMainDiv').attr("style","height:"+(windowghight-200)+"px;width:100%;");
setTimeout(getEcharts, 1000);
getTable();
});
function getTable(){
$.post(ext.contextPath + '/efficiency/constitute/getDetailTableData.do', {id:"${param.id}",unitId:unitId,sdt:"${param.sdt}",edt:"${param.edt}"} , function(result) {
var html="";
html+="<table style='height:100%;width: 100%;border-collapse: collapse;'>";
html+="<tr style='width:100%;height:40px;background-color:#E3E4E6;'>";
html+="<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>用能单位</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>电量实际值(A)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>电量基准值(A)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>电量节约值(A)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>电量节约率(%)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>吨水电耗(kwh/t)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>吨水电耗基准值(kwh/t)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>效率(%)</td>";
html+="<td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>效率基准值(%)</td>";
html+="</tr>";
for(var i=0;i<result.length;i++){
var value=Number(result[i].value).toFixed(2);
var lastvalue=Number(result[i].lastvalue).toFixed(2);
var diffvalue = 0;
if(lastvalue>0){
diffvalue = (lastvalue - value).toFixed(2);
}
let outValue = 0;
if (lastvalue > 0) {
outValue = (((lastvalue - value) / lastvalue) * 100).toFixed(2);
}
html+="<tr style='width:100%;height:60px;'>";
html+=" <td align='center' style='width: 20%;border: 1px solid #e4e4e4;cursor: pointer;' >"+result[i].name+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+value+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+lastvalue+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+diffvalue+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+outValue+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+Number(result[i].dsValue).toFixed(4)+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+Number(result[i].dslastValue).toFixed(4)+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+Number(result[i].xlValue).toFixed(2)+"</td> ";
html+=" <td align='center' style='width: 10%;border: 1px solid #e4e4e4;'>"+Number(result[i].xllastValue).toFixed(2)+"</td> ";
html+="</tr>";
}
html+="</table>";
$('#detailTable').html(html);
},'json');
}
function getEcharts(){
$.post(ext.contextPath + '/efficiency/constitute/getDetailData.do', {id:"${param.id}",unitId:unitId,sdt:"${param.sdt}",edt:"${param.edt}"} , function(result) {
var series=[];
var yAxis=[];
var legenddata=[];
for(var i=0;i<result.length;i++){
series.push({
data:result[i].data,
symbol:'none',
name:result[i].name,
type:'line',
lineStyle:{
width:2
}
})
legenddata.push(result[i].name);
}
yAxis.push({
type : 'value',
name : false,
splitLine: {
show: false//是否显示分隔线。默认数值轴显示,类目轴不显示。
},
scale:true//设置成 true 后坐标刻度不会强制包含零刻度。
});
var myChart = echarts.init(document.getElementById("chart"));
var option = {
color:color,
animation:false,
legend: {
data: legenddata,
left: 'center'
},
grid:{
left: '4%', // 与容器左侧的距离
right: '4%', // 与容器右侧的距离
top: '8%', // 与容器顶部的距离
//bottom: '5%', // 与容器底部的距离
containLabel:true
},
toolbox: {
feature: {
saveAsImage: {show: true}
}
},
xAxis: {
type: 'time'
},
yAxis: yAxis,
series: series,
tooltip: {
trigger: 'axis',
formatter: function (params, ticket, callback) {
var htmlStr = '';
for(var i=0;i<params.length;i++){
var param = params[i];
// console.log(param);
var xName = param.name;//x轴的名称
var seriesName = param.seriesName;//图例名称
var xvalue = param.value[0].substring(0,10);//x轴值
var yvalue = param.value[1];//y轴值
var remarkvalue = param.value[2];//备注轴值
var color = param.color;//图例颜色
var dataIndex=param.dataIndex;
var seriesIndex=param.seriesIndex;
htmlStr +='<div>';
if(i==0){
htmlStr += xvalue + '<br/>' ;
}
htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:'+color+';"></span>';
htmlStr += seriesName+':'+ yvalue + '';
htmlStr += '</div>';
}
return htmlStr;
}
// alwaysShowContent:true,
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '60%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}]
};
// console.log(option);
myChart.setOption(option,true);
},'json');
}
</script>
<div class="modal fade" id="detailDataModal">
<div style="padding: 20px;">c
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">详细数据</h4>
</div>
<div class="modal-body">
<div id="DetailViewMainDiv">
<div id="chart" style="float: left;width: 100%;height: 50%;"></div>
<div style="float: left;width: 100%;height: 50%;">
<div id="detailTable" style="height:100%;width: 100%;overflow:auto;"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,583 @@
<%@ 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.scada.MPoint" %>
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%>
</title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<!-- echarts-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.4.1.0.min.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>
<!-- 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>
<script type="text/javascript">
var beginTimeStore = '';
var endTimeStore = '';
$(function () {
var tree = false;
//判断是否有配置
$.post(ext.contextPath + '/efficiency/constituteConfigureScheme/getTreeJson.do', {
unitId: unitId
}, function (result) {
console.log(result)
if (result.length > 0) {
document.getElementById('closeImage').style.display = 'block'
document.getElementById('openImage').style.display = 'none'
var windowghight = $(window).height();
$('#mainDiv').attr("style", "height:" + windowghight + "px;width:100%;padding-top:20px;");
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD HH:mm');
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
var locale = {
"format": 'YYYY-MM-DD HH:mm',
"separator": "~",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#reservationtime').daterangepicker({
timePicker: false,
timePicker24Hour: false,
linkedCalendars: false,
autoUpdateInput: false,
showDropdowns: true,
locale: locale,
//汉化按钮部分
ranges: {
'本月': [moment().startOf('month'), moment().endOf('month').subtract(0, 'month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(0, 'month')]
},
startDate: beginTimeStore,
endDate: endTimeStore
}, function (start, end, label) {
beginTimeStore = start.format(this.locale.format);
endTimeStore = end.format(this.locale.format);
if (!this.startDate) {
this.element.val('');
} else {
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
}
// dosearch();
});
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
$("#schemeTree").empty();
var selelct_ = $("#schemeTree").select2({
data: result,
cache: false,
placeholder: '请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val(result[0].id).trigger("change");
selelct_.on("change", function (e) {
dosearch();
});
dosearch();
} else {
document.getElementById('db').style.display = 'none'
document.getElementById('fx').style.display = 'none'
document.getElementById('openImage').style.display = 'block'
document.getElementById('closeImage').style.display = 'none'
}
}, 'json');
});
function dosearch() {
dodata1();
dochart2(0);
}
var color = [
"#2ec7c9",
"#b6a2de",
"#5ab1ef",
"#ffb980",
"#d87a80",
"#8d98b3",
"#e5cf0d",
"#97b552",
"#95706d",
"#dc69aa",
"#07a2a4",
"#9a7fd1",
"#588dd5",
"#f5994e",
"#c05050",
"#59678c",
"#c9ab00",
"#7eb00a",
"#6f5553",
"#c14089"
];
var jsondata1 = ""
function dodata1() {
$.post(ext.contextPath + '/efficiency/constitute/getCompanyEnergy.do', {
unitId: unitId,
sid:$('#schemeTree').val(),
sdt: beginTimeStore,
edt: endTimeStore
}, function (result) {
// console.log(result);
jsondata1 = result;
dochart1(-1);
dotable1();
dotable2(0);
}, 'json');
}
let option1 = "";
let myChart1 = "";
function dochart1(num) {
var legendData = [];
var seriesData1 = [];
var seriesData2 = [];
if (num == -1) {
for (var i = 0; i < jsondata1.length; i++) {
legendData.push(jsondata1[i].name);
seriesData1.push({
value: jsondata1[i].value,
name: jsondata1[i].name
})
for (var j = 0; j < jsondata1[i].children.length; j++) {
legendData.push(jsondata1[i].children[j].name);
seriesData2.push({
value: jsondata1[i].children[j].value,
name: jsondata1[i].children[j].name
})
}
}
} else {
legendData.push(jsondata1[num].name);
seriesData1.push({
value: jsondata1[num].value,
name: jsondata1[num].name
})
for (var j = 0; j < jsondata1[num].children.length; j++) {
legendData.push(jsondata1[num].children[j].name);
seriesData2.push({
value: jsondata1[num].children[j].value,
name: jsondata1[num].children[j].name
})
}
}
myChart1 = echarts.init(document.getElementById("chart1"));
option1 = {
color: color,
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
show: true,
type: 'scroll',
orient: 'vertical',
left: 10,
data: legendData
},
series: [
{
name: '全厂能耗(kWh)',
type: 'pie',
selectedMode: 'single',
center: ['55%', '50%'],
radius: [0, '40%'],
label: {
normal: {
position: 'inner'
}
},
labelLine: {
normal: {
show: false
}
},
data: seriesData1
},
{
name: '全厂能耗(kWh)',
type: 'pie',
center: ['55%', '50%'],
radius: ['50%', '65%'],
// label: {
// normal: {
// formatter: ' {b|{b}}\n {per|{d}%}',
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// rich: {
// b: {
// fontSize: 12,
// align: 'left',
// lineHeight: 20
// },
// per: {
// align: 'left',
// color: '#eee',
// backgroundColor: '#334455',
// padding: [2, 4],
// borderRadius: 2
// }
// }
// }
// },
data: seriesData2
}
]
};
myChart1.setOption(option1, true);
}
function dochart2(num) {
$.post(ext.contextPath + '/efficiency/constitute/getLineData.do', {
unitId: unitId,
sid:$('#schemeTree').val(),
sdt: beginTimeStore,
edt: endTimeStore,
num: num
}, function (result) {
var series = [];
var yAxis = [];
var legenddata = [];
for (var i = 0; i < result.length; i++) {
series.push({
data: result[i].data,
symbol: 'none',
name: result[i].parmname,
type: 'line',
lineStyle: {
width: 2
}
})
legenddata.push(result[i].parmname);
}
yAxis.push({
type: 'value',
name: false,
splitLine: {
show: false//是否显示分隔线。默认数值轴显示,类目轴不显示。
},
scale: true//设置成 true 后坐标刻度不会强制包含零刻度。
});
var myChart = echarts.init(document.getElementById("chart2"));
var option = {
color: color,
animation: false,
legend: {
type: 'scroll',
data: legenddata,
left: 'center'
},
grid: {
left: '4%', // 与容器左侧的距离
right: '4%', // 与容器右侧的距离
top: '8%', // 与容器顶部的距离
//bottom: '5%', // 与容器底部的距离
containLabel: true
},
// toolbox: {
// feature: {
// saveAsImage: {show: true}
// }
// },
xAxis: {
type: 'time'
},
yAxis: yAxis,
series: series,
tooltip: {
trigger: 'axis',
formatter: function (params, ticket, callback) {
var htmlStr = '';
for (var i = 0; i < params.length; i++) {
var param = params[i];
// console.log(param);
var xName = param.name;//x轴的名称
var seriesName = param.seriesName;//图例名称
var xvalue = param.value[0];//x轴值
var yvalue = param.value[1];//y轴值
var remarkvalue = param.value[2];//备注轴值
var color = param.color;//图例颜色
var dataIndex = param.dataIndex;
var seriesIndex = param.seriesIndex;
htmlStr += '<div>';
if (i == 0) {
htmlStr += xvalue + '<br/>';
}
htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:' + color + ';"></span>';
htmlStr += seriesName + ':' + yvalue + '';
htmlStr += '</div>';
}
return htmlStr;
}
// alwaysShowContent:true,
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '60%',
height: '25px',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}]
};
// console.log(option);
myChart.setOption(option, true);
}, 'json');
}
function dotable1() {
var html = "";
html += "<table style='height:100%;width: 100%;border-collapse: collapse;'>";
html += "<tr style='width:100%;height:40px;background-color:#E3E4E6;'>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>用能单位</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>实际值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>基准值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>节约值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>节约率(%)</td>";
html += "</tr>";
for (var i = 0; i < jsondata1.length; i++) {
var name = jsondata1[i].name;
if(jsondata1[i].unit!=''&&jsondata1[i].unit!=null){
name+="("+jsondata1[i].unit+")";
}
var value = Number(jsondata1[i].value).toFixed(2);
var lastvalue = Number(jsondata1[i].lastvalue).toFixed(2);
var diffvalue = 0;
if (lastvalue > 0) {
diffvalue = (lastvalue - value).toFixed(2);
}
html += "<tr style='width:100%;height:60px;cursor:pointer;' onclick='dochange(" + i + ")'>";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + name + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + value + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + lastvalue + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + diffvalue + "</td> ";
let outValue = 0;
if (lastvalue > 0) {
outValue = (((lastvalue - value) / lastvalue) * 100).toFixed(2);
}
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + outValue + "</td> ";
html += "</tr>";
}
html += "</table>";
$('#table1').html(html);
}
function dotable2(num) {
// console.log(jsondata1);
var html = "";
html += "<table style='height:100%;width: 100%;border-collapse: collapse;'>";
html += "<tr style='width:100%;height:40px;background-color:#E3E4E6;'>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>用能单位</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>实际值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>基准值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>节约值</td>";
html += "<td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>节约率(%)</td>";
html += "</tr>";
for (var i = 0; i < jsondata1[num].children.length; i++) {
var name = jsondata1[num].children[i].name;
if(jsondata1[num].children[i].unit!=''&&jsondata1[num].children[i].unit!=null){
name+="("+jsondata1[num].children[i].unit+")";
}
var value = Number(jsondata1[num].children[i].value).toFixed(2);
var lastvalue = Number(jsondata1[num].children[i].lastvalue).toFixed(2);
var diffvalue = 0;
if (lastvalue > 0) {
diffvalue = (lastvalue - value).toFixed(2);
}
html += "<tr style='width:100%;height:60px;' >";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;cursor:pointer;' onclick='showDetail(\"" + jsondata1[num].children[i].id + "\");'>" + name + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + value + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + lastvalue + "</td> ";
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + diffvalue + "</td> ";
let outValue = 0;
if (lastvalue > 0) {
outValue = (((lastvalue - value) / lastvalue) * 100).toFixed(2);
}
html += " <td align='center' style='width: 20%;border: 1px solid #e4e4e4;'>" + outValue + "</td> ";
html += "</tr>";
}
html += "</table>";
$('#table2').html(html);
}
function showDetail(id) {
$.post(ext.contextPath + '/efficiency/constitute/getDetailDataView.do', {
id: id,
sdt: beginTimeStore,
edt: endTimeStore
}, function (data) {
$("#detailDataDiv").html(data);
openModal("detailDataModal");
});
}
function dochange(num) {
dochart1(num);
dochart2(num);
dotable2(num);
}
function changeOp2LIsHidden(obj) {
var value = $(obj).val();
if (value == '0') {
option1.legend.show = true;
} else {
option1.legend.show = false;
}
myChart1.setOption(option1, true);
}
</script>
</head>
<body class="hold-transition ${cu.themeclass} sidebar-mini" style="overflow: hidden;">
<div class="box box-solid">
<div id="mainDiv" class="box-body ">
<div id="detailDataDiv"></div>
<div style="width: 100%;height:45px;float: left;">
<div class="form-group form-inline" style="padding-left:10px;">
<div class="form-group" style="height: 40px;line-height: 40px;">
<label class="input-lable">&nbsp;方案:</label>
<div class="input-group " style="width: 180px;">
<select id="schemeTree" name="schemeTree" class="select2"
style="height: 30px;padding: 0px 10px;width: 100%;">
</select>
</div>
</div>
<div class="form-group" style="height: 40px;line-height: 40px;">
<label class="input-lable">&nbsp;日期:</label>
<div class="input-group ">
<div class="input-group pull-right input-group-sm">
<div class="input-group-addon">
<i class="fa fa-clock-o"></i>
</div>
<input type="text" class="form-control" id="reservationtime" style="width:225px">
</div>
</div>
</div>
<div class="form-group" style="height: 40px;line-height: 40px;">
<button type="button" class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i> 查询
</button>
</div>
</div>
</div>
<div id="openImage">
<img style="width: 100%; height: 100%" src="<%=request.getContextPath()%>/IMG/nengxiaoBack.png"/>
</div>
<div id="closeImage" style="width: 100%;height:calc(100% - 45px);float: left;">
<div id="db" style="width: 45%;height:100%;float: left;">
<div style="width: 100%;height: 65%;float: left;border:1px solid gray;padding:5px;">
<div style="width: 100%;height: 30px;float: left;background:#E3E4E6;border:1px solid #e4e4e4;line-height: 30px;font-size: 14px;font-weight:bold;padding-left: 10px;">
<div style="width: 200px;height:100%;float: left;">
能耗对比分析
</div>
<%-- <div style="width: 180px;height:100%;float: right;font-weight:400;">--%>
<%-- <div style="width: 80px;height:100%;float: left;">图例切换</div>--%>
<%-- <div style="width: 100px;height:100%;float: left;font-weight:400;">--%>
<%-- <select id="op2LIsHidden" name="op2LIsHidden" class="select2"--%>
<%-- style="height: 30px;padding: 0px 10px;"--%>
<%-- onchange="changeOp2LIsHidden(this);">--%>
<%-- <option value="0" selected>显示</option>--%>
<%-- <option value="1">隐藏</option>--%>
<%-- </select>--%>
<%-- </div>--%>
<%-- </div>--%>
</div>
<div style="width: 100%;height:calc(100% - 35px);float: left;border:1px solid #e4e4e4;margin-top: 5px;">
<div id="chart1" style="height: 100%;"></div>
</div>
</div>
<div style="width: 100%;height: 35%;float: left;border:1px solid gray;padding: 5px;">
<div id="table1" style="height:100%;width: 100%;overflow:auto;"></div>
</div>
</div>
<div id="fx" style="width: 55%;height: 100%;float: left;">
<div style="width: 100%;height: 50%;float: left;border:1px solid gray;padding:5px;">
<div style="width: 100%;height: 30px;float: left;background:#E3E4E6;border:1px solid #e4e4e4;line-height: 30px;font-size: 14px;font-weight:bold;padding-left: 10px;">
能耗趋势分析
</div>
<div style="width: 100%;height:calc(100% - 35px);float: left;border:1px solid #e4e4e4;margin-top: 5px;">
<div id="chart2" style="height: 100%;"></div>
</div>
</div>
<div style="width: 100%;height: 50%;float: left;border:1px solid gray;padding:5px;">
<div id="table2" style="height:100%;width: 100%;overflow:auto;"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,181 @@
<%@page import="com.sipai.tools.CommString"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var beginTimeStore1 = '';
var endTimeStore1 = '';
function initDate1() {
//定义locale汉化插件
beginTimeStore1 = moment().subtract(1, 'month').format('YYYY-MM-DD HH:mm');
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
var locale = {
"format": 'YYYY-MM-DD HH:mm',
"separator": " ~ ",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#reservationtime1').daterangepicker({
"timePicker": true,
"timePicker24Hour": true,
"linkedCalendars": false,
"autoUpdateInput": false,
"timePickerIncrement": 10,
"locale": locale,
//汉化按钮部分
ranges: {
// '今日': [moment(), moment().subtract(-1, 'days')],
'昨日': [moment().subtract(1, 'days'), moment()],
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
},
startDate: beginTimeStore1,
endDate: endTimeStore1
}, function(start, end, label) {
beginTimeStore1 = start.format(this.locale.format);
endTimeStore1 = end.format(this.locale.format);
if(!this.startDate){
this.element.val('');
}else{
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
}
});
$('#reservationtime1').val(beginTimeStore1 + locale.separator + endTimeStore1);
};
$(function() {
var windowhight=$(window).height();
var windowwidth=$(window).width();
$('#chart').attr("style","height:"+(windowhight-200)+"px;width:"+(windowwidth-100)+"px;");
initDate1();
doDetailEchart();
});
var color=[
"#2ec7c9",
"#b6a2de",
"#5ab1ef",
"#ffb980",
"#d87a80",
"#8d98b3",
"#e5cf0d",
"#97b552",
"#95706d",
"#dc69aa",
"#07a2a4",
"#9a7fd1",
"#588dd5",
"#f5994e",
"#c05050",
"#59678c",
"#c9ab00",
"#7eb00a",
"#6f5553",
"#c14089"
];
function doDetailEchart(){
$.post(ext.contextPath + '/efficiency/efficiencyOverview/getHisMpointJson.do', {unitId:unitId,mpid:'${param.mpid}',sdt:beginTimeStore1,edt:endTimeStore1} , function(data) {
// console.log(data);
if(data.length>0){
var seriesData=data[0].data;
var mychart=echarts.init(document.getElementById('chart'));
var option = {
color:color,
// title: {
// text: '历史曲线'
// },
tooltip: {
trigger: 'axis'
},
legend: {
data: [''+data[0].name+'']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'time'
},
yAxis: {
type: 'value'
},
series: [{
name:data[0].name,
data:seriesData,
symbol:'none',
type:'line',
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'}
]
}
}]
};
mychart.setOption(option);
}
},'json');
}
</script>
<div class="modal fade" id="subModal">
<div style="padding: 5px;">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">详细内容</h4>
</div>
<div class="modal-body">
<div id="mainDiv" >
<div style="width: 100%;height: 100%;">
<div style="float: left;width: 100%;height:40px;" >
<input type="text" class="form-control pull-left" id="reservationtime1" style="width:270px" >
<div class="input-group-btn pull-left">
<button type="button" class="btn btn-default" onclick="doDetailEchart();" ><i class="fa fa-search"></i> 查询</button>
</div>
</div>
<div style="float: left;width: 100%;" >
<div id="chart" style="float: left;"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<!-- <button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button> -->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,204 @@
<%@ 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>

View File

@ -0,0 +1,102 @@
<%@page import="com.sipai.tools.CommString"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/efficiencyOverviewConfigure/dosave.do", $("#subForm").serialize(), function(data) {
if (data.code == 1){
closeModal('subModal');
$("#table").bootstrapTable('refresh');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
/* type: {
validators: {
notEmpty: {
message: '类型不能为空'
}
}
}, */
}
});
// $(function(){
// $("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
// })
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">新增</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" name="unitid" value= "${param.unitId}">
<input type="hidden" name="id" value= "${id}">
<input type="hidden" name="upperlimit" value= "0">
<input type="hidden" name="lowerlimit" value= "0">
<input type="hidden" name="grade" value= "5">
<div class="form-group">
<label class="col-sm-2 control-label">*名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" >
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-2 control-label">*类型</label> -->
<!-- <div class="col-sm-6"> -->
<!-- <select class="form-control select2" id="type" name ="type">
<option value="0" selected = "selected">总览</option>
<option value="1">热力图</option> -->
<!-- </select> -->
<!-- </div> -->
<!-- </div> -->
<div class="form-group">
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="排序" >
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,353 @@
<%@page import="com.sipai.tools.CommString"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var masterId='${efficiencyOverviewConfigure.id}';
var tbName='tb_efficiency_overviewConfigure_file'; //数据表
var nameSpace='efficiencyOverviewConfigure';//保存文件夹
var previews = new Array();
var previewConfigs = new Array();
var canvas;
var context;
var height;
var width;
var beauty;
var dataAll;
function showFileInput(ctrlName) {
var control = $('#' + ctrlName);
control.fileinput('destroy');
control.fileinput({
language: 'zh', //设置语言
showUpload: false, //是否显示上传按钮
showRemove:false,
showCaption: false,//是否显示标题
showBrowse:false,//选择按钮
showClose:false,//右上角关闭按钮
dropZoneEnabled: false,//是否显示拖拽区域
fileActionSettings:{
showDrag:false
},
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount:true,
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
initialPreviewAsData: true,
initialPreview: previews,
initialPreviewConfig:previewConfigs,
layoutTemplates:{
actionUpload:''
},
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
deleteExtraData:function () { //传参
var data = {
"tbName": tbName
};
return data;
}
});
$('#kvFileinputModal').on("hidden.bs.modal", function() {
$(this).removeData("bs.modal");
//modal重复打开会导致前面的滚动条失去作用
$('.modal').css("overflow","auto");
});
}
//名称定义不可修改
var getFileList = function() {
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
//console.info(data)
if(data.length>0){
previews=new Array();
// $('#maintenancefile').show();
for(var i=0;i<data.length;i++){
var previewConfig = new Object();
var path = data[i].abspath;
path=path.substring(path.indexOf('webapps')+7,path.length);
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
previews.push(path);
previewConfig['width']= '50px';
previewConfig['caption']= data[i].filename;
previewConfig['key']= data[i].id;
previewConfigs.push(previewConfig);
}
showFileInput("efficiencyOverviewConfigureModelFile");
}else{
$('#efficiencyOverviewConfigureModelFile').hide();
}
},'json');
};
var fileinput = function() {
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/efficiencyOverviewConfigure/doupdate.do", $("#subForm").serialize(), function(data) {
if (data.code == 1){
closeModal('subModal');
$("#table").bootstrapTable('refresh');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
}
});
//获取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("");
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , 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(masterId);
}else{
beauty.onload = function(){
drawBeauty();
mPointData(masterId);
};
beauty.onerror = function(){
alert('加载失败,请重试');
};
};
}
},'json');
}
function mPointData(picId){
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/getJson.do', {picId:picId,unitId:'${efficiencyOverviewConfigure.unitid}'} , function(mpdata) {
dataAll =mpdata;
if(mpdata.length>0){
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(mpdata[m]);
}else if(assembly.type=='meter'){
//电力表组件
divHtml = selectAssembly_meter(mpdata[m]);
}else if(assembly.type=='dataFrame'){
//数据框组件
divHtml = selectAssembly_dataFrame(mpdata[m]);
}
}
}else{
if(mpdata[m].mPoint != ''){
//测量点组件
divHtml = selectAssembly_mpdata(mpdata[m]);
}
}
$('#mpConfigure').append(divHtml);
$('#'+mpdata[m].id).draggable();
}
context.save();
}
},'json');
}
function editps(id){
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/doedit.do', {id:id} , function(data) {
$("#mpDiv").html(data);
openModal('subMpModal');
});
}
function setdata() {
// var contentdiv=$("#mpConfigure");
var obj = document.getElementsByTagName("DIV");
for(var i=0;i<obj.length;i++){
if(obj[i].className.indexOf("moveDiv")>=0){
// console.log("id" , obj[i].id);
// console.log("x", obj[i].style.left);
// console.log("y" , obj[i].style.top);
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/updateLayout.do', {id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,}, function(data) {
},'json');
}
}
}
$(function () {
$("#type").select2({ minimumResultsForSearch: 10 }).val("${efficiencyOverviewConfigure.type}").trigger("change");
showImg();
showAssembly();
});
function showAssembly(){
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigureAssembly/getTreeJson.do', {unitId:'${efficiencyOverviewConfigure.unitid}'}, function (data){
var htmlStr = "";
if(data!=null && data!=undefined && data!=''){
for(var i=0;i<data.length;i++){
htmlStr += '<button type="button" class="btn btn-default btn-sm" onclick="addAssemblyFun(\''+data[i].id+'\');" ><i class="fa fa-plus"></i>'+data[i].text+'</button>';
}
}
$("#assembly").html(htmlStr);
},'json');
};
var addMPFun = function () {
if(picId==''){
showAlert('d','请先上传图片!');
}else{
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/mpConfigure.do', {unitId:'${efficiencyOverviewConfigure.unitid}',picId:picId}, function (data){
$("#mp4SelectDiv").html(data);
openModal('MPointModel');
});
}
};
var addAssemblyFun = function (id) {
if(picId==''){
showAlert('d','请先上传图片!');
}else{
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/doAssemblySave.do",{assembly:id, picId:masterId,unitId:'${efficiencyOverviewConfigure.unitid}'}, function(data) {
showImg();
},'json');
}
};
window.onload=function(){
var canvas=document.getElementById("canvas");
// canvas.width=1024;
// canvas.height=768;//通过这两种方式也可以设置canvas的大小
var context=canvas.getContext("2d");
}
</script>
<div class="modal fade" id="subModal">
<div style="padding: 5px;">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="mp4SelectDiv"></div>
<div id="mpDiv"></div>
<input type="hidden" name="id" value= "${efficiencyOverviewConfigure.id}">
<%-- <div class="form-group">
<label class="col-sm-2 control-label">*类型</label>
<div class="col-sm-6">
<select class="form-control select2" id="type" name="type" style="width:200px">
<option value="0">总览</option>
<option value="1">热力图</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图例最大值</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="upperlimit" name ="upperlimit" placeholder="最大值" value="${efficiencyOverviewConfigure.upperlimit}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图例最小值</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="lowerlimit" name ="lowerlimit" placeholder="最小值" value="${efficiencyOverviewConfigure.lowerlimit}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图例层级</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="grade" name ="grade" placeholder="层级" value="${efficiencyOverviewConfigure.grade}" >
</div>
</div> --%>
<div class="form-group">
<label class="col-sm-2 control-label">*名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${efficiencyOverviewConfigure.name}" >
</div>
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="排序" value="${efficiencyOverviewConfigure.morder}" >
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传图片</button>
</div>
</div>
<div class="form-group sidebar-nav">
<div class="col-sm-1">
<button type="button" class="btn btn-primary btn-sm" onclick="setdata();" ><i class="fa fa-save"></i> 保存布局</button>
</div>
<label class="col-sm-1 control-label">组件:</label>
<div class="col-sm-10" id="assembly">
</div>
</div>
<!-- <div style="height: 40px;">
<button type="button" class="btn btn-default btn-sm" onclick="addMPFun();"><i class="fa fa-plus"></i>添加测量点</button>
<button type="button" class="btn btn-default btn-sm" onclick="setdata();"><i class="fa fa-save"></i> 保存布局</button>
</div> -->
<div class="demo" style="width: 100%;height:100%;overflow: auto;" >
<div id="mpConfigure" style="position:relative;"></div>
<canvas id="canvas"></canvas>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,243 @@
<%@ 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>
<!-- 拖拽排序-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js" charset="utf-8"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
<script type="text/javascript">
var addFun = function() {
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/doadd.do', {unitId:unitId} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var editFun = function(id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/doedit.do', {id:id} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var viewFun = function(id){
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/doview.do', {id:id} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var deleteFun = function(id) {
stopBubbleDefaultEvent();
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/dodel.do', {id : id}, function(data) {
if(data.code==1){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
},'json');
}
});
};
var deletesFun = function() {
var checkedItems = $("#table").bootstrapTable('getSelections');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
if(datas==""){
showAlert('d','请先选择记录','mainAlertdiv');
}else{
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/dodeletes.do', {ids:datas} , function(data) {
if(data>0){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
});
}
},'json');
}
};
//模糊查询列表中的数据
var dosearch = function() {
$("#table").bootstrapTable('refresh');
};
$(function() {
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/efficiency/efficiencyOverviewConfigure/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20,50], // 设置页面可以显示的数据条数
pageSize: 50, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
unitId: unitId,
search_name: $('#search_name').val()
}
},
sortName: 'morder', // 要排序的字段
sortOrder: 'asc', // 排序规则
/* onClickRow: function (row) {//单击行事件,执行查看功能
viewFun(row.id);
}, */
columns: [
{
checkbox: true, // 显示一个勾选框
},
{
field: 'name', // 返回json数据中的name
title: '名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts= '';
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
buts='<div class="btn-group" >'+buts+'</div>';
return buts;
}
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
});
});
</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 id="fileInputDiv"></div>
<div id="dMpSubDiv"></div>
<div id="mpSubDiv"></div>
<div >
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
</div>
<br>
<div class="form-group " style="padding:0;">
<div class="form-group pull-right" >
<div class="input-group input-group-sm" style="width: 250px;">
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
<div class="input-group-btn">
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<table id="table"></table>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
<!-- 组件自定义js-->
<script type="text/javascript" src="<%=request.getContextPath()%>/jsp/efficiency/assembly/assembly.js" charset="utf-8"></script>
</body>
</html>

View File

@ -0,0 +1,244 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchPatrolPoint = function() {
$("#table_patrolPoint4Select").bootstrapTable('refresh');
};
function doDMpSelect(dialog,grid) {
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
var datas="";
datas_name="";
$.each(selectionIds, function(index, item){
if(datas!=""){
datas+=",";
}
datas+=item;
});
if(datas==''){
showAlert('d','请选择测量点');
}else{
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/dosave2.do",{datas:datas,picId:'${param.picId}'}, function(data) {
closeModal("DMPointModel");
$("#dMptable").bootstrapTable('refresh');
},'json');
}
};
function stateFormatter(value, row, index) {
var flag=false;
$.each(eval('${mPoints}'), function(index, item){
if(row.id==item.id){
flag=true;
}
});
if (flag){
return {
checked : true//设置选中
};
}
return value;
}
var $table;
var switchStatus=false;
var selectionIds = [];
function initialSelectionIds(){
var check_array =eval('${mPoints}');
if(check_array!=null&& check_array.length>0){
selectionIds =new Array(check_array.length);
for(var i=0;i<check_array.length;i++){
selectionIds[i]=check_array[i].id;
}
}
}
function getCheckedIds(){
var ids="";
var check_array =eval('${mPoints}');
$.each(check_array, function(index, item){
if(ids!=""){
ids+=",";
}
ids+=item.id;
});
return ids;
}
function queryParams(params) {
var temp={
rows: params.limit,
page: params.offset/params.limit+1,
sort: params.sort,
order: params.order,
search_name: $('#search_name_mpoint').val(),
companyId: '${param.unitId}'
}
return temp;
}
$(function() {
$("#searchForm_MPoint").attr("onsubmit", "return false;");
$("#search_name_mpoint").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
doSearchPatrolPoint();
event.stopPropagation();
}
});
$('#searchBox').boxWidget();
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
initialSelectionIds();
$table=$("#table_patrolPoint4Select").bootstrapTable({
url: ext.contextPath + '/work/mpoint/getlist.do',
clickToSelect:true,
striped: true,
pagination: true,
pageList: [10, 20],
pageSize: 20,
pageNumber: 1,
sidePagination: 'server',
clickToSelect:true,
responseHandler:responseHandler,
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id',
sortOrder: 'asc',
columns: [
{
checkbox: true,
formatter: function (i,row) {
if($.inArray(row.id,Array.from(selectionIds))!=-1){
return {
checked : true
}
}
}
},{
field: 'parmname',
title: "名称",
align: 'center',
valign: 'middle',
width: '50%'
},{
field: 'mpointcode',
title: "测量点Code",
align: 'center',
valign: 'middle',
width: '50%'
}
],
onLoadSuccess: function(){
adjustBootstrapTableView("table_patrolPoint4Select");
},
onLoadError: function(){
console.info("加载数据失败");
}
});
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
return row.id;
});
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
selectionIds = _[func](selectionIds, ids);
if('check'==e.type){
obj.parent().addClass("checked");
}else{
obj.parent().removeClass("checked");
}
});
});
//选中事件操作数组
var union = function(array,ids){
$.each(ids, function (i, id) {
if($.inArray(id,array)==-1){
array[array.length] = id;
}
});
return array;
};
//取消选中事件操作数组
var difference = function(array,ids){
$.each(ids, function (i, id) {
var index = $.inArray(id,array);
if(index!=-1){
array.splice(index, 1);
}
});
return array;
};
var _ = {"union":union,"difference":difference};
//表格分页之前处理多选框数据
function responseHandler(res) {
$.each(res.rows, function (i, row) {
row.checkStatus = $.inArray(row.id, selectionIds) != -1;
});
return res;
}
function doDMPClose(){
closeModal("DMPointModel");
}
</script>
<div class="modal fade" id="DMPointModel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" onclick="doDMPClose();">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择测量点</h4>
</div>
<div class="modal-body " style="width:100%">
<div id="alertDiv"></div>
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
style="margin-right: 5px;">
<i class="fa fa-plus"></i></button>
</div>
<!-- /. tools -->
<i class="fa fa-search"></i>
</div>
<div class="box-body collapse" >
<form class="form-horizontal " id="searchForm_MPoint">
<div class="form-group" style="margin-right: 20px;">
<!-- <label class="col-sm-2 control-label">部门</label>
<div class="col-sm-4">
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
</div> -->
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" id="search_name_mpoint" name="search_name_mpoint" class="form-control input-sm" placeholder="名称" style="width:170px;">
</div>
</div>
<div class="form-group" style="margin-right: 20px;">
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchPatrolPoint();"><i class="fa fa-search"> 搜索</i></button>
</div>
</div>
</form>
</div>
</div>
<div>
<div id="table_patrolPoint4Select" style="height:230px;overflow:auto;width:100%"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" onclick="doDMPClose();">关闭</button>
<button type="button" class="btn btn-primary" onclick="doDMpSelect()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,287 @@
<%@page import="com.sipai.tools.CommString"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/doupdate.do", $("#subMpForm").serialize(), function(data) {
if (data.code == 1){
closeModal('subMpModal');
showImg();
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}
function dodel(){
stopBubbleDefaultEvent();
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dodel.do', {id : '${efficiencyOverviewMpConfigure.id}'}, function(data) {
if(data.code==1){
closeModal('subMpModal');
showImg();
}else{
showAlert('d','删除失败','mainAlertdiv');
}
},'json');
}
});
}
//输入框验证
// $("#subForm").bootstrapValidator({
// live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
// fields: {
// name: {
// validators: {
// notEmpty: {
// message: '名称不能为空'
// }
// }
// },
// }
// });
function doMpclose(){
closeModal('subMpModal');
}
$(function() {
$("#dMptable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [5, 10,15], // 设置页面可以显示的数据条数
pageSize: 5, // 页面数据条数
pageNumber: 1, // 首页页码
paginationDetailHAlign:' hidden',//去除分页的显示
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
picId:'${efficiencyOverviewMpConfigure.id}',
unitId:unitId
}
},
sortName: 'morder', // 要排序的字段
sortOrder: 'asc', // 排序规则
columns: [
{
field: 'mPoint', // 返回json数据中的name
title: '测量点编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter: function(value,row,index){
return value==null?'':value.mpointcode;
}
},{
field: 'mPoint', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter: function(value,row,index){
return value==null?'':value.parmname;
}
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 100, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return '<button class="btn btn-default btn-sm" onclick="delDMpointFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
}
}
],
onLoadSuccess: function(){ //加载成功时执行
$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
},
//当拖拽结束后,整个表格的数据
onReorderRow: function (newData) {
//这里的newData是整个表格数据数组形式
// console.log("data",newData); //调试用代码
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dosort.do',{ jsondata: JSON.stringify(newData) },//将整张表数据 不能分页
function(data) {
if (data == 1) {
//$("#table").bootstrapTable('refresh');
}else{
showAlert('d','数据错误','mainAlertdiv');
}
});
}
})
$("#dMptable").tableDnD();
});
function delDMpointFun(id){
stopBubbleDefaultEvent();
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dodel.do', {id : id}, function(data) {
if(data.code==1){
$("#dMptable").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
},'json');
}
});
}
function addDMpointFun(){
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dMpConfigure.do', {unitId:unitId,picId:'${efficiencyOverviewMpConfigure.id}'}, function (data){
$("#dMpSubDiv").html(data);
openModal('DMPointModel');
});
}
var selectMPint = function() {
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {formId:'subMpForm',hiddenId:'mpid',textId:'mpname'} , function(data) {
$("#mpSubDiv").html(data);
openModal('mpSubModal');
});
};
</script>
<div class="modal fade" id="subMpModal">
<div style="padding: 5px;">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" onclick="doMpclose();">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subMpForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="mp4SelectDiv"></div>
<input type="hidden" name="id" value= "${efficiencyOverviewMpConfigure.id}">
<div class="form-group">
<label class="col-sm-2 control-label">测量点</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpid" name ="mpid" placeholder="点击选择" value="${efficiencyOverviewMpConfigure.mpid}" onclick="selectMPint();" readonly>
</div>
<label class="col-sm-2 control-label">测量名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpname" name ="mpname" value="${efficiencyOverviewMpConfigure.mpname}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">横向距离</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="x" name ="x" value="${efficiencyOverviewMpConfigure.x}" >
</div>
<label class="col-sm-2 control-label">纵向距离</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="y" name ="y" value="${efficiencyOverviewMpConfigure.y}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">宽度</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="width" name ="width" value="${efficiencyOverviewMpConfigure.width}" >
</div>
<label class="col-sm-2 control-label">高度</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="height" name ="height" value="${efficiencyOverviewMpConfigure.height}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">文字大小</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="txtsize" name ="txtsize" value="${efficiencyOverviewMpConfigure.txtsize}" >
</div>
<label class="col-sm-2 control-label">文字颜色</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="textcolor" name ="textcolor" value="${efficiencyOverviewMpConfigure.textcolor}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">背景色</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="bkcolor" name ="bkcolor" value="${efficiencyOverviewMpConfigure.bkcolor}" >
</div>
</div>
</form>
<div class="box-body ">
<div >
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default" onclick="addDMpointFun();"><i class="fa fa-plus"></i>新增</button>
</div>
<table id="dMptable" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" onclick="doMpclose();">关闭</button>
<button type="button" class="btn btn-primary" onclick="doupdate();" id="btn_update">保存</button>
<button type="button" class="btn" onclick="dodel();" >删除</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,244 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchPatrolPoint = function() {
$("#table_patrolPoint4Select").bootstrapTable('refresh');
};
function doSelect(dialog,grid) {
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
var datas="";
datas_name="";
$.each(selectionIds, function(index, item){
if(datas!=""){
datas+=",";
}
datas+=item;
});
if(datas==''){
showAlert('d','请选择测量点');
}else{
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/dosave.do",{datas:datas,picId:'${param.picId}',unitId:'${param.unitId}'}, function(data) {
closeModal("MPointModel");
showImg();
},'json');
}
};
function stateFormatter(value, row, index) {
var flag=false;
$.each(eval('${mPoints}'), function(index, item){
if(row.id==item.id){
flag=true;
}
});
if (flag){
return {
checked : true//设置选中
};
}
return value;
}
var $table;
var switchStatus=false;
var selectionIds = [];
function initialSelectionIds(){
var check_array =eval('${mPoints}');
if(check_array!=null&& check_array.length>0){
selectionIds =new Array(check_array.length);
for(var i=0;i<check_array.length;i++){
selectionIds[i]=check_array[i].id;
}
}
}
function getCheckedIds(){
var ids="";
var check_array =eval('${mPoints}');
$.each(check_array, function(index, item){
if(ids!=""){
ids+=",";
}
ids+=item.id;
});
return ids;
}
function queryParams(params) {
var temp={
rows: params.limit,
page: params.offset/params.limit+1,
sort: params.sort,
order: params.order,
search_name: $('#search_name_mpoint').val(),
companyId: '${param.unitId}'
}
return temp;
}
$(function() {
$("#searchForm_MPoint").attr("onsubmit", "return false;");
$("#search_name_mpoint").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
doSearchPatrolPoint();
event.stopPropagation();
}
});
$('#searchBox').boxWidget();
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
initialSelectionIds();
$table=$("#table_patrolPoint4Select").bootstrapTable({
url: ext.contextPath + '/work/mpoint/getlist.do',
clickToSelect:true,
striped: true,
pagination: true,
pageList: [10, 20],
pageSize: 20,
pageNumber: 1,
sidePagination: 'server',
clickToSelect:true,
responseHandler:responseHandler,
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id',
sortOrder: 'asc',
columns: [
{
checkbox: true,
formatter: function (i,row) {
if($.inArray(row.id,Array.from(selectionIds))!=-1){
return {
checked : true
}
}
}
},{
field: 'parmname',
title: "名称",
align: 'center',
valign: 'middle',
width: '50%'
},{
field: 'mpointcode',
title: "测量点Code",
align: 'center',
valign: 'middle',
width: '50%'
}
],
onLoadSuccess: function(){
adjustBootstrapTableView("table_patrolPoint4Select");
},
onLoadError: function(){
console.info("加载数据失败");
}
});
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
return row.id;
});
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
selectionIds = _[func](selectionIds, ids);
if('check'==e.type){
obj.parent().addClass("checked");
}else{
obj.parent().removeClass("checked");
}
});
});
//选中事件操作数组
var union = function(array,ids){
$.each(ids, function (i, id) {
if($.inArray(id,array)==-1){
array[array.length] = id;
}
});
return array;
};
//取消选中事件操作数组
var difference = function(array,ids){
$.each(ids, function (i, id) {
var index = $.inArray(id,array);
if(index!=-1){
array.splice(index, 1);
}
});
return array;
};
var _ = {"union":union,"difference":difference};
//表格分页之前处理多选框数据
function responseHandler(res) {
$.each(res.rows, function (i, row) {
row.checkStatus = $.inArray(row.id, selectionIds) != -1;
});
return res;
}
function doClose(){
closeModal("MPointModel");
}
</script>
<div class="modal fade" id="MPointModel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" onclick="doClose();">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择测量点</h4>
</div>
<div class="modal-body " style="width:100%">
<div id="alertDiv"></div>
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
style="margin-right: 5px;">
<i class="fa fa-plus"></i></button>
</div>
<!-- /. tools -->
<i class="fa fa-search"></i>
</div>
<div class="box-body collapse" >
<form class="form-horizontal " id="searchForm_MPoint">
<div class="form-group" style="margin-right: 20px;">
<!-- <label class="col-sm-2 control-label">部门</label>
<div class="col-sm-4">
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
</div> -->
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" id="search_name_mpoint" name="search_name_mpoint" class="form-control input-sm" placeholder="名称" style="width:170px;">
</div>
</div>
<div class="form-group" style="margin-right: 20px;">
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchPatrolPoint();"><i class="fa fa-search"> 搜索</i></button>
</div>
</div>
</form>
</div>
</div>
<div>
<div id="table_patrolPoint4Select" style="height:230px;overflow:auto;width:100%"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" onclick="doClose();">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,35 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatisticsTreeJson.do', {unitId:unitId} , function(data) {
if(data.length>0){
$('#menu_select_tree').treeview({
data: data,
});
$('#menu_select_tree').on('nodeSelected', function(event, data) {
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
$('#${param.formId} #${param.textId}').val(data.text);
closeModal("menu4SelectModal")
});
}
},'json');
});
</script>
<div class="modal fade" id="menu4SelectModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">选择菜单</h4>
</div>
<div class="modal-body">
<div id="menu_select_tree" style="height:430px;overflow:auto;width:100%"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,101 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var showMenu4SelectFun = function() {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/showEfficiencyStatistics4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#menu4SelectDiv").html(data);
openModal("menu4SelectModal")
});
};
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/efficiency/efficiencyStatistics/dosave.do", $("#subForm").serialize(), function (result) {
if (result.code == 1) {
initTreeView();
//showAlert('s','保存成功');
} else {
showAlert('d', '保存失败');
}
},'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '顺序不能为空'
},
regexp: {
regexp: /^[0-9]*$/,
message: '顺序必须为数字'
}
}
}
}
});
$(function() {
// $("#active").select2({ minimumResultsForSearch: 10 }).val("启用").trigger("change");
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">新增</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${id}"/>
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${efficiencyStatistics.name }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showMenu4SelectFun()" value="${pname}">
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${efficiencyStatistics.morder}">
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,133 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<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>
<script type="text/javascript">
var selectMPint = function() {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/showMPoint4Select.do', {formId:'subForm',hiddenId:'mpointId',textId:'txt'} , function(data) {
$("#mpSubDiv").html(data);
openModal('mpSubModal');
});
};
var showMenu4SelectFun = function() {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/showEfficiencyStatistics4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#menu4SelectDiv").html(data);
openModal("menu4SelectModal")
});
};
function dosave() {
$.post(ext.contextPath + "/efficiency/efficiencyStatistics/doupdate.do", $("#subForm").serialize(), function(result) {
var data= $.parseJSON(result);
if (data.code == 1) {
initTreeView();
}else{
showAlert('d',data.result);
}
});
}
function dodel() {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/dodelete.do', $("#subForm").serialize(), function(result) {
// var data= $.parseJSON(result);
if(result.code==1){
initTreeView();
}else{
showAlert('d',result.msg);
}
},'json');
}
});
}
$(function() {
});
</script>
<div class="box box-primary" style="margin-bottom:0px;">
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${efficiencyStatistics.id}"/>
<input id="unitId" name="unitId" type="hidden" value="${efficiencyStatistics.unitId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv1"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${efficiencyStatistics.name }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showMenu4SelectFun()" value="${pname}">
<input id="pid" name="pid" type="hidden" value="${efficiencyStatistics.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${efficiencyStatistics.morder}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">测量点编号</label>
<div class="col-sm-4">
<!-- <input type="hidden" class="form-control" style="cursor: pointer" id="unitId" name="unitId" value="${curveMpoint.unitId}" >
<input type="hidden" class="form-control" style="cursor: pointer" id="mpcode" > -->
<input type="text" class="form-control" id="mpointId" name ="mpointId" onclick="selectMPint()" placeholder="单击选择" readonly value="${efficiencyStatistics.mPoint.mpointcode}">
</div>
<label class="col-sm-2 control-label">测量点名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="txt" value="${efficiencyStatistics.mPoint.parmname}" readonly>
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,186 @@
<%@ 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" %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
td{
text-align:center;
min-width: 100px;
height: 40px;
}
</style>
<script type="text/javascript">
var detailFun = function(id) {
var year = $("#yeartimeId").val();
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatisticsDetail.do', {id:id,unitId:unitId,year:year} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var calcTotal=function(table,column){//合计表格对象对哪一列进行合计第一列从0开始
var trs=table.getElementsByTagName('tr');
var start=3,//忽略第一行的表头
end=trs.length-3;//忽略最后合计的一行
var total=0;
var max=0;
var min=0;
for(var i=start;i<end;i++){
var td=trs[i].getElementsByTagName('td')[column];
var num = td.innerHTML.replace(/,/g,'');
var t=parseFloat(num);
if(t)total+=t;
if(t>max)max=t;
if(t<min)min=t;
}
trs[trs.length-3].getElementsByTagName('td')[column].innerHTML=max;
trs[trs.length-2].getElementsByTagName('td')[column].innerHTML=min;
trs[trs.length-1].getElementsByTagName('td')[column].innerHTML=Math.round(total/12);
};
calcTotal(document.getElementById('table'),1);
$(function() {
var table = document.getElementById('table');
var trs = table.getElementsByTagName('tr');
var tds = trs[trs.length-1].getElementsByTagName('td');
for (var i = 1; i < tds.length; i++) {
calcTotal(document.getElementById('table'),i);
}
});
</script>
<table border="2" cellspacing="0" cellpadding="8" style="table-layout:fixed;">
<!--标题-->
<!-- <caption>学生成绩表</caption> -->
<!--表格头部-->
<thead>
<tr>
<!--表格的列标题-->
<td>日期</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<td onclick="detailFun('${efficiencyStatisticsBig.id}')">${efficiencyStatisticsBig.name}</td>
</c:forEach>
</tr>
</thead>
<!--表格主体-->
<tbody>
<!--内容居中对齐-->
<tr>
<td>${year}</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>一月</td>
<c:forEach items="${list1}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>二月</td>
<c:forEach items="${list2}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>三月</td>
<c:forEach items="${list3}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>四月</td>
<c:forEach items="${list4}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>五月</td>
<c:forEach items="${list5}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>六月</td>
<c:forEach items="${list6}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>七月</td>
<c:forEach items="${list7}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>八月</td>
<c:forEach items="${list8}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>九月</td>
<c:forEach items="${list9}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十月</td>
<c:forEach items="${list10}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十一月</td>
<c:forEach items="${list11}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十二月</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
</tbody>
<!--表格脚部-->
<tfoot>
<tr>
<td>最大值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<td></td>
</c:forEach>
</tr>
<tr>
<td>最小值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<td></td>
</c:forEach>
</tr>
<tr>
<td>平均值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<td></td>
</c:forEach>
</tr>
</tfoot>
</table>

View File

@ -0,0 +1,235 @@
<%@ 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" %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
td{
text-align:center;
min-width: 100px;
height: 40px;
}
</style>
<script type="text/javascript">
var calcTotal=function(table,column){//合计表格对象对哪一列进行合计第一列从0开始
var trs=table.getElementsByTagName('tr');
var start=3,//忽略第一行的表头
end=trs.length-3;//忽略最后合计的一行
var total=0;
var max=0;
var min=0;
for(var i=start;i<end;i++){
var td=trs[i].getElementsByTagName('td')[column];
var num = td.innerHTML.replace(/,/g,'');
var t=parseFloat(num);
if(t)total+=t;
if(t>max)max=t;
if(t<min)min=t;
}
trs[trs.length-3].getElementsByTagName('td')[column].innerHTML=max;
trs[trs.length-2].getElementsByTagName('td')[column].innerHTML=min;
trs[trs.length-1].getElementsByTagName('td')[column].innerHTML=Math.round(total/12);
};
calcTotal(document.getElementById('table'),1);
$(function() {
var table = document.getElementById('table');
var trs = table.getElementsByTagName('tr');
var tds = trs[trs.length-1].getElementsByTagName('td');
for (var i = 1; i < tds.length; i++) {
calcTotal(document.getElementById('table'),i);
}
});
</script>
<table border="2" cellspacing="0" cellpadding="8" style="table-layout:fixed;">
<!--标题-->
<!-- <caption>学生成绩表</caption> -->
<!--表格头部-->
<thead>
<tr>
<!--表格的列标题-->
<td rowspan="2">日期</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<td colspan="${fn:length(efficiencyStatisticsBig.childList)+1}">${efficiencyStatisticsBig.name}</td>
</c:forEach>
</tr>
<tr>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td>${efficiencyStatisticsSmall.name}</td>
</c:forEach>
<td>合计</td>
</c:forEach>
</tr>
</thead>
<!--表格主体-->
<tbody>
<!--内容居中对齐-->
<tr>
<td>${year}</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>一月</td>
<c:forEach items="${list1}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>二月</td>
<c:forEach items="${list2}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>三月</td>
<c:forEach items="${list3}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>四月</td>
<c:forEach items="${list4}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>五月</td>
<c:forEach items="${list5}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>六月</td>
<c:forEach items="${list6}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>七月</td>
<c:forEach items="${list7}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>八月</td>
<c:forEach items="${list8}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>九月</td>
<c:forEach items="${list9}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十月</td>
<c:forEach items="${list10}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十一月</td>
<c:forEach items="${list11}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十二月</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
</tbody>
<!--表格脚部-->
<tfoot>
<tr>
<td>最大值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
<tr>
<td>最小值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
<tr>
<td>平均值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
</tfoot>
</table>

View File

@ -0,0 +1,252 @@
<%@ 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" %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
td{
text-align:center;
min-width: 100px;
height: 40px;
}
</style>
<script type="text/javascript">
var calcTotal=function(table,column){//合计表格对象对哪一列进行合计第一列从0开始
var trs=table.getElementsByTagName('tr');
var start=3,//忽略第一行的表头
end=trs.length-3;//忽略最后合计的一行
var total=0;
var max=0;
var min=0;
for(var i=start;i<end;i++){
var td=trs[i].getElementsByTagName('td')[column];
var num = td.innerHTML.replace(/,/g,'');
var t=parseFloat(num);
if(t)total+=t;
if(t>max)max=t;
if(t<min)min=t;
}
trs[trs.length-3].getElementsByTagName('td')[column].innerHTML=max;
trs[trs.length-2].getElementsByTagName('td')[column].innerHTML=min;
trs[trs.length-1].getElementsByTagName('td')[column].innerHTML=Math.round(total/12);
};
calcTotal(document.getElementById('table1'),1);
$(function() {
var table = document.getElementById('table1');
var trs = table.getElementsByTagName('tr');
var tds = trs[trs.length-1].getElementsByTagName('td');
for (var i = 1; i < tds.length; i++) {
calcTotal(document.getElementById('table1'),i);
}
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">${name}</h4>
</div>
<div class="modal-body" style="overflow-x:auto;">
<table id="table1" border="2" cellspacing="0" cellpadding="8" style="table-layout:fixed;">
<!--标题-->
<!-- <caption>学生成绩表</caption> -->
<!--表格头部-->
<thead>
<tr>
<!--表格的列标题-->
<td rowspan="2">日期</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<td colspan="${fn:length(efficiencyStatisticsBig.childList)+1}">${efficiencyStatisticsBig.name}</td>
</c:forEach>
</tr>
<tr>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td>${efficiencyStatisticsSmall.name}</td>
</c:forEach>
<td>合计</td>
</c:forEach>
</tr>
</thead>
<!--表格主体-->
<tbody>
<!--内容居中对齐-->
<tr>
<td>${year}</td>
<c:forEach items="${list}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>一月</td>
<c:forEach items="${list1}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>二月</td>
<c:forEach items="${list2}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>三月</td>
<c:forEach items="${list3}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>四月</td>
<c:forEach items="${list4}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>五月</td>
<c:forEach items="${list5}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>六月</td>
<c:forEach items="${list6}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>七月</td>
<c:forEach items="${list7}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>八月</td>
<c:forEach items="${list8}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>九月</td>
<c:forEach items="${list9}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十月</td>
<c:forEach items="${list10}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十一月</td>
<c:forEach items="${list11}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
<tr>
<td>十二月</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td><fmt:formatNumber value="${efficiencyStatisticsSmall.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
<td><fmt:formatNumber value="${efficiencyStatisticsBig.sum}" type="number" maxFractionDigits="0"/></td>
</c:forEach>
</tr>
</tbody>
<!--表格脚部-->
<tfoot>
<tr>
<td>最大值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
<tr>
<td>最小值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
<tr>
<td>平均值</td>
<c:forEach items="${list12}" var ="efficiencyStatisticsBig" varStatus="status">
<c:forEach items="${efficiencyStatisticsBig.childList}" var ="efficiencyStatisticsSmall" varStatus="status1">
<td></td>
</c:forEach>
<td></td>
</c:forEach>
</tr>
</tfoot>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,113 @@
<%@ 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>
<!-- 文件上传-->
<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>
<script type="text/javascript">
var addFun = function() {
var node=$('#tree').treeview('getSelected');
var pid="";
if(node!=null && node.length>0){
pid=node[0].id;
}else{
pid="-1";
}
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/doadd.do', {unitId:unitId,pid:pid} , function(data) {
$("#menuBox").html(data);
});
};
var editFun = function(id) {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/doedit.do', {id:id} , function(data) {
$("#menuBox").html(data);
});
};
var initTreeView = function() {
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatisticsTreeJson.do', {unitId:unitId} , function(data) {
//console.info(data)
$('#tree').treeview({data: data
});
$('#tree').on('nodeSelected', function(event, data) {
editFun(data.id);
//var node=$('#tree').treeview('getSelected');
});
},'json');
$("#menuBox").html("");
};
$(function() {
initTreeView();
});
</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 id="fileInputDiv"></div>
<div id="user4SelectDiv"></div>
<div id="mpSubDiv"></div>
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">能效配置</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body no-padding">
<div id="tree" style="height:550px;overflow:auto;"></div>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-md-9" id="menuBox">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
</html>

View File

@ -0,0 +1,162 @@
<%@ 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>
<script type="text/javascript">
var timer;
function changeData(){
console.log(1);
var year = $("#yeartimeId").val();
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatistics2.do', {unitId:unitId,year:year} , function(data) {
console.log(3);
window.clearInterval(timer);
$("#button").html("切换为总览");
// $("#button").on("click",changeBackData());
$("#button").attr("onclick","changeBackData()");
$("#table").html(data);
});
console.log(2);
$("#button").off("click");
$("#button").removeAttr("onclick");
$("#button").html("请稍后");
timer = window.setInterval("changePoint()", 1000);
}
function exportData() {
var year = $("#yeartimeId").val();
window.open(ext.contextPath + "/efficiency/efficiencyStatistics/exportExcel.do?unitId="+unitId
+"&year="+year);
}
function changeBackData(){
console.log(11);
var year = $("#yeartimeId").val();
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatistics1.do', {unitId:unitId,year:year} , function(data) {
console.log(33);
window.clearInterval(timer);
$("#button").html("切换为详细");
// $("#button").on("click",changeData());
$("#button").attr("onclick","changeData()");
$("#table").html(data);
});
console.log(22);
$("#button").off("click");
$("#button").removeAttr("onclick");
$("#button").html("请稍后");
timer = window.setInterval("changePoint()", 1000);
}
function changePoint () {
var str=$("#button").html();
str=str+"."
$("#button").text(str);
}
function chaDate(){
var year = $("#yeartimeId").val();
$.post(ext.contextPath + '/efficiency/efficiencyStatistics/getEfficiencyStatistics1.do', {unitId:unitId,year:year} , function(data) {
$("#button").html("切换为详细");
$("#table").html(data);
});
}
$(function() {
$('#yeartimeId').datepicker({
format: 'yyyy',
weekStart: 1,
autoclose: true,
startView: 2,
minViewMode: 2,
maxViewMode: 2,
forceParse: false,
language: 'zh-CN'
}).on('changeDate',changeData);
$(".date-picker").datepicker("update", new Date());
changeData()
});
</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 id="fileInputDiv"></div>
<div id="user4SelectDiv"></div>
<div id="mpSubDiv"></div>
<div class="btn-group" style="padding-bottom:10px;">
<div style="float: left;">
<label class="control-label" style="padding-top: 6px">年份</label>
</div>
<div style="float: left;">
<input class="form-control date-picker" id="yeartimeId" name="yeartimeId" autocomplete="off" type="text" placeholder="点击选择" style="background-color:#FFFFFF;width: 80px;" value=""/>
</div>
<div style="padding-left:20px;float: left;">
<button type="button" style="display: none" class="btn btn-default" id="button" onclick="changeData();"><!-- <i class="fa fa-plus"></i> --> 切换为详细</button>
</div>
<div style="padding-left:20px;float: left;">
<button type="button" class="btn btn-default" id="export" onclick="exportData();">导出</button>
</div>
</div>
<div id="table" style="overflow-x:auto;">
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
</html>

View File

@ -0,0 +1,253 @@
<%@ 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>
<style>
.legend {
width:10rem;
position: absolute;
bottom: 20px;
left: 10px;
text-align:center;
}
.legend-item{
width: 100%;
border-radius: 0.8rem;
}
.legend-text{
width: 100%;
height: 20px;
padding: 5px;
}
.efficiencySelect{
width:10rem;
position: absolute;
top: 20px;
left: 10px;
text-align:center;
}
body {
overflow-x: auto;
overflow-y: auto;
}
</style>
<script type="text/javascript">
var canvas;
var context;
var height;
var width;
var beauty;
var beautyPng;
var colors = ["RGBA(251,255,205,0.8)","RGBA(250,232,126,0.8)",
"RGBA(252,203,84,0.8)", "RGBA(251,169,97,0.8)",
"RGBA(232,75,34,0.8)","RGBA(175,0,18,0.8)"];
var masterId='';
var tbName='tb_efficiency_overviewConfigure_file'; //数据表
//获取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 () {
//type=1为热力图
$.post(ext.contextPath + '/efficiency/efficiencyOverviewConfigure/getJson.do', {unitId:unitId,type:"1"} , function(data) {
if(data.length>0){
masterId=data[0].id;
var upperlimit=data[0].upperlimit;
var lowerlimit=data[0].lowerlimit;
var grade=data[0].grade;
load(masterId);
$(window).resize(function(){
load(masterId);
});
for(var a=0;a<data.length;a++){
$("#efficiencySelect").append("<option value='"+data[a].id+"'>"+data[a].name+"</option>");
}
}
},'json');
});
function windowToCanvas(e) {
var x = e.x || e.clientX,
y = e.y || e.clientY,
bbox = canvas.getBoundingClientRect();
return { x: x - bbox.left * (canvas.width / bbox.width),
y: y - bbox.top * (canvas.height / bbox.height)
};
}
function drawBeauty(){
context.save();
context.drawImage(beauty, 0, 0, height/860*1690, height);
//点击获取坐标
canvas.onmousedown = function (e) {
var loc = windowToCanvas(e);
e.preventDefault(); // prevent cursor change
var lnglat = new Array;
lnglat[0]=loc.x;
lnglat[1]=loc.y;
console.log(lnglat);
};
}
function drawData(data){
//data = _.orderBy(data, "count",'desc');
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
context.drawImage(beauty, 0, 0, height/860*1690, height);
//定位等比例调整目前基于本地电脑846高度确定定位
//var scale = context.canvas.height/846;
var scale = height/860;
var legend = "";
legend = '<div class="legend-item" style="background-color:#AF0012;"><span class="legend-text" style="color:#fff;">8以上</span></div>'+
'<div class="legend-item" style="background-color:#E84B22;"><span class="legend-text" style="color:#fff;">6~8</span></div>'+
'<div class="legend-item" style="background-color:#FBA961;"><span class="legend-text">4~6</span></div>'+
'<div class="legend-item" style="background-color:#FAE87E;"><span class="legend-text">2~4</span></div>'+
'<div class="legend-item" style="background-color:#FBFFCD;"><span class="legend-text">0~2</span></div>';
$("#legend").html(legend);
if(data!=null && data!=undefined && data!=''){
context.save();
for(var i=0;i<data.length;i++){
var count = data[i].count;
var color="RGBA(175,0,18,0.8)";
//根据数据与最大值比例选择区域颜色
if(count>8){
color = colors[5];
};
if(count>6 && count<=8){
color = colors[4];
}
if(count>4 && count<=6){
color = colors[3];
}
if(count>2 && count<=4){
color = colors[1];
}
if(count<=2){
color = colors[0];
}
//绘制区域颜色
context.fillStyle = color;
context.strokeStyle = "RGBA(232,75,34,0.6)";
context.lineWidth=3;
//绘制区域开始
context.beginPath();
if(data[i].lnglats!=null
&& data[i].lnglats!=undefined
&& data[i].lnglats!=''){
var lnglats = eval(data[i].lnglats);
for(var a=0;a<lnglats.length;a++){
if(a==0){
//绘制区域初始坐标点
context.moveTo(lnglats[a][0]*scale, lnglats[a][1]*scale);
}else{
//绘制区域后续坐标点
context.lineTo(lnglats[a][0]*scale, lnglats[a][1]*scale);
}
}
}
//绘制区域结束
context.closePath();
context.fill();
context.stroke();
}
context.save();
context.drawImage(beautyPng, 0, 0, height/860*1690, height);
}
}
function load(masterId){
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
if(data.length>0){
var abspath=data[0].abspath.split('webapps');
picId=data[0].id;
canvas = document.getElementById("canvas");
context = canvas.getContext('2d');
height = $(window).height();
beauty = new Image();
beauty.src = ""+getRootPath()+""+abspath[1]+"";
beautyPng = new Image();
abspath = data[1].abspath.split('webapps');
beautyPng.src = ""+getRootPath()+""+abspath[1]+"";
//整体区域
$("#map").height(height);
$("#map").width(height/860*1690);
$("body").width(height/860*1690);
width = $(window).width();
document.getElementById('canvas').width=height/860*1690;
document.getElementById('canvas').height=height;
if(beauty.complete){
drawBeauty();
doMapData(picId);
}else{
beauty.onload = function(){
drawBeauty();
doMapData(picId);
};
beauty.onerror = function(){
alert('加载失败,请重试');
};
};
}
},'json');
}
function doMapData(picId){
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/getJson.do', {picId:picId,unitId:unitId} , function(mpdata) {
if(mpdata.length>0){
var list = new Array;
for(var m=0;m<mpdata.length;m++){
var lnglats= "["+mpdata[m].lnglats+"]";
var arr ={
"count" : mpdata[m].showParmValue,
"lnglats" : lnglats,
}
list.push(arr);
}
drawData(list);
}
},'json');
//手动测试
/* var list =[
{"count":1,"name":"2#鼓风机房","lnglats":[[765, 138],[791, 139],[791, 209],[765, 210]]}
,{"count":5,"name":"1#鼓风机房","lnglats":[[862, 243],[927, 243],[927, 394],[862, 395]]}
,{"count":12,"name":"污泥脱水机房","lnglats":[[1060, 79],[1204, 80],[1204, 145],[1060, 145]]}
[ [118, 514],[210, 514],[209, 659],[118, 659]]
[[276, 570],[342, 571],[341, 648],[277, 649]]
[[415, 514],[450, 513],[450, 661],[426, 663],[425, 627],[416, 626]]
[[1618, 585],[1650, 585],[1650, 672],[1618, 670]]
];
drawData(list); */
}
</script>
</head>
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
<div class="wrapper">
<div class="content-wrapper">
<!-- Main content -->
<section class="content container-fluid" style="padding:0;">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div role="tabpanel" class="tab-pane map active" id="map">
<canvas id="canvas"></canvas>
<div class="legend" id="legend"></div>
<div class="efficiencySelect">
<select class="form-control" id="efficiencySelect" onchange="load(this.value)"></select>
</div>
</div>
</section>
<!-- /.content -->
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,163 @@
<%@ 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.scada.MPoint"%>
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<!-- echarts-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.4.1.0.min.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>
<script type="text/javascript">
var beginTimeStore = '';
var endTimeStore = '';
$(function() {
var windowghight=$(window).height();
$('#mainDiv').attr("style","height:"+windowghight+"px;width:100%;padding-top:20px;");
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD HH:mm');
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
var locale = {
"format": 'YYYY-MM-DD HH:mm',
"separator": "~",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#reservationtime').daterangepicker({
timePicker: false,
timePicker24Hour: false,
linkedCalendars: false,
autoUpdateInput: false,
showDropdowns: true,
locale: locale,
//汉化按钮部分
ranges: {
'本月': [moment().startOf('month'), moment().endOf('month').subtract(0, 'month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(0, 'month')]
},
startDate: beginTimeStore,
endDate: endTimeStore
}, function(start, end, label) {
beginTimeStore = start.format(this.locale.format);
endTimeStore = end.format(this.locale.format);
if(!this.startDate){
this.element.val('');
}else{
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
}
// dosearch();
});
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
$.post(ext.contextPath + "/efficiency/waterSpreadData/getMpidDataType.do", {unitId:unitId}, function (data) {
$("#mpid").empty();
var select = $("#mpid").select2({
data: data,
placeholder: '请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
});
select.val(data[0].id).trigger("change");
dosearch();
}, 'json');
});
function dosearch(){
var id=$("#mpid").val();
$.post(ext.contextPath + "/efficiency/waterSpreadData/getDataJson.do", {id:id,sdt:beginTimeStore,edt:endTimeStore,unitId:unitId}, function (data) {
console.log(data);
var seriesdata=data.value;
var machart=echarts.init(document.getElementById('chart'));
var option = {
xAxis: {
scale: true,
max:23,
interval:1
},
yAxis: {
scale: true
},
series: [{
type: 'scatter',
data:seriesdata,
}]
};
machart.setOption(option,true);
}, 'json');
}
</script>
</head>
<body class="hold-transition ${cu.themeclass} sidebar-mini" style="overflow: hidden;">
<div class="box box-solid">
<div id="mainDiv" class="box-body ">
<div id="detailDataDiv" ></div>
<div style="width: 100%;height:45px;float: left;">
<div class="form-group form-inline" style="padding-left:10px;">
<div class="form-group" style="height: 40px;line-height: 40px;">
<label class="input-lable" >&nbsp;日期:</label>
<div class="input-group " >
<div class="input-group pull-right input-group-sm" >
<div class="input-group-addon">
<i class="fa fa-clock-o"></i>
</div>
<input type="text" class="form-control" id="reservationtime" style="width:225px" >
</div>
</div>
</div>
<div class="form-group" style="height: 40px;line-height: 40px;">
<label class="input-lable" >&nbsp;对比点:</label>
<div class="input-group " >
<div class="input-group pull-right input-group-sm" >
<select class="form-control select2" id="mpid" name="mpid"
style="width: 100%;line-height: 40px;"></select>
</div>
</div>
</div>
<div class="form-group" style="height: 40px;line-height: 40px;">
<button type="button" class="btn btn-default" onclick="dosearch();" ><i class="fa fa-search"></i> 查询</button>
</div>
</div>
</div>
<div style="width: 100%;height:calc(100% - 45px);float: left;">
<div id="chart" style="height:100%;"></div>
</div>
</div>
</div>
</body>
</html>