Files
2026-01-16 14:13:44 +08:00

9854 lines
395 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var mqttMpcode = "";
var switchHiddenPoints = "";
var switchAllPoints = [];
//人员定位自定义mq主题
var personnelPositioning_auto_mq_theme = [];
//摄像头_报警_自定义列表
var cameraAlarmList = [];
//摄像头_报警_自定义mq主题
var cameraAlarm_auto_mq_theme = [];
//svg_报警_自定义列表
var svgAlarmList = [];
//svg_报警_自定义mq主题
var svgAlarm_auto_mq_theme = [];
//任务点_报警_自定义mq主题
var taskPointslarm_auto_mq_theme = [];
/**
* 测量点组件 DI
*/
function showAssembly_mpdata_DI(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualMPoint/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
var datas = eval('(' + data + ')');
var parmValue = datas[0].mPoint.parmvalue;
var ledtype = datas[0].mPoint.ledtype;//DI的情况下类别状态 1运行点0故障点
var ledcolor = datas[0].mPoint.ledcolor;//颜色状态 1红开绿停0绿开红停;黄色永远表示故障
let signaltag = "";
if (datas[0].mPoint.signaltag != '') {
signaltag = datas[0].mPoint.signaltag;
}
let signaltag_color = "0"; //0绿色 1红色 2黄色 -1 透明
var showColor = "#000000";
if (ledtype == '1') {//运行点
if (ledcolor == '1') {//红开绿停
if (Number(parmValue) == 0) {
showColor = '#00ff00';//绿
signaltag_color = '0';
} else if (Number(parmValue) == 1) {
showColor = '#FF0000';//红
signaltag_color = '1';
} else if (Number(parmValue) == 2) {
showColor = 'yellow';
signaltag_color = '2';
}
} else if (ledcolor == '0') {//绿开红停
if (Number(parmValue) == 0) {
showColor = '#FF0000';//红
signaltag_color = '1';
} else if (Number(parmValue) == 1) {
showColor = '#00ff00';//绿
signaltag_color = '0';
} else if (Number(parmValue) == 2) {
showColor = 'yellow';
signaltag_color = '2';
}
}
} else if (ledtype == '0') {//故障点
//透明正常黄故障
if (Number(parmValue) == 0) {
showColor = 'transparent';
signaltag_color = '-1';
} else if (Number(parmValue) == 1) {
showColor = 'yellow';
signaltag_color = '2';
}
}
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
// if (content.isfull == 'true') {
// width = width.replace("%", "") + "%";
// height = height.replace("%", "") + "%";
// } else {
// if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
// width += "px";
// }
// if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
// height += "px";
// }
// }
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let showStyle = "style1";
if (datas[0].showStyle != null && datas[0].showStyle != '') {
showStyle = datas[0].showStyle;
}
if (showStyle == 'style1') {
divHtml += "<div " + onmouseupSt + " title=\"" + datas[0].mPoint.parmname + "\" style=\"cursor:move;color:" + datas[0].fontcolor + ";font-size:" + datas[0].fontsize + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editDI('" + content.id + "');\">";
divHtml += "<i class=\"fa fa-circle\" style=\"color:" + showColor + ";font-size:" + datas[0].fontsize + "px;\"></i>";
} else {
var width = "25px";
var height = "25px";
if (content.width != '') {
width = content.width;
}
if (content.height != '') {
height = content.height;
}
if (width.indexOf("%") < 0) {
width = width.replace("px", "") + "px";
}
if (height.indexOf("%") < 0) {
height = height.replace("px", "") + "px";
}
divHtml += "<div " + onmouseupSt + " title=\"" + datas[0].mPoint.parmname + "\" style=\"cursor:move;width:" + width + ";height:" + height + ";color:" + datas[0].fontcolor + ";font-size:" + datas[0].fontsize + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editDI('" + content.id + "');\">";
let img_path = "";
if (signaltag == 'KQWINDOW') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-黄.png";
}
} else if (signaltag == 'XHFAN') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-黄.png";
}
} else if (signaltag == 'CZFAN') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-黄.png";
}
}
divHtml += "<div style='position:absolute;width: 100%;height: 100%;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
}
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_mpdata_DI_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualMPoint/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// var datas = eval('(' + data + ')');
let parmValue = "0";
let ledtype = "1";//DI的情况下类别状态 1运行点0故障点
let ledcolor = "1";//颜色状态 1红开绿停0绿开红停;黄色永远表示故障
let parmName = "";
let mpid = "";
let signaltag = "";
if (showData.mPoint != null) {
parmValue = showData.mPoint.parmvalue;
ledtype = showData.mPoint.ledtype;//DI的情况下类别状态 1运行点0故障点
ledcolor = showData.mPoint.ledcolor;//颜色状态 1红开绿停0绿开红停;黄色永远表示故障
parmName = showData.mPoint.parmname;
mpid = showData.mPoint.id;
mqttMpcode = mqttMpcode + mpid + ",";
if (showData.mPoint.signaltag != null) {
if (showData.mPoint.signaltag != '') {
signaltag = showData.mPoint.signaltag;
}
}
}
let showColor = getDIColor(ledtype, ledcolor, parmValue);
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
let showStyle = "style1";
if (showData.showStyle != null && showData.showStyle != '') {
showStyle = showData.showStyle;
}
if (showStyle == 'style1') {
divHtml += "<div class=\"moveDiv\" eqid=\"" + showData.eqid + "\" title=\"" + parmName + "\" style=\"position:absolute;top:" + postY + ";left:" + postX + ";color:" + showData.fontcolor + ";font-size:" + showData.fontsize + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "<i id=\"" + mpid + "\" class=\"fa fa-circle\" style=\"color:" + showColor + ";font-size:" + showData.fontsize + "px;\"></i>";
} else {
let signaltag_color = "0"; //0绿色 1红色 2黄色 -1 透明
if (showColor == '#00ff00') {
signaltag_color = '0';
} else if (showColor == '#FF0000') {
signaltag_color = '1';
} else if (showColor == 'yellow') {
signaltag_color = '2';
}
var width = "25px";
var height = "25px";
if (content.width != '') {
width = content.width;
}
if (content.height != '') {
height = content.height;
}
if (width.indexOf("%") < 0) {
width = width.replace("px", "") + "px";
}
if (height.indexOf("%") < 0) {
height = height.replace("px", "") + "px";
}
divHtml += "<div class=\"moveDiv\" eqid=\"" + showData.eqid + "\" title=\"" + parmName + "\" style=\"position:absolute;width:" + width + ";height:" + height + ";top:" + postY + ";left:" + postX + ";color:" + showData.fontcolor + ";font-size:" + showData.fontsize + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
let img_path = "";
if (signaltag == 'KQWINDOW') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/开启窗-黄.png";
}
} else if (signaltag == 'XHFAN') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/循环风机-黄.png";
}
} else if (signaltag == 'CZFAN') {
if (signaltag_color == '0') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-绿.png";
} else if (signaltag_color == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-红.png";
} else if (signaltag_color == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/垂直风机-黄.png";
}
}
divHtml += "<div style='position:absolute;width: 100%;height: 100%;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
}
divHtml += "</div>";
// }
// });
return divHtml;
}
function getDIColor(ledtype, ledcolor, parmValue) {
let showColor = "#000000";
if (ledtype == '1') {//运行点
if (ledcolor == '1') {//红开绿停
if (Number(parmValue) == 0) {
showColor = '#00ff00';
} else if (Number(parmValue) == 1) {
showColor = '#FF0000';
} else if (Number(parmValue) == 2) {
showColor = 'yellow';
}
} else if (ledcolor == '0') {//绿开红停
if (Number(parmValue) == 0) {
showColor = '#FF0000';
} else if (Number(parmValue) == 1) {
showColor = '#00ff00';
} else if (Number(parmValue) == 2) {
showColor = 'yellow';
}
}
} else if (ledtype == '0') {//故障点
//透明正常黄故障
if (Number(parmValue) == 0) {
showColor = 'transparent';
} else if (Number(parmValue) == 1) {
showColor = 'yellow';
}
}
return showColor;
}
/**
* 测量点组件 AI
*/
function showAssembly_mpdata_AI(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualMPoint/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
var showData = data[0];
var parmValue = "0";
var unit = "";
if (showData.mPoint != null) {
parmValue = showData.mPoint.parmvalue;
if (showData.mPoint.unit != '') {
unit = showData.mPoint.unit;
}
}
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let onmouseupSt2 = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\" ";
onmouseupSt2 = "onmouseup=\"doUp2('" + content.id + "');\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let showStyle = "style1";
if (showData.showStyle != null && showData.showStyle != '') {
showStyle = showData.showStyle;
}
let signaltag = "";
if (showData.mPoint != null) {
if (showData.mPoint.signaltag != null) {
if (showData.mPoint.signaltag != '') {
signaltag = showData.mPoint.signaltag;
}
}
}
let titleSwitch = "true";
if (showData.titleSwitch != null && showData.titleSwitch != '') {
titleSwitch = showData.titleSwitch;
}
let unitSwitch = "true";
if (showData.unitSwitch != null && showData.unitSwitch != '') {
unitSwitch = showData.unitSwitch;
}
if (showStyle == 'style1') {
divHtml = "<div " + onmouseupSt + " title=\"" + showData.name + "" + parmValue + "" + unit + "\" style=\"padding:1px;font-size:" + showData.fontsize + "px;font-weight:" + showData.fontweight + ";color:" + showData.fontcolor + ";position:absolute;top:" + postY + ";left:" + postX + ";background-color:#7A7A7A;width:" + content.width + "px;height:" + content.height + "px;text-align:center;cursor: move;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editAI('" + content.id + "');\">";
if (titleSwitch == 'true' && unitSwitch == 'true') {
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + "\" style=\"background-color:#434343;cursor:move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.6);height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + showData.name + "</div>";
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + ":" + parmValue + "\" style=\"background-color: #000000;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.4);height:100%;color:#00ff00;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
divHtml += "<div " + onmouseupSt2 + " title=\"" + unit + "\" style=\"background-color:#434343;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40px;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + unit + "</div>";
}
if (titleSwitch == 'false' && unitSwitch == 'true') {
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + ":" + parmValue + "\" style=\"background-color: #000000;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*1);height:100%;color:#00ff00;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
divHtml += "<div " + onmouseupSt2 + " title=\"" + unit + "\" style=\"background-color:#434343;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40px;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + unit + "</div>";
}
if (titleSwitch == 'true' && unitSwitch == 'false') {
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + "\" style=\"background-color:#434343;cursor:move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:60%;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + showData.name + "</div>";
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + ":" + parmValue + "\" style=\"background-color: #000000;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40%;height:100%;color:#00ff00;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
}
if (titleSwitch == 'false' && unitSwitch == 'false') {
divHtml += "<div " + onmouseupSt2 + " title=\"" + showData.name + ":" + parmValue + "\" style=\"background-color: #000000;cursor: move;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:100%;height:100%;color:#00ff00;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
}
divHtml += "</div>";
} else {
let img_path = "";
if (signaltag == 'H2S') {
img_path = ext.contextPath + "/IMG/dataVisual/H2S.png";
} else if (signaltag == 'CH4') {
img_path = ext.contextPath + "/IMG/dataVisual/CH4.png";
} else if (signaltag == 'LT') {
img_path = ext.contextPath + "/IMG/dataVisual/LT.png";
} else if (signaltag == 'TT' || signaltag == 'HT') {
img_path = ext.contextPath + "/IMG/dataVisual/TT.png";
}
let showContent = parmValue;
if (unit != '') {
showContent += unit;
}
divHtml = "<div title=\"" + showData.name + "\" " + onmouseupSt2 + " style=\"padding:1px;position:absolute;top:" + postY + ";left:" + postX + ";width:" + content.width + "px;height:" + content.height + "px;z-index:" + content.zIndex + ";cursor: move;top:" + postY + ";left:" + postX + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editAI('" + content.id + "');\">";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div style='float: left;width: 100%;height: 24px;line-height: 20px;background: #D2ECFF;border: 2px solid #0d96ff;border-radius: 11px;color:#0D96FF;font-size: 12px;text-align: center;'>" + showContent + "</div>";
divHtml += "</div>";
}
}
});
return divHtml;
}
function showAssembly_mpdata_AI_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualMPoint/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// var datas = eval('(' + data + ')');
let parmValue = "0";
let unit = "";
let mpid = "";
let color = showData.textColor;
if (showData.mPoint != null) {
let mp = showData.mPoint;
parmValue = mp.parmvalue;
if (mp.unit != '') {
unit = mp.unit;
}
mpid = mp.id;
mqttMpcode = mqttMpcode + mpid + ",";
}
let style = "";
if (content.style != '') {
style = content.style;
}
let zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
let showStyle = "style1";
if (showData.showStyle != null && showData.showStyle != '') {
showStyle = showData.showStyle;
}
let signaltag = "";
if (showData.mPoint != null) {
if (showData.mPoint.signaltag != null) {
if (showData.mPoint.signaltag != '') {
signaltag = showData.mPoint.signaltag;
}
}
}
let titleSwitch = "true";
if (showData.titleSwitch != null && showData.titleSwitch != '') {
titleSwitch = showData.titleSwitch;
}
let unitSwitch = "true";
if (showData.unitSwitch != null && showData.unitSwitch != '') {
unitSwitch = showData.unitSwitch;
}
if (showStyle == 'style1') {
// divHtml="<div class=\"moveDiv\" title=\""+showData.name+""+parmValue+""+unit+"\" style=\"font-size:"+showData.fontsize+"px;font-weight:"+showData.fontweight+";color:"+showData.fontcolor+";position:absolute;top:"+content.posty+"px;left:"+content.postx+"px;background-color: "+showData.background+";width:"+content.width+"px;height:"+content.height+"px;text-align:center;line-height:"+content.height+"px;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;"+style+"\" id=\""+content.id+"\" name=\""+content.id+"\" ondblclick=\"showCurveForMp('"+content.id+"');\">"+showData.name+""+parmValue+""+unit+"</div>";
divHtml = "<div class=\"moveDiv\" title=\"" + showData.name + "" + parmValue + "" + unit + "\" style=\"padding:1px;font-size:" + showData.fontsize + "px;font-weight:" + showData.fontweight + ";color:" + showData.fontcolor + ";position:absolute;top:" + postY + ";left:" + postX + ";background-color:#7A7A7A;width:" + content.width + "px;height:" + content.height + "px;text-align:center;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"showCurveForMp('" + content.id + "');\">";
if (titleSwitch == 'true' && unitSwitch == 'true') {
divHtml += "<div title=\"" + showData.name + "\" style=\"background-color:#434343;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.6);height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + showData.name + "</div>";
divHtml += "<div class=\"" + mpid + "\" id=\"" + content.id + "value\" title=\"" + parmValue + "\" style=\"background-color: #000000;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.4);height:100%;color:" + color + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
divHtml += "<div title=\"" + unit + "\" style=\"background-color:#434343;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40px;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + unit + "</div>";
}
if (titleSwitch == 'false' && unitSwitch == 'true') {
divHtml += "<div class=\"" + mpid + "\" id=\"" + content.id + "value\" title=\"" + parmValue + "\" style=\"background-color: #000000;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*1);height:100%;color:" + color + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
divHtml += "<div title=\"" + unit + "\" style=\"background-color:#434343;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40px;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + unit + "</div>";
}
if (titleSwitch == 'true' && unitSwitch == 'false') {
divHtml += "<div title=\"" + showData.name + "\" style=\"background-color:#434343;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.6);height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + showData.name + "</div>";
divHtml += "<div id=\"" + content.id + "value\" title=\"" + parmValue + "\" style=\"background-color: #000000;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*0.4);height:100%;color:" + color + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
divHtml += "<div title=\"" + unit + "\" style=\"background-color:#434343;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:40px;height:100%;color:#ffffff;overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + unit + "</div>";
}
if (titleSwitch == 'false' && unitSwitch == 'false') {
divHtml += "<div class=\"" + mpid + "\" id=\"" + content.id + "value\" title=\"" + parmValue + "\" style=\"background-color: #000000;line-height:" + Number(content.height - 2) + "px;float:left;text-align:center;width:calc((100% - 40px)*1);height:100%;color:" + color + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;\">" + parmValue + "</div>";
}
divHtml += "</div>";
} else {
let img_path = "";
if (signaltag == 'H2S') {
img_path = ext.contextPath + "/IMG/dataVisual/H2S.png";
} else if (signaltag == 'CH4') {
img_path = ext.contextPath + "/IMG/dataVisual/CH4.png";
} else if (signaltag == 'LT') {
img_path = ext.contextPath + "/IMG/dataVisual/LT.png";
} else if (signaltag == 'TT' || signaltag == 'HT') {
img_path = ext.contextPath + "/IMG/dataVisual/TT.png";
}
let showContent = parmValue;
if (unit != '') {
showContent += unit;
}
divHtml = "<div title=\"" + showData.name + "\" style=\"padding:1px;position:absolute;top:" + postY + ";left:" + postX + ";width:" + content.width + "px;height:" + content.height + "px;z-index:" + content.zIndex + ";top:" + postY + ";left:" + postX + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div style='float: left;width: 100%;height: 24px;line-height: 20px;background: #D2ECFF;border: 2px solid #0d96ff;border-radius: 11px;color:#0D96FF;font-size: 12px;text-align: center;'>" + showContent + "</div>";
divHtml += "</div>";
}
// }
// });
return divHtml;
}
/**
* 文本组件
*/
function showAssembly_Text(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualText/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
var datas = eval('(' + data + ')');
var textContent = "";
let mpid = "";
if (datas[0].mpid != null && datas[0].mpid != "") {
mpid = datas[0].mpid;
}
if (mpid != "") {
textContent = mpid;
} else if (datas[0].urldata != null && datas[0].urldata != '') {
textContent = "urldata";
} else {
if (datas[0].textcontent != null && datas[0].textcontent != '') {
textContent = datas[0].textcontent;
}
}
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
// if (width.indexOf("{value}") >= 0) {
// width = width.replace("{value}", textContent);
// width = width.replace("px", "");
// width = eval('(' + width + ')');
// width += "px";
// }
var textHeight = (datas[0].textheight).replace("px", "") + "px";
// divHtml = "<div class=\"moveDiv reSize\" onmouseup=\"doUp2('" + content.id + "');\" title=\"" + textContent + "\" style=\"border:2px solid red;font-size:" + datas[0].fontsize + "px;font-weight:" + datas[0].fontweight + ";color:" + datas[0].fontcolor + ";background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";text-align:" + datas[0].textalign + ";cursor: move;line-height:" + textHeight + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editText('" + content.id + "');\">";
divHtml = "<div " + onmouseupSt + " title=\"" + textContent + "\" style=\"border:2px solid red;font-size:" + datas[0].fontsize + "px;font-weight:" + datas[0].fontweight + ";color:" + datas[0].fontcolor + ";background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";text-align:" + datas[0].textalign + ";line-height:" + textHeight + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editText('" + content.id + "');\">";
divHtml += textContent;
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_Text_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualText/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// var datas = eval('(' + data + ')');
var textContent = "";
let mpid = "";
if (showData.mpid != null && showData.mpid != "") {
mpid = showData.mpid;
}
if (mpid != "") {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: mpid,
// valuemethod: showData.valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
textContent = showData.textcontent;
//系数
if (showData.rate != null && showData.rate != "") {
let rate = showData.rate;
if ("+-*/".indexOf(rate.substring(0, 1)) == -1) {
rate = "*" + rate;
}
textContent = eval(textContent + rate);
}
if (showData.numtail != null && showData.numtail != "") {
textContent = Number(textContent).toFixed(Number(showData.numtail));
}
if (showData.unitst != '' && (showData.unitst == "true" || showData.unitst == "TRUE")) {
if (showData.mPoint.unit != null) {
textContent += showData.mPoint.unit;
}
}
// }
// });
mqttMpcode = mqttMpcode + mpid + ",";
} else if (showData.urldata != null && showData.urldata != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + showData.urldata,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
textContent = result.result;
if (showData.numtail != null && showData.numtail != "") {
textContent = Number(textContent).toFixed(Number(showData.numtail));
}
}
});
} else {
if (showData.textcontent != null && showData.textcontent != '') {
textContent = showData.textcontent;
}
}
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
if (width.indexOf("{value}") >= 0) {
width = width.replace("{value}", textContent);
width = width.replace("px", "");
width = eval('(' + width + ')');
width += "px";
}
var clickName = "";
var clickparameter = "";
var onmouseoverAndoutName = "";
var onmouseoverAndoutparameter = "";
if (showData.clickname != '' && showData.clickname != '-') {
clickName = showData.clickname;
style += "cursor:pointer;";
if (showData.clickparameter != '') {
if (clickName == 'showFrame') {
clickparameter = "'" + showData.clickparameter + "'";
} else if (clickName == 'openFrame') {
clickparameter = "'" + showData.clickparameter + "'";
} else if (clickName == 'tabFrame') {
clickparameter = "'" + showData.clickparameter + "'";
}
}
if (clickName == 'openLine') {
let chartMpid = mpid;
if (showData.chartmpids != null && showData.chartmpids != '') {
chartMpid = showData.chartmpids;
}
clickparameter = "'" + chartMpid + "'";
} else if (clickName == 'roundTime') {
clickName = "";
onmouseoverAndoutName = "showRoundtimeOne";
onmouseoverAndoutparameter = "'" + showData.roundtimeid + "'";
}
if (showData.urlstring != '' && clickName == 'showFrame') {
clickName = "reFrame";
clickparameter = "'" + showData.urlstring + "'";
} else if (showData.urlstring != '' && clickName == 'openFrame') {
clickName = "urlClick";
clickparameter = "'openFrame','" + showData.urlstring + "'";
} else if (showData.urlstring != '' && clickName == 'tabFrame') {
let tabFrameUrls = showData.urlstring.split(",");
let tabFrameName = "标签页";
if (tabFrameUrls.length > 1) {
tabFrameName = tabFrameUrls[1];
}
clickName = "urlClick";
clickparameter = "'tabFrame','" + tabFrameUrls[0] + "','" + showData.id + "','" + tabFrameName + "'";
}
}
var textHeight = (showData.textheight).replace("px", "") + "px";
divHtml = "<div title=\"" + textContent + "\" onmouseover=\"" + onmouseoverAndoutName + "(" + onmouseoverAndoutparameter + ",'in');\" onmouseout=\"" + onmouseoverAndoutName + "(" + onmouseoverAndoutparameter + ",'out');\" style=\"font-size:" + showData.fontsize + "px;font-weight:" + showData.fontweight + ";color:" + showData.fontcolor + ";background-color: " + showData.background + ";width:" + width + ";height:" + height + ";text-align:" + showData.textalign + ";line-height:" + textHeight + ";overflow: hidden;text-overflow:ellipsis; white-space: nowrap;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" class=\"" + mpid + "\" onclick=\"" + clickName + "(" + clickparameter + ");\" >";
// if (clickName != '' && clickName != '-') {
// divHtml += "<a style=\"text-decoration:underline;color:" + showData.fontcolor + ";\">" + textContent + "</a>";
// } else {
// divHtml += textContent;
// }
divHtml += textContent;
divHtml += "</div>";
// }
// });
return divHtml;
}
/**
* 摄像头组件
*/
function showAssembly_Camera(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualCamera/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
var datas = eval('(' + data + ')');
var color = datas[0].color;
var camera = datas[0].camera;
var showContent = "";
var cameraId = "";
var cameraName = "";
if (camera != null) {
cameraId = camera.id;
cameraName = camera.name;
if (camera.style == '0') {//枪机
showContent += "<svg class=\"icon\" viewBox=\"0 0 1024 1024\" width=\"" + content.width + "\" height=\"" + content.height + "\">";
showContent += "<path fill=\"" + color + "\" d=\"M1024.2 480L861.9 710c-9.3 13.2-21.5 23.7-35.4 30.9-13.9 7.2-29.5 11.1-45.7 11.1-18.7 0-37-5.3-52.8-15.2L98.4 341.5C87.8 334.8 79.2 325.6 73.3 315c-5.9-10.7-9.1-22.8-9.1-35.3 0-15.3 4.8-30.3 13.8-42.8l117.6-163c9.3-12.9 21.4-23.1 35.1-30.1 13.7-7 29.1-10.8 45-10.8 18.4 0 36.4 5.1 52.1 14.8L1024.2 480zM754.1 768c-11.1 0-22-1.5-32.6-4.5-10.6-3-20.7-7.4-30.2-13.2l-611.8-373c-6.7-4.1-15.3 0.7-15.3 8.6v22.6c0 14.6 7.6 28.2 20 35.8l182.5 112.3C241.2 572 224.2 600 224.2 632c0 20.2 6.8 38.8 18.3 53.7a62.518 62.518 0 0 1-44.2 18.3H64.2v-46.8c0-29-19.5-54.4-47.6-61.9L0.2 591l-0.2 369 28.8-14.3c21.7-10.8 35.5-33 35.5-57.3V768h135.5c25.9 0 50.8-10.3 69.2-28.7l3.1-3.1c10.6-10.6 25-16.3 40-16.3h0.2c46.4 0 84.4-35.9 87.8-81.4L674.2 807.2c9.2 5.7 19.9 8.7 30.7 8.7 9.8 0 19.3-2.5 27.7-6.9 8.4-4.5 15.7-11 21.1-19.2l6.8-10.1c3.2-5-0.4-11.7-6.4-11.7zM312.2 656c-13.2 0-24-10.8-24-24s10.8-24 24-24 24 10.8 24 24-10.8 24-24 24z\" ></path>";
showContent += "</svg>";
} else if (camera.style == '1') {//球机
showContent += "<svg class=\"icon\" viewBox=\"0 0 1024 1024\" width=\"" + content.width + "\" height=\"" + content.height + "\">";
showContent += "<path fill=\"" + color + "\" d=\"M969.4 532.9c-16.2 10.3-26.8 27.3-29 46.4-22.6 197-205.2 350.6-427.6 350.6-221.6 0-403.7-152.7-427.3-349-2.3-18.7-12.7-35.6-28.5-45.8-2.2-1.4-4.4-2.8-6.5-4.3C20.1 510 1.9 475.5 1.4 438.6c-0.6-44.5 0.1-104.1 0.7-150 0.6-47.1 27.1-90.1 69-111.8 206.5-106.9 673-108.3 882.4-0.4 42.5 21.9 69.4 65.7 69.4 113.6v146.2c0 38.4-19.1 74.4-51.3 95.3-0.8 0.5-1.5 0.9-2.2 1.4z m-617 251.4c22 37.2 91.1 65.7 160.4 65.7s136.9-26.9 158.8-64l-0.7-210c-14.8-73-81.1-126.1-158.1-126.1s-145.7 53.7-160.4 126.8v207.6z m574.8-533.8C767 157.4 298 150.8 100 248.5c-10.8 5.3-17.6 16.3-17.8 28.3-0.3 32.8-0.9 92.2 1.5 115.6 151.5-95.3 703.3-93.9 859.4 0V278.1c0.1-11.4-6-21.9-15.9-27.6zM512.8 609.9c43.9 0 79.7 39.4 79.7 88.1 0 48.7-35.7 88.1-79.7 88.1s-79.7-39.4-79.7-88.1c-0.1-48.7 35.7-88.1 79.7-88.1z\"></path>";
showContent += "</svg>";
}
}
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " class=\"moveDiv\" title=\"" + cameraName + "\" style=\"width:" + (Number(content.width)) + "px;height:" + (Number(content.height) * 2) + "px;cursor: move;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editCrame('" + content.id + "');\">";
divHtml += "<div style=\"float:left;color:" + color + ";width:" + content.width + "px;height:" + content.height + "px;\">" + showContent + "</div>"
divHtml += "<div style=\"float:left;color:" + color + ";width:" + content.width + "px;height:" + content.height + "px;text-align:center;\">" + camera.name + "</div>"
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_Camera_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualCamera/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// var datas = eval('(' + data + ')');
var color = showData.color;
var camera = showData.camera;
var showContent = "";
var cameraId = "";
var cameraName = "";
if (camera != null) {
cameraId = camera.id;
cameraName = camera.name;
if (camera.style == '0') {//枪机
showContent += "<svg id='" + showData.cameraid + "' fill=\"" + color + "\" class=\"icon\" viewBox=\"0 0 1024 1024\" width=\"" + content.width + "\" height=\"" + content.height + "\">";
showContent += "<path d=\"M1024.2 480L861.9 710c-9.3 13.2-21.5 23.7-35.4 30.9-13.9 7.2-29.5 11.1-45.7 11.1-18.7 0-37-5.3-52.8-15.2L98.4 341.5C87.8 334.8 79.2 325.6 73.3 315c-5.9-10.7-9.1-22.8-9.1-35.3 0-15.3 4.8-30.3 13.8-42.8l117.6-163c9.3-12.9 21.4-23.1 35.1-30.1 13.7-7 29.1-10.8 45-10.8 18.4 0 36.4 5.1 52.1 14.8L1024.2 480zM754.1 768c-11.1 0-22-1.5-32.6-4.5-10.6-3-20.7-7.4-30.2-13.2l-611.8-373c-6.7-4.1-15.3 0.7-15.3 8.6v22.6c0 14.6 7.6 28.2 20 35.8l182.5 112.3C241.2 572 224.2 600 224.2 632c0 20.2 6.8 38.8 18.3 53.7a62.518 62.518 0 0 1-44.2 18.3H64.2v-46.8c0-29-19.5-54.4-47.6-61.9L0.2 591l-0.2 369 28.8-14.3c21.7-10.8 35.5-33 35.5-57.3V768h135.5c25.9 0 50.8-10.3 69.2-28.7l3.1-3.1c10.6-10.6 25-16.3 40-16.3h0.2c46.4 0 84.4-35.9 87.8-81.4L674.2 807.2c9.2 5.7 19.9 8.7 30.7 8.7 9.8 0 19.3-2.5 27.7-6.9 8.4-4.5 15.7-11 21.1-19.2l6.8-10.1c3.2-5-0.4-11.7-6.4-11.7zM312.2 656c-13.2 0-24-10.8-24-24s10.8-24 24-24 24 10.8 24 24-10.8 24-24 24z\" ></path>";
showContent += "</svg>";
} else if (camera.style == '1') {//球机
showContent += "<svg id='" + showData.cameraid + "' fill=\"" + color + "\" class=\"icon\" viewBox=\"0 0 1024 1024\" width=\"" + content.width + "\" height=\"" + content.height + "\">";
showContent += "<path d=\"M969.4 532.9c-16.2 10.3-26.8 27.3-29 46.4-22.6 197-205.2 350.6-427.6 350.6-221.6 0-403.7-152.7-427.3-349-2.3-18.7-12.7-35.6-28.5-45.8-2.2-1.4-4.4-2.8-6.5-4.3C20.1 510 1.9 475.5 1.4 438.6c-0.6-44.5 0.1-104.1 0.7-150 0.6-47.1 27.1-90.1 69-111.8 206.5-106.9 673-108.3 882.4-0.4 42.5 21.9 69.4 65.7 69.4 113.6v146.2c0 38.4-19.1 74.4-51.3 95.3-0.8 0.5-1.5 0.9-2.2 1.4z m-617 251.4c22 37.2 91.1 65.7 160.4 65.7s136.9-26.9 158.8-64l-0.7-210c-14.8-73-81.1-126.1-158.1-126.1s-145.7 53.7-160.4 126.8v207.6z m574.8-533.8C767 157.4 298 150.8 100 248.5c-10.8 5.3-17.6 16.3-17.8 28.3-0.3 32.8-0.9 92.2 1.5 115.6 151.5-95.3 703.3-93.9 859.4 0V278.1c0.1-11.4-6-21.9-15.9-27.6zM512.8 609.9c43.9 0 79.7 39.4 79.7 88.1 0 48.7-35.7 88.1-79.7 88.1s-79.7-39.4-79.7-88.1c-0.1-48.7 35.7-88.1 79.7-88.1z\"></path>";
showContent += "</svg>";
}
}
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div title=\"" + cameraName + "\" style=\"width:" + (Number(content.width)) + "px;height:" + (Number(content.height)) + "px;cursor:pointer;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"viewCameraFun('" + cameraId + "');\">";
divHtml += "<div style=\"float:left;color:" + color + ";width:" + content.width + "px;height:" + content.height + "px;\">" + showContent + "</div>"
divHtml += "</div>";
if (showData.mqTheme != '') {
let addthemeSt = true;
if (cameraAlarm_auto_mq_theme.length > 0) {
for (let i = 0; i < cameraAlarm_auto_mq_theme.length; i++) {
if (cameraAlarm_auto_mq_theme[i] == showData.mqTheme) {
addthemeSt = false;
}
}
if (addthemeSt) {
cameraAlarm_auto_mq_theme.push(showData.mqTheme);
}
} else {
cameraAlarm_auto_mq_theme.push(showData.mqTheme);
}
}
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualCameraAlarm/getJson.do?pid=" + showData.id,
async: false,
error: function () {
return false;
},
success: function (data) {
var datas = eval('(' + data + ')');
cameraAlarmList.push({
id: showData.cameraid,
child: datas
})
}
});
return divHtml;
}
/**
* 表格组件
*/
function showAssembly_Form(content) {
var style = content.style;
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
// var divwidth = content.width;
// var divheight = content.height;
// let postX = content.postx;
// let postY = content.posty;
// if (postX.indexOf("%") < 0) {
// postX += "px";
// }
// if (postY.indexOf("%") < 0) {
// postY += "px";
// }
// if (divwidth.indexOf("px") < 0 && divwidth.indexOf("%") < 0) {
// divwidth += "px";
// }
// if (divheight.indexOf("px") < 0 && divheight.indexOf("%") < 0) {
// divheight += "px";
// }
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;position:absolute;top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";cursor: move;padding:2px;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"showContainerForm('" + content.id + "');\">";
divHtml += "<table id=\"" + content.id + "choiceTable\" class=\"" + content.id + "choiceTable\" draggable=\"false\" style=\"width: 100%;height: 100%;border-collapse: collapse;cursor: pointer;table-layout: fixed;\">";
//table-layout: fixed;
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualForm/getJson.do?pid=" + content.id + "&unitId=" + unitId,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
data = eval('(' + data + ')');
for (var i = 0; i < data.length; i++) {
var r = data[i];
divHtml += "<tr >"
if (r.nodes != '') {
for (var j = 0; j < r.nodes.length; j++) {
let c = r.nodes[j];
let tdStyle = c.style;
let width = c.width + "%";
let height = c.height + "%";
let bkcolor = c.background;
let textcontent = "";
// if (c.textcontent != null && c.textcontent != '') {
// textcontent = c.textcontent;
// }
if (c.formSql != null && c.formSql == 'true') {
textcontent = "s";
} else if (c.mpid != null && c.mpid != '') {
textcontent = "m";
} else if (c.urldata != null && c.urldata != '') {
textcontent = "u";
} else {
if (c.textcontent != null && c.textcontent != '') {
textcontent = c.textcontent;
}
}
let fontsize = (c.fontsize).replace("px", "") + "px";
let fontcolor = c.fontcolor;
let textalign = c.textalign;
let verticalalign = c.verticalalign;
if (verticalalign == "center") {
verticalalign = "middle";
}
let fontweight = c.fontweight;
let border = c.border;
if (border != '') {
tdStyle += border;
}
let borderradius = c.borderradius;
if (borderradius != '') {
tdStyle += borderradius;
}
let padding = c.padding;
if (padding != '') {
tdStyle += padding;
}
divHtml += "<td id=" + c.id + " title=\"" + textcontent + "\" frameId=" + content.id + " rowspan=" + c.rows + " colspan=" + c.columns + " showRow=" + (r.insertRow) + " showColumn=" + (c.insertColumn) + " ondblclick=\"containerFormEdit('" + c.id + "','" + content.id + "');\" ";
divHtml += "style=\"width:" + width + ";height:" + height + ";background:" + bkcolor + ";font-size:" + fontsize + ";color:" + fontcolor + ";text-align:" + textalign + ";vertical-align:" + verticalalign + ";font-weight:" + fontweight + ";white-space: nowrap;text-overflow: ellipsis;overflow: hidden;" + tdStyle + "\" > ";
divHtml += "" + textcontent + "</td>";
}
}
divHtml += "</tr>";
}
}
});
divHtml += "</table>";
divHtml += "</div>";
return divHtml;
}
var roundtimecontentList = "";
var formSqlPointList = [];
var formRowStyleList = [];
function showAssembly_Form_View(content, showData) {
var style = content.style;
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var divwidth = content.width;
var divheight = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (divwidth.indexOf("px") < 0 && divwidth.indexOf("%") < 0) {
divwidth += "px";
}
if (divheight.indexOf("px") < 0 && divheight.indexOf("%") < 0) {
divheight += "px";
}
if (content.roundtimecontent != null && content.roundtimecontent != '') {
style += "display:none;";
roundtimecontentList += content.id + ",";
} else {
style += "display:block;";
}
var divHtml = "<div style=\"position:absolute;top:" + postY + ";left:" + postX + ";width:" + divwidth + ";height:" + divheight + ";" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "<table id=\"" + content.id + "choiceTable\" class=\"" + content.id + "choiceTable\" style=\"width: 100%;height: 100%;border-collapse: collapse;table-layout: fixed;\">";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualForm/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// data = eval('(' + data + ')');
for (var i = 0; i < showData.length; i++) {
var r = showData[i];
divHtml += "<tr >"
if (r.nodes != '') {
for (var j = 0; j < r.nodes.length; j++) {
let c = r.nodes[j];
let tdStyle = c.style;
let width = c.width + "%";
let height = c.height + "%";
let bkcolor = c.background;
let textcontent = "";
let fontsize = (c.fontsize).replace("px", "") + "px";
let fontcolor = c.fontcolor;
let textalign = c.textalign;
let verticalalign = c.verticalalign;
if (verticalalign == "center") {
verticalalign = "middle";
}
let fontweight = c.fontweight;
let border = c.border;
if (border != '') {
tdStyle += border;
}
let borderradius = c.borderradius;
if (borderradius != '') {
tdStyle += borderradius;
}
let padding = c.padding;
if (padding != '') {
tdStyle += padding;
}
if (c.formSql != null && c.formSql != '') {
// console.log(c.formSql)
formSqlPointList.push(c.formSql)
}
if (c.showStyle != null && c.showStyle != '') {
formRowStyleList.push(c.showStyle);
}
if (c.mpid != null && c.mpid != '') {
let mp = c.textcontent;
// console.log(mp)
if (c.timest != null && c.timest != "" && c.timest == 'true') {
let timestnum = "";
if (c.timestnum != null && c.timestnum != "") {
if (c.timestnum.indexOf(",") >= 0) {
timestnum = c.timestnum;
} else {
timestnum = "0," + c.timestnum;
}
}
let timestnumS = timestnum.split(",");
textcontent = mp.substring(Number(timestnumS[0]), Number(timestnumS[1]));
} else {
textcontent = mp;
//系数
if (c.rate != null && c.rate != "") {
let rate = c.rate;
if ("+-*/".indexOf(rate.substring(0, 1)) == -1) {
rate = "*" + rate;
}
textcontent = eval(textcontent + rate);
}
if (c.numtail != null && c.numtail != "") {
textcontent = Number(textcontent).toFixed(Number(c.numtail));
}
if (c.unitst != '' && c.unitst == "true") {
if (mp.unit != null) {
textcontent += mp.unit;
}
}
}
// console.log(textcontent)
mqttMpcode = mqttMpcode + c.mpid + ",";
} else if (c.urldata != null && c.urldata != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + c.urldata,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
textcontent = result.result;
if (c.numtail != null && c.numtail != "") {
textcontent = Number(textcontent).toFixed(Number(c.numtail));
}
}
});
} else {
if (c.textcontent != null && c.textcontent != '') {
textcontent = c.textcontent;
}
}
divHtml += "<td id=" + c.id + " class=\"" + c.mpid + "\" title=\"" + textcontent + "\" frameId=" + content.id + " rowspan=" + c.rows + " colspan=" + c.columns + " showRow=" + (r.insertRow) + " showColumn=" + (c.insertColumn) + " ";
divHtml += "style=\"width:" + width + ";height:" + height + ";text-overflow: ellipsis;white-space: nowrap;overflow:hidden;background:" + bkcolor + ";font-size:" + fontsize + ";color:" + fontcolor + ";text-align:" + textalign + ";vertical-align:" + verticalalign + ";font-weight:" + fontweight + ";" + tdStyle + "\" > ";
divHtml += "" + textcontent + "</td>";
}
}
divHtml += "</tr>";
}
// }
// });
divHtml += "</table>";
divHtml += "</div>";
return divHtml;
}
/**
* 折线图组件
*/
function showAssembly_LineChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualLineChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editLineChart('" + content.id + "');\">";
divHtml += "<i class=\"fa fa-line-chart\"></i>";
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_LineChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualLineChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let onmouseupSt = "";
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showLineChart(contentId, refreshtime, showData, showSeriesData, showYAxisData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualLineChart/getChartJson.do?contentId=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
var dataVisualLineChart = showData;
var dataVisualLineChartSeries = showSeriesData;
var dataVisualLineChartYAxis = showYAxisData;
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let colors = dataVisualLineChart.colors.split(',');
let titleData = [];
let titleColor = "";
if (dataVisualLineChart.titleColor != null && dataVisualLineChart.titleColor != '') {
titleColor = dataVisualLineChart.titleColor
}
let titleFontSize = "18";
if (dataVisualLineChart.titleFontSize != null && dataVisualLineChart.titleFontSize != '') {
titleFontSize = dataVisualLineChart.titleFontSize
}
let titleFontWeight = "bolder";
if (dataVisualLineChart.titleFontWeight != null && dataVisualLineChart.titleFontWeight != '') {
titleFontWeight = dataVisualLineChart.titleFontWeight
}
let subtitleColor = "#aaa";
if (dataVisualLineChart.subtitleColor != null && dataVisualLineChart.subtitleColor != '') {
subtitleColor = dataVisualLineChart.subtitleColor
}
let subtitleFontSize = "12";
if (dataVisualLineChart.subtitleFontSize != null && dataVisualLineChart.subtitleFontSize != '') {
subtitleFontSize = dataVisualLineChart.subtitleFontSize
}
let subtitleFontWeight = "normal";
if (dataVisualLineChart.subtitleFontWeight != null && dataVisualLineChart.subtitleFontWeight != '') {
subtitleFontWeight = dataVisualLineChart.subtitleFontWeight
}
titleData.push({
text: dataVisualLineChart.titleText,
textStyle: {
// color: titleColor,
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
subtext: dataVisualLineChart.subtitleText,
subtextStyle: {
color: subtitleColor,
fontSize: subtitleFontSize,
fontWeight: subtitleFontWeight
},
left: dataVisualLineChart.titlePosition
})
if (titleColor != '') {
titleData[0].textStyle.color = titleColor;
}
let datazoomst = [];
if (dataVisualLineChart.datazoomst == 'true') {
datazoomst.push({
type: 'inside',
start: 0,
end: 100
})
datazoomst.push({
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: '50%',
height: '25px',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
})
}
let xAxisData = [];
let xaxisd = "";
if (dataVisualLineChart.xaxisdata != null && dataVisualLineChart.xaxisdata != '') {
xaxisd = dataVisualLineChart.xaxisdata;
}
let xaxislinecolor = "#ccc";
if (dataVisualLineChart.xaxislinecolor != null && dataVisualLineChart.xaxislinecolor != '') {
xaxislinecolor = dataVisualLineChart.xaxislinecolor;
}
let xaxisaxislabelfontsize = "12";
if (dataVisualLineChart.xaxisaxislabelfontsize != null && dataVisualLineChart.xaxisaxislabelfontsize != '') {
xaxisaxislabelfontsize = dataVisualLineChart.xaxisaxislabelfontsize;
}
let xaxisaxislabelcolor = "#ccc";
if (dataVisualLineChart.xaxisaxislabelcolor != null && dataVisualLineChart.xaxisaxislabelcolor != '') {
xaxisaxislabelcolor = dataVisualLineChart.xaxisaxislabelcolor;
}
let xaxissplitlinetype = "solid";
if (dataVisualLineChart.xaxissplitlinetype != null && dataVisualLineChart.xaxissplitlinetype != '') {
xaxissplitlinetype = dataVisualLineChart.xaxissplitlinetype;
}
let xaxissplitlinecolor = "#ccc";
if (dataVisualLineChart.xaxissplitlinecolor != null && dataVisualLineChart.xaxissplitlinecolor != '') {
xaxissplitlinecolor = dataVisualLineChart.xaxissplitlinecolor;
}
let xaxisLabel = [];
let xaxistype = dataVisualLineChart.xaxistype;
if (xaxistype == 'time') {
xaxisLabel = ({
show: eval(dataVisualLineChart.xaxisaxislabelshow.toLowerCase()),
fontSize: xaxisaxislabelfontsize,
color: xaxisaxislabelcolor,
formatter: {
none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'
}
})
} else {
xaxisLabel = ({
show: eval(dataVisualLineChart.xaxisaxislabelshow.toLowerCase()),
fontSize: xaxisaxislabelfontsize,
color: xaxisaxislabelcolor
})
}
if (xaxisd != '') {
xAxisData.push({
data: xaxisd.split(","),
type: dataVisualLineChart.xaxistype,
boundaryGap: false,
axisLine: {
show: eval(dataVisualLineChart.xaxislineshow.toLowerCase()),
lineStyle: {
color: xaxislinecolor
}
},
axisTick: {
show: eval(dataVisualLineChart.xaxisaxistickshow.toLowerCase())
},
splitLine: {
show: eval(dataVisualLineChart.xaxissplitlineshow.toLowerCase()),
lineStyle: {
color: xaxissplitlinecolor,
type: xaxissplitlinetype
}
},
axisLabel: xaxisLabel
})
} else {
xAxisData.push({
type: dataVisualLineChart.xaxistype,
boundaryGap: false,
axisLine: {
show: eval(dataVisualLineChart.xaxislineshow.toLowerCase()),
lineStyle: {
color: xaxislinecolor
}
},
axisTick: {
show: eval(dataVisualLineChart.xaxisaxistickshow.toLowerCase())
},
splitLine: {
show: eval(dataVisualLineChart.xaxissplitlineshow.toLowerCase()),
lineStyle: {
color: xaxissplitlinecolor,
type: xaxissplitlinetype
}
},
axisLabel: xaxisLabel
})
}
let legendDataD = [];
let series = [];
let reMpids = "";
let selectedSt = {};
for (let i = 0; i < dataVisualLineChartSeries.length; i++) {
let seriesData = dataVisualLineChartSeries[i];
legendDataD.push(seriesData.name);
let markPointData = [];
let markLineData = [];
let maxshow = seriesData.maxshow;
if (maxshow == "true") {
markPointData.push({
type: "max",
name: "最大值"
})
}
let minshow = seriesData.minshow;
if (minshow == "true") {
markPointData.push({
type: "min",
name: "最小值"
})
}
let avgshow = seriesData.avgshow;
if (avgshow == "true") {
markLineData.push({
type: "average",
name: "平均值",
label: {
position: 'insideEndTop'
}
})
}
if (seriesData.markerline != null && seriesData.markerline != '') {
let markerlines = seriesData.markerline.split(",");
for (let m = 0; m < markerlines.length; m++) {
markLineData.push({
label: {
position: 'insideEndTop'
},
yAxis: markerlines[m]
})
}
}
let stackst = "";
if (seriesData.stackst != null && seriesData.stackst != '') {
stackst = seriesData.stackst
}
let areaStyleData = [];
if (seriesData.areastyle == "true") {
areaStyleData.push({
opacity: 0.2
})
} else if (seriesData.areastyle == "false") {
areaStyleData.push({
opacity: 0
})
}
let symbolst = "none";
if (seriesData.symbolst == "true") {
symbolst = "emptyCircle";
}
let mpid = "";
if (seriesData.mpid != null && seriesData.mpid != '') {
mpid = seriesData.mpid;
reMpids += mpid + ",";
}
let seriesPushData = [];
if (seriesData.ishistorydata == 'true') {
let timerange = seriesData.timerange;
let lsdt = "";
let ledt = "";
if (timerange != 'dateSelect') {
let nowTime = getNowTime();
lsdt = "";
ledt = nowTime;
if (timerange == "hour") {
lsdt = getPlusTime(nowTime, -1, 'hour');
} else if (timerange == "day") {
lsdt = getPlusTime(nowTime, -1, 'day');
} else if (timerange == "week") {
lsdt = getPlusTime(nowTime, -7, 'day');
} else if (timerange == "month") {
lsdt = getPlusTime(nowTime, -1, 'month');
} else if (timerange == "year") {
lsdt = getPlusTime(nowTime, -1, 'year');
ledt = ledt.substring(0, 4) + "-12-31 23:59";
}
} else {
lsdt = sdt;
ledt = edt;
}
let xsubstring = "all";
if (dataVisualLineChart.xsubstring != null && dataVisualLineChart.xsubstring != '') {
xsubstring = dataVisualLineChart.xsubstring;
}
$.ajax({
type: 'GET',
url: ext.contextPath + "/data/getDetailDataForEXAndDV.do",
async: false,
globle: false,
data: {
mpcode: mpid,
sdt: lsdt,
edt: ledt,
timerange: timerange,
xsubstring: xsubstring
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
for (let i = 0; i < result.length; i++) {
seriesPushData.push(result[i].data);
}
}
});
seriesPushData = seriesPushData[0];
} else {
if (mpid != "") {
let mpids = mpid.split(",");
for (let i = 0; i < mpids.length; i++) {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
async: false,
globle: false,
data: {
mpid: mpids[i]
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
let mp = result[0];
seriesPushData.push(mp.parmvalue);
}
});
}
} else if (seriesData.urldata != null && seriesData.urldata != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + seriesData.urldata,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
seriesPushData.push(result.result);
seriesPushData = seriesPushData[0];
}
});
} else {
let fixedvalue = "";
if (seriesData.fixedvalue != null && seriesData.fixedvalue != '') {
fixedvalue = seriesData.fixedvalue;
}
seriesPushData = fixedvalue.split(",");
}
}
series.push({
data: seriesPushData,
symbol: symbolst,
name: seriesData.name,
type: 'line',
stack: stackst,
smooth: true,
markPoint: {
data: markPointData
},
markLine: {
data: markLineData
},
areaStyle: areaStyleData[0],
yAxisIndex: seriesData.yaxisindex
})
let selecteSt = "true";
if (seriesData.selectst != '') {
selecteSt = seriesData.selectst;
}
selectedSt[seriesData.name] = eval(selecteSt.toLowerCase());
}
let yAxis = [];
let leftMorder = 0;
let rightMorder = 0;
for (let i = 0; i < dataVisualLineChartYAxis.length; i++) {
let yAxisData = dataVisualLineChartYAxis[i];
let offset = 0;
let position = yAxisData.position;
if (position == 'left') {
offset = leftMorder * 40;
leftMorder++;
} else if (position == 'right') {
offset = rightMorder * 40;
rightMorder++;
}
let linecolor = "#ccc";
if (yAxisData.linecolor != null && yAxisData.linecolor != '') {
linecolor = yAxisData.linecolor;
}
let axislabelcolor = "#ccc";
if (yAxisData.axislabelcolor != null && yAxisData.axislabelcolor != '') {
axislabelcolor = yAxisData.axislabelcolor;
}
let axislabelfontsize = "12";
if (yAxisData.axislabelfontsize != null && yAxisData.axislabelfontsize != '') {
axislabelfontsize = yAxisData.axislabelfontsize;
}
let yaxissplitlinetype = "solid";
if (yAxisData.splitlinetype != null && yAxisData.splitlinetype != '') {
yaxissplitlinetype = yAxisData.splitlinetype;
}
let yaxissplitlinecolor = "#ccc";
if (yAxisData.splitlinecolor != null && yAxisData.splitlinecolor != '') {
yaxissplitlinecolor = yAxisData.splitlinecolor;
}
yAxis.push({
type: 'value',
name: yAxisData.unit,
position: position,
offset: offset,//循环显示Y轴位置
axisLine: {
show: eval(yAxisData.lineshow.toLowerCase()),
lineStyle: {
color: linecolor
}
},
axisTick: {
show: eval(yAxisData.axistickshow.toLowerCase())
},
splitLine: {
show: eval(yAxisData.splitlineshow.toLowerCase()),
lineStyle: {
color: yaxissplitlinecolor,
type: yaxissplitlinetype
}
},
axisLabel: {
show: eval(yAxisData.axislabelshow.toLowerCase()),
color: axislabelcolor,
fontSize: axislabelfontsize
},
scale: eval(yAxisData.scale.toLowerCase())//设置成 true 后坐标刻度不会强制包含零刻度。
});
if (yAxisData.max != null && yAxisData.max != '') {
yAxis[i].max = yAxisData.max
}
if (yAxisData.min != null && yAxisData.min != '') {
yAxis[i].min = yAxisData.min
}
// console.log(yAxis[i])
}
let legendData = [];
let legendShow = eval("true".toLowerCase());
let legendPosition = "center";
let legendTextFontsize = "12";
let legendSt = dataVisualLineChart.legendPosition;
if (legendSt == 'false') {
legendShow = eval("false".toLowerCase());
} else {
legendPosition = legendSt;
legendShow = eval("true".toLowerCase());
if (dataVisualLineChart.legendTextFontsize != '') {
legendTextFontsize = dataVisualLineChart.legendTextFontsize;
}
}
let xsubstring = "all";
if (dataVisualLineChart.xsubstring != null && dataVisualLineChart.xsubstring != '') {
xsubstring = dataVisualLineChart.xsubstring;
}
legendData.push({
show: legendShow,
data: legendDataD,
left: legendPosition,
textStyle: {
color: colors,
fontSize: legendTextFontsize
},
selected: selectedSt
})
let option = {
color: colors,
animation: false,
title: titleData,
legend: legendData,
grid: {
left: '10px', // 与容器左侧的距离
right: '10px', // 与容器右侧的距离
top: '60px', // 与容器顶部的距离
bottom: '15px', // 与容器底部的距离
containLabel: true
},
xAxis: xAxisData,
yAxis: yAxis,
series: series,
tooltip: {
trigger: 'axis'
},
dataZoom: datazoomst
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
if (refreshtime != null && refreshtime != '' && refreshtime != '0') {
if (reMpids != '') {
reMpids = reMpids.substring(0, reMpids.length - 1);
reMpids = reMpids.split(",");
setInterval(function () {
for (var i = 0; i < reMpids.length; i++) {
let seriesData = dataVisualLineChartSeries[i];
if (seriesData.ishistorydata == 'true') {
let timerange = seriesData.timerange;
let lsdt = "";
let ledt = "";
if (timerange != 'dateSelect') {
let nowTime = getNowTime();
lsdt = "";
ledt = nowTime;
if (timerange == "hour") {
lsdt = getPlusTime(nowTime, -1, 'hour');
} else if (timerange == "day") {
lsdt = getPlusTime(nowTime, -1, 'day');
} else if (timerange == "week") {
lsdt = getPlusTime(nowTime, -7, 'day');
} else if (timerange == "month") {
lsdt = getPlusTime(nowTime, -1, 'month');
} else if (timerange == "year") {
lsdt = getPlusTime(nowTime, -1, 'year');
}
} else {
lsdt = sdt;
ledt = edt;
}
// console.log(reMpids[i]);
$.ajax({
type: 'GET',
url: ext.contextPath + "/data/getDetailDataForEXAndDV.do",
async: false,
globle: false,
data: {
mpcode: reMpids[i],
sdt: lsdt,
edt: ledt,
timerange: timerange,
xsubstring: xsubstring
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
option.series[i].data = result[0].data;
// myChart.setOption({
// series: [{
// data: result[0].data
// }]
// });
// myChart.appendData({
// seriesIndex: i,
// data: result[0].data
// });
//刷新
myChart.setOption(option, true);
}
});
} else {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
async: false,
globle: false,
data: {
mpid: reMpids[i]
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
var mpvalue = new Array();
mpvalue[0] = result[0].parmvalue;
option.series[i].data = mpvalue;
//刷新
myChart.setOption(option, true);
}
});
}
}
}, Number(refreshtime) * 30000);
}
}
// }
// });
}
/**
* 柱状图组件
*/
function showAssembly_BarChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualBarChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editBarChart('" + content.id + "');\">";
divHtml += "<i class=\"fa fa-bar-chart\"></i>";
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_BarChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualBarChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let onmouseupSt = "";
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showBarChart(contentId, refreshtime, showData, showSeriesData, showYAxisData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualBarChart/getChartJson.do?contentId=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
// if (data != '' && data.length == 3) {
var dataVisualBarChart = showData;
var dataVisualBarChartSeries = showSeriesData;
var dataVisualBarChartYAxis = showYAxisData;
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let colors = dataVisualBarChart.colors.split(',');
let titleData = [];
let titleColor = "";
if (dataVisualBarChart.titleColor != null && dataVisualBarChart.titleColor != '') {
titleColor = dataVisualBarChart.titleColor
}
let titleFontSize = "18";
if (dataVisualBarChart.titleFontSize != null && dataVisualBarChart.titleFontSize != '') {
titleFontSize = dataVisualBarChart.titleFontSize
}
let titleFontWeight = "bolder";
if (dataVisualBarChart.titleFontWeight != null && dataVisualBarChart.titleFontWeight != '') {
titleFontWeight = dataVisualBarChart.titleFontWeight
}
let subtitleColor = "#aaa";
if (dataVisualBarChart.subtitleColor != null && dataVisualBarChart.subtitleColor != '') {
subtitleColor = dataVisualBarChart.subtitleColor
}
let subtitleFontSize = "12";
if (dataVisualBarChart.subtitleFontSize != null && dataVisualBarChart.subtitleFontSize != '') {
subtitleFontSize = dataVisualBarChart.subtitleFontSize
}
let subtitleFontWeight = "normal";
if (dataVisualBarChart.subtitleFontWeight != null && dataVisualBarChart.subtitleFontWeight != '') {
subtitleFontWeight = dataVisualBarChart.subtitleFontWeight
}
titleData.push({
text: dataVisualBarChart.titleText,
textStyle: {
// color: titleColor,
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
subtext: dataVisualBarChart.subtitleText,
subtextStyle: {
color: subtitleColor,
fontSize: subtitleFontSize,
fontWeight: subtitleFontWeight
},
left: dataVisualBarChart.titlePosition
})
if (titleColor != '') {
titleData[0].textStyle.color = titleColor;
}
let datazoomst = [];
if (dataVisualBarChart.datazoomst == 'true') {
datazoomst.push({
type: 'inside',
start: 0,
end: 100
})
datazoomst.push({
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: '50%',
height: '25px',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
})
}
let xAxisData = [];
let xaxisd = "";
if (dataVisualBarChart.xaxisdata != null && dataVisualBarChart.xaxisdata != '') {
xaxisd = dataVisualBarChart.xaxisdata;
}
let xaxislinecolor = "#ccc";
if (dataVisualBarChart.xaxislinecolor != null && dataVisualBarChart.xaxislinecolor != '') {
xaxislinecolor = dataVisualBarChart.xaxislinecolor;
}
let xaxisaxislabelfontsize = "12";
if (dataVisualBarChart.xaxisaxislabelfontsize != null && dataVisualBarChart.xaxisaxislabelfontsize != '') {
xaxisaxislabelfontsize = dataVisualBarChart.xaxisaxislabelfontsize;
}
let xaxisaxislabelcolor = "#ccc";
if (dataVisualBarChart.xaxisaxislabelcolor != null && dataVisualBarChart.xaxisaxislabelcolor != '') {
xaxisaxislabelcolor = dataVisualBarChart.xaxisaxislabelcolor;
}
let xsubstring = "all";
if (dataVisualBarChart.xsubstring != null && dataVisualBarChart.xsubstring != '') {
xsubstring = dataVisualBarChart.xsubstring;
}
let direction = "0";
if (dataVisualBarChart.direction != null && dataVisualBarChart.direction != '') {
direction = dataVisualBarChart.direction
}
let xaxisLabel = [];
let xaxistype = dataVisualBarChart.xaxistype;
if (xaxistype == 'time') {
xaxisLabel = ({
show: eval(dataVisualBarChart.xaxisaxislabelshow.toLowerCase()),
fontSize: xaxisaxislabelfontsize,
color: xaxisaxislabelcolor,
formatter: {
none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'
}
})
} else {
xaxisLabel = ({
show: eval(dataVisualBarChart.xaxisaxislabelshow.toLowerCase()),
fontSize: xaxisaxislabelfontsize,
color: xaxisaxislabelcolor
})
}
if (direction == '0') {
if (xaxisd != '') {
xAxisData.push({
data: xaxisd.split(","),
type: dataVisualBarChart.xaxistype,
axisLine: {
show: eval(dataVisualBarChart.xaxislineshow.toLowerCase()),
lineStyle: {
color: xaxislinecolor
}
},
axisTick: {
show: eval(dataVisualBarChart.xaxisaxistickshow.toLowerCase())
},
splitLine: {
show: eval(dataVisualBarChart.xaxissplitlineshow.toLowerCase())
},
axisLabel: xaxisLabel
})
} else {
xAxisData.push({
type: dataVisualBarChart.xaxistype,
axisLine: {
show: eval(dataVisualBarChart.xaxislineshow.toLowerCase()),
lineStyle: {
color: xaxislinecolor
}
},
axisTick: {
show: eval(dataVisualBarChart.xaxisaxistickshow.toLowerCase())
},
splitLine: {
show: eval(dataVisualBarChart.xaxissplitlineshow.toLowerCase())
},
axisLabel: xaxisLabel
})
}
} else if (direction == '1') {
xAxisData.push({
type: "value",
axisLine: {
show: eval(dataVisualBarChart.xaxislineshow.toLowerCase()),
lineStyle: {
color: xaxislinecolor
}
},
axisTick: {
show: eval(dataVisualBarChart.xaxisaxistickshow.toLowerCase())
},
splitLine: {
show: eval(dataVisualBarChart.xaxissplitlineshow.toLowerCase())
},
axisLabel: xaxisLabel
})
}
let legendDataD = [];
let series = [];
let reMpids = [];
let selectedSt = {};
for (let i = 0; i < dataVisualBarChartSeries.length; i++) {
let seriesData = dataVisualBarChartSeries[i];
legendDataD.push(seriesData.name);
let markPointData = [];
let markBarData = [];
let maxshow = seriesData.maxshow;
if (maxshow == "true") {
markPointData.push({
type: "max",
name: "最大值"
})
}
let minshow = seriesData.minshow;
if (minshow == "true") {
markPointData.push({
type: "min",
name: "最小值"
})
}
let avgshow = seriesData.avgshow;
if (avgshow == "true") {
markBarData.push({
type: "average",
name: "平均值",
label: {
position: 'insideEndTop'
}
})
}
if (seriesData.markerline != null && seriesData.markerline != '') {
let markerlines = seriesData.markerline.split(",");
for (let m = 0; m < markerlines.length; m++) {
markBarData.push({
label: {
position: 'insideEndTop'
},
yAxis: markerlines[m]
})
}
}
let stackst = "";
if (seriesData.stackst != null && seriesData.stackst != '') {
stackst = seriesData.stackst
}
let mpid = "";
if (seriesData.mpid != null && seriesData.mpid != '') {
mpid = seriesData.mpid;
reMpids.push(mpid);
}
let seriesPushData = [];
if (seriesData.ishistorydata == 'true') {
let timerange = seriesData.timerange;
let lsdt = "";
let ledt = "";
if (timerange != 'dateSelect') {
let nowTime = getNowTime();
lsdt = "";
ledt = nowTime;
if (timerange == "hour") {
lsdt = getPlusTime(nowTime, -1, 'hour');
} else if (timerange == "day") {
lsdt = getPlusTime(nowTime, -1, 'day');
} else if (timerange == "week") {
lsdt = getPlusTime(nowTime, -7, 'day');
} else if (timerange == "month") {
lsdt = getPlusTime(nowTime, -1, 'month');
} else if (timerange == "year") {
lsdt = getPlusTime(nowTime, -1, 'year');
ledt = ledt.substring(0, 4) + "-12-31 23:59";
}
} else {
lsdt = sdt;
ledt = edt;
}
$.ajax({
type: 'GET',
url: ext.contextPath + "/data/getDetailDataForEXAndDV.do",
async: false,
globle: false,
data: {
mpcode: mpid,
sdt: lsdt,
edt: ledt,
timerange: timerange,
xsubstring: xsubstring
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
for (let i = 0; i < result.length; i++) {
seriesPushData.push(result[i].data);
}
}
});
seriesPushData = seriesPushData[0];
} else {
if (mpid != "") {
let mpids = mpid.split(",");
for (let i = 0; i < mpids.length; i++) {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
async: false,
globle: false,
data: {
mpid: mpids[i]
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
let mp = result[0];
seriesPushData.push(mp.parmvalue);
}
});
}
} else if (seriesData.urldata != null && seriesData.urldata != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + seriesData.urldata,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
seriesPushData.push(result.result);
seriesPushData = seriesPushData[0];
}
});
} else {
let fixedvalue = "";
if (seriesData.fixedvalue != null && seriesData.fixedvalue != '') {
fixedvalue = seriesData.fixedvalue;
}
seriesPushData = fixedvalue.split(",");
}
}
let barwidth = "";
if (seriesData.barwidth != null && seriesData.barwidth != '') {
barwidth = seriesData.barwidth;
}
let borderradius = "";
if (seriesData.borderradius != null && seriesData.borderradius != '') {
if (seriesData.borderradius.indexOf(",") >= 0) {
borderradius = eval('(' + seriesData.borderradius + ')');
} else {
borderradius = Number(seriesData.borderradius);
}
}
let bkstylecolor = "";
let showBackground = "";
if (seriesData.bkstylecolor != null && seriesData.bkstylecolor != '') {
showBackground = eval("true".toLowerCase());
bkstylecolor = seriesData.bkstylecolor;
} else {
showBackground = eval("false".toLowerCase());
}
let bkstyleborderradius = "";
if (seriesData.bkstyleborderradius != null && seriesData.bkstyleborderradius != '') {
if (seriesData.bkstyleborderradius.indexOf(",") >= 0) {
bkstyleborderradius = eval('(' + seriesData.bkstyleborderradius + ')');
} else {
bkstyleborderradius = Number(seriesData.bkstyleborderradius);
}
}
let stype = "bar";
if (seriesData.type != null && seriesData.type != '') {
stype = seriesData.type
}
let labelposition = "false";
if (seriesData.labelposition != null && seriesData.labelposition != '') {
labelposition = seriesData.labelposition
}
let labelpositionSt = 'false';
if (labelposition != 'false') {
labelpositionSt = 'true';
}
let labelpositionfontsize = "12";
if (seriesData.labelpositionfontsize != null && seriesData.labelpositionfontsize != '') {
labelpositionfontsize = seriesData.labelpositionfontsize
}
let labelpositioncolor = "#ccc";
if (seriesData.labelpositioncolor != null && seriesData.labelpositioncolor != '') {
labelpositioncolor = seriesData.labelpositioncolor
}
let labelpositionunit = "";
if (seriesData.labelpositionunit != null && seriesData.labelpositionunit != '') {
labelpositionunit = seriesData.labelpositionunit
}
series.push({
data: seriesPushData,
name: seriesData.name,
type: stype,
stack: stackst,
smooth: true,
barWidth: barwidth,
// barGap:bargap,
itemStyle: {
borderRadius: borderradius
},
markPoint: {
data: markPointData
},
markLine: {
data: markBarData
},
showBackground: showBackground,
backgroundStyle: {
color: bkstylecolor,
borderRadius: bkstyleborderradius
},
yAxisIndex: seriesData.yaxisindex,
label: {
show: eval(labelpositionSt.toLowerCase()),
position: labelposition,
color: labelpositioncolor,
fontSize: labelpositionfontsize,
formatter: function (params) {
if (params.value.length > 1) {
return params.value[1] + labelpositionunit
} else {
return params.value + labelpositionunit
}
}
}
})
if (i == 0) {
if (seriesData.bargap != null && seriesData.bargap != '') {
series[0].barGap = seriesData.bargap;
}
}
let selecteSt = "true";
if (seriesData.selectst != '') {
selecteSt = seriesData.selectst;
}
selectedSt[seriesData.name] = eval(selecteSt.toLowerCase());
}
let yAxis = [];
let leftMorder = 0;
let rightMorder = 0;
for (let i = 0; i < dataVisualBarChartYAxis.length; i++) {
let yAxisData = dataVisualBarChartYAxis[i];
let offset = 0;
let position = yAxisData.position;
if (position == 'left') {
offset = leftMorder * 40;
leftMorder++;
} else if (position == 'right') {
offset = rightMorder * 40;
rightMorder++;
}
let linecolor = "#ccc";
if (yAxisData.linecolor != null && yAxisData.linecolor != '') {
linecolor = yAxisData.linecolor;
}
let axislabelcolor = "#ccc";
if (yAxisData.axislabelcolor != null && yAxisData.axislabelcolor != '') {
axislabelcolor = yAxisData.axislabelcolor;
}
let axislabelfontsize = "12";
if (yAxisData.axislabelfontsize != null && yAxisData.axislabelfontsize != '') {
axislabelfontsize = yAxisData.axislabelfontsize;
}
if (direction == '0') {
yAxis.push({
type: 'value',
name: yAxisData.unit,
position: position,
offset: offset,//循环显示Y轴位置
axisLine: {
show: eval(yAxisData.lineshow.toLowerCase()),
lineStyle: {
color: linecolor
}
},
axisTick: {
show: eval(yAxisData.axistickshow.toLowerCase())
},
splitLine: {
show: eval(yAxisData.splitlineshow.toLowerCase())
},
axisLabel: {
show: eval(yAxisData.axislabelshow.toLowerCase()),
color: axislabelcolor,
fontSize: axislabelfontsize
},
scale: eval(yAxisData.scale.toLowerCase())//设置成 true 后坐标刻度不会强制包含零刻度。
});
} else if (direction == '1') {
if (xaxisd != '') {
yAxis.push({
data: xaxisd.split(","),
type: dataVisualBarChart.xaxistype,
name: yAxisData.unit,
position: position,
offset: offset,//循环显示Y轴位置
axisLine: {
show: eval(yAxisData.lineshow.toLowerCase()),
lineStyle: {
color: linecolor
}
},
axisTick: {
show: eval(yAxisData.axistickshow.toLowerCase())
},
splitLine: {
show: eval(yAxisData.splitlineshow.toLowerCase())
},
axisLabel: {
show: eval(yAxisData.axislabelshow.toLowerCase()),
color: axislabelcolor,
fontSize: axislabelfontsize
},
scale: eval(yAxisData.scale.toLowerCase())//设置成 true 后坐标刻度不会强制包含零刻度。
})
} else {
yAxis.push({
type: dataVisualBarChart.xaxistype,
name: yAxisData.unit,
position: position,
offset: offset,//循环显示Y轴位置
axisLine: {
show: eval(yAxisData.lineshow.toLowerCase()),
lineStyle: {
color: linecolor
}
},
axisTick: {
show: eval(yAxisData.axistickshow.toLowerCase())
},
splitLine: {
show: eval(yAxisData.splitlineshow.toLowerCase())
},
axisLabel: {
show: eval(yAxisData.axislabelshow.toLowerCase()),
color: axislabelcolor,
fontSize: axislabelfontsize
},
scale: eval(yAxisData.scale.toLowerCase())//设置成 true 后坐标刻度不会强制包含零刻度。
})
}
}
if (yAxisData.max != null && yAxisData.max != '') {
yAxis[i].max = yAxisData.max
}
if (yAxisData.min != null && yAxisData.min != '') {
yAxis[i].min = yAxisData.min
}
// console.log(yAxis[i])
}
let legendData = [];
let legendShow = eval("true".toLowerCase());
let legendPosition = "center";
let legendTextFontsize = "12";
let legendSt = dataVisualBarChart.legendPosition;
if (legendSt == 'false') {
legendShow = eval("false".toLowerCase());
} else {
legendPosition = legendSt;
legendShow = eval("true".toLowerCase());
if (dataVisualBarChart.legendTextFontsize != '') {
legendTextFontsize = dataVisualBarChart.legendTextFontsize;
}
}
legendData.push({
show: legendShow,
data: legendDataD,
left: legendPosition,
textStyle: {
color: colors,
fontSize: legendTextFontsize
},
selected: selectedSt
})
let option = {
color: colors,
animation: false,
title: titleData,
legend: legendData,
grid: {
left: '0px', // 与容器左侧的距离
right: '0px', // 与容器右侧的距离
top: '60px', // 与容器顶部的距离
bottom: '15px', // 与容器底部的距离
containLabel: true
},
xAxis: xAxisData,
yAxis: yAxis,
series: series,
tooltip: {
trigger: 'axis'
},
dataZoom: datazoomst
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
if (refreshtime != null && refreshtime != '' && refreshtime != '0') {
if (reMpids.length > 0) {
setInterval(function () {
for (var i = 0; i < reMpids.length; i++) {
let seriesData = dataVisualBarChartSeries[i];
if (seriesData.ishistorydata == 'true') {
let timerange = seriesData.timerange;
let lsdt = "";
let ledt = "";
if (timerange != 'dateSelect') {
let nowTime = getNowTime();
lsdt = "";
ledt = nowTime;
if (timerange == "hour") {
lsdt = getPlusTime(nowTime, -1, 'hour');
} else if (timerange == "day") {
lsdt = getPlusTime(nowTime, -1, 'day');
} else if (timerange == "week") {
lsdt = getPlusTime(nowTime, -7, 'day');
} else if (timerange == "month") {
lsdt = getPlusTime(nowTime, -1, 'month');
} else if (timerange == "year") {
lsdt = getPlusTime(nowTime, -1, 'year');
}
} else {
lsdt = sdt;
ledt = edt;
}
// console.log(reMpids[i]);
$.ajax({
type: 'GET',
url: ext.contextPath + "/data/getDetailDataForEXAndDV.do",
async: false,
globle: false,
data: {
mpcode: reMpids[i],
sdt: lsdt,
edt: ledt,
timerange: timerange
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
option.series[i].data = result[0].data;
//刷新
myChart.setOption(option, true);
}
});
} else {
for (let i = 0; i < reMpids.length; i++) {
let nowmpids = reMpids[i].split(",");
let barNhisData = [];
for (let j = 0; j < nowmpids.length; j++) {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
async: false,
globle: false,
data: {
mpid: nowmpids[j]
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
barNhisData.push(result[0].parmvalue);
}
});
}
option.series[i].data = barNhisData;
//刷新
myChart.setOption(option, true);
}
}
}
}, Number(refreshtime) * 30000);
}
}
// }
// }
// });
}
/**
* 分值环图组件
*/
function showAssembly_PercentChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualPercentChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editPercentChart('" + content.id + "');\">";
divHtml += "<svg t='1632552511161' class='icon' viewBox='0 0 1024 1024' version='1.1' p-id='3303' data-spm-anchor-id='a313x.7781069.0.i12' width='16' height='16'>";
divHtml += "<path d='M512 901.94598388C296.94262695 901.94598388 122.05401612 727.05737305 122.05401612 512S296.94262695 122.05401612 512 122.05401612s389.94598388 174.88861084 389.94598388 389.94598388-174.88861084 389.94598388-389.94598388 389.94598388z m0-682.86895752c-161.29302979 0-292.92297364 131.62994385-292.92297364 292.92297364s131.62994385 292.92297364 292.92297364 292.92297363 292.92297364-131.62994385 292.92297364-292.92297363S673.29302979 219.07702636 512 219.07702636z' fill='#DEDEE1' p-id='3304'></path>";
divHtml += "<path d='M832.7321167 679.47283935c-26.57318115 0-48.8204956-21.62933349-48.82049561-48.8204956 0-5.56182862 1.23596192-11.12365723 3.08990479-16.68548584 11.74163818-32.75299073 17.92144776-67.35992432 17.92144775-101.96685791 0-161.29302979-131.62994385-292.92297364-292.92297363-292.92297364-26.57318115 0.61798096-48.8204956-21.01135254-49.43847656-47.58453368-0.61798096-26.57318115 21.01135254-48.8204956 47.58453369-49.43847656h1.85394287c215.05737305 0 389.94598388 174.88861084 389.94598388 389.94598388 0 46.34857177-8.03375244 92.0791626-24.10125732 135.33782959-6.79779052 19.15740967-24.71923828 31.51702881-45.11260986 32.13500976z' fill='#2c2c2c' p-id='3305' data-spm-anchor-id='a313x.7781069.0.i11' class=''></path>";
divHtml += "<path d='M412.50506592 488.51672363c0-6.79779052-1.85394287-11.74163818-6.17980957-15.44952392-4.3258667-3.70788575-9.88769531-5.56182862-17.3034668-5.56182862-5.56182862 0-10.50567627 1.23596192-15.44952393 3.70788575-5.56182862 3.08990479-10.50567627 6.79779052-14.213562 11.12365722v-14.83154297c3.70788575-4.3258667 8.6517334-7.41577148 13.59558105-9.26971435 4.94384766-2.47192383 11.12365723-3.08990479 17.92144775-3.08990479 11.12365723 0 19.77539063 3.08990479 26.57318115 8.65173341 6.79779052 6.17980958 9.88769531 14.21356201 9.88769531 24.10125732 0 9.26971435-1.85394287 16.68548584-6.17980956 23.48327636-4.3258667 6.79779052-11.12365723 13.59558106-21.01135255 20.39337158-10.50567627 6.79779052-17.3034668 12.35961914-20.39337157 15.44952393-3.70788575 3.08990479-6.17980958 6.17980958-7.41577148 8.6517334-1.23596192 3.08990479-1.85394287 6.79779052-1.85394288 10.50567627H431.66247558V579.97790528H354.41485596v-6.17980958c0-6.79779052 1.23596192-12.9776001 3.08990478-17.92144775 2.47192383-5.56182862 5.56182862-10.50567627 9.26971436-14.21356201 4.3258667-4.94384766 11.12365723-10.50567627 20.39337157-16.68548584 9.88769531-6.79779052 16.06750489-12.35961914 19.77539063-17.92144776 3.70788575-6.17980958 5.56182862-12.35961914 5.56182862-18.53942871z m114.32647705-22.86529541c-12.9776001 22.24731445-22.86529541 43.258667-30.2810669 62.41607666-7.41577148 19.15740967-11.74163818 35.84289551-13.59558105 50.67443848h-16.06750489c1.85394287-14.21356201 6.79779052-30.89904786 13.59558106-49.43847656 7.41577148-18.53942872 17.3034668-38.31481934 29.04510498-59.32617188h-60.56213379V456.38171386h77.86560059v9.26971437z m14.83154297 21.6293335c0-9.88769531 2.47192383-17.92144776 8.03375244-24.10125732s12.35961914-8.6517334 21.62933349-8.65173341c8.6517334 0 15.44952393 2.47192383 20.39337159 8.03375245s7.41577148 12.9776001 7.41577148 22.86529541-2.47192383 17.3034668-8.03375244 23.48327636-12.35961914 9.26971435-21.62933349 9.26971436c-8.6517334 0-15.44952393-3.08990479-20.39337159-8.6517334s-7.41577148-12.9776001-7.41577148-22.24731445z m12.35961914-0.61798096c0 6.79779052 1.23596192 11.74163818 4.3258667 15.44952393 3.08990479 3.70788575 6.79779052 5.56182862 12.35961914 5.56182861 5.56182862 0 9.26971435-1.85394287 12.35961914-5.56182861s4.3258667-9.26971435 4.3258667-16.06750489-1.23596192-12.35961914-4.3258667-16.06750488c-3.08990479-3.70788575-6.79779052-5.56182862-11.74163818-5.56182861-4.94384766 0-9.26971435 1.85394287-12.35961915 5.56182861s-4.94384766 9.26971435-4.94384765 16.68548584zM652.28167724 456.38171386L573.7980957 579.35992432h-12.9776001L639.30407715 456.38171386h12.97760009z m-37.07885742 93.31512452c0-9.88769531 2.47192383-17.92144776 8.03375245-24.10125733s12.35961914-9.26971435 21.62933349-9.26971435c8.6517334 0 15.44952393 2.47192383 20.39337158 8.03375244 4.94384766 5.56182862 7.41577148 12.9776001 7.41577149 22.86529541s-2.47192383 17.3034668-8.03375245 23.48327637-12.35961914 8.6517334-21.01135253 9.26971435c-8.6517334 0-15.44952393-3.08990479-20.39337158-8.65173339s-8.03375244-12.35961914-8.03375245-21.6293335z m11.74163819-0.61798096c0 6.79779052 1.23596192 11.74163818 4.3258667 15.44952393 3.08990479 3.70788575 6.79779052 5.56182862 12.35961914 5.56182861 5.56182862 0 9.26971435-1.85394287 12.35961914-5.56182861 3.08990479-3.70788575 4.3258667-9.26971435 4.3258667-16.06750489s-1.23596192-12.35961914-4.3258667-15.44952393-6.79779052-5.56182862-11.74163818-5.5618286c-5.56182862 0-9.26971435 1.85394287-12.35961914 5.5618286-3.08990479 3.70788575-4.94384766 9.26971435-4.94384766 16.06750489z' fill='#2c2c2c' p-id='3306' data-spm-anchor-id='a313x.7781069.0.i13' class=''></path>";
divHtml += "</svg>";
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_PercentChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPercentChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showPercentChart(contentId, showData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPercentChart/getJson.do?pid=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
let data = showData;
// console.log(data)
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let titleText = "";
if (data.mpid != null && data.mpid != "") {
titleText = data.showData;
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: data.mpid,
// valuemethod: data.valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// titleText = mp.parmvalue;
// }
// });
} else if (data.urldata != null && data.urldata != "") {
$.ajax({
type: 'GET',
url: ext.contextPath + data.urldata,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
titleText = result.result;
}
});
} else {
titleText = data.titleText;
}
//系数
if (data.rate != null && data.rate != "") {
let rate = data.rate;
if ("+-*/".indexOf(rate.substring(0, 1)) == -1) {
rate = "*" + rate;
}
titleText = eval(titleText + rate);
}
if (data.numtail != null && data.numtail != "") {
titleText = Number(titleText).toFixed(Number(data.numtail));
}
let titleColor = "#000000";
if (data.titleColor != null && data.titleColor != "") {
titleColor = data.titleColor;
}
let titleFontSize = "18";
if (data.titleFontSize != null && data.titleFontSize != "") {
titleFontSize = data.titleFontSize;
}
let titleFontWeight = "normal";
if (data.titleFontWeight != null && data.titleFontWeight != "") {
titleFontWeight = data.titleFontWeight;
}
let unittitleText = "";
if (data.unittitleText != null && data.unittitleText != "") {
unittitleText = data.unittitleText;
}
let unittitleColor = "#000000";
if (data.unittitleColor != null && data.unittitleColor != "") {
unittitleColor = data.unittitleColor;
}
let unittitleFontSize = "16";
if (data.unittitleFontSize != null && data.unittitleFontSize != "") {
unittitleFontSize = data.unittitleFontSize;
}
let unittitleFontWeight = "normal";
if (data.unittitleFontWeight != null && data.unittitleFontWeight != "") {
unittitleFontWeight = data.unittitleFontWeight;
}
let unitisneedbr = "";
if (data.unitisneedbr != null && data.unitisneedbr != "") {
if (data.unitisneedbr == "true") {
unitisneedbr = "\n";
}
}
let titleData = ['{a|' + titleText + '}', '{b|' + unittitleText + '}'].join('' + unitisneedbr + '');
let subtitleText = "";
if (data.subtitleText != null && data.subtitleText != "") {
subtitleText = data.subtitleText;
}
let subtitleColor = "#000000";
if (data.subtitleColor != null && data.subtitleColor != "") {
subtitleColor = data.subtitleColor;
}
let subtitleFontSize = "18";
if (data.subtitleFontSize != null && data.subtitleFontSize != "") {
subtitleFontSize = data.subtitleFontSize;
}
let subtitleFontWeight = "normal";
if (data.subtitleFontWeight != null && data.subtitleFontWeight != "") {
subtitleFontWeight = data.subtitleFontWeight;
}
let subtitlePosition = "-50";
if (data.subtitlePosition != null && data.subtitlePosition != "") {
subtitlePosition = data.subtitlePosition;
}
let titleLeftPosition = "44%";
if (data.titleLeftPosition != null && data.titleLeftPosition != "") {
titleLeftPosition = data.titleLeftPosition;
}
let titleTopPosition = "50%";
if (data.titleTopPosition != null && data.titleTopPosition != "") {
titleTopPosition = data.titleTopPosition;
}
let clockwise = eval("true".toLowerCase());
if (data.clockwise != null && data.clockwise != "") {
clockwise = eval(data.clockwise.toLowerCase())
}
let radius = "100%";
if (data.radius != null && data.radius != "") {
if (data.radius.indexOf(",") > 0) {
radius = data.radius.split(",");
} else {
radius = data.radius;
}
}
let scoreringwidth = "12";
if (data.scoreringwidth != null && data.scoreringwidth != "") {
scoreringwidth = data.scoreringwidth;
}
let scoreringcolor = "#2ec7c9";
if (data.scoreringcolor != null && data.scoreringcolor != "") {
scoreringcolor = data.scoreringcolor;
}
let bgringwidth = "18";
if (data.bgringwidth != null && data.bgringwidth != "") {
bgringwidth = data.bgringwidth;
}
let bgringcolor = "#eeeeee";
if (data.bgringcolor != null && data.bgringcolor != "") {
bgringcolor = data.bgringcolor;
}
let bgringposition = "22";
if (data.bgringposition != null && data.bgringposition != "") {
bgringposition = data.bgringposition;
}
bgringposition = -100 - Number(bgringposition) + "%";
let angleaxismax = "100";
if (data.angleaxismax != null && data.angleaxismax != "") {
angleaxismax = data.angleaxismax;
}
let startangle = "100";
if (data.startangle != null && data.startangle != "") {
startangle = data.startangle;
}
let option = {
animation: false,
title: {
text: titleData,
textStyle: {
rich: {
a: {
color: titleColor,
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
b: {
color: unittitleColor,
fontSize: unittitleFontSize,
fontWeight: unittitleFontWeight
}
}
},
subtext: subtitleText,
subtextStyle: {
color: subtitleColor,
fontSize: subtitleFontSize,
fontWeight: subtitleFontWeight
},
itemGap: Number(subtitlePosition), // 主副标题距离
left: titleLeftPosition,
top: titleTopPosition,
textAlign: 'center'
},
angleAxis: {
max: Number(angleaxismax),
clockwise: clockwise, // 顺时针
startAngle: Number(startangle),
// 隐藏刻度线
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
radiusAxis: {
type: 'category',
// 隐藏刻度线
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
polar: {
center: ['50%', '50%'],
radius: radius //图形大小
},
series: [{
type: 'bar',
data: [{
name: '百分比',
value: Number(titleText),
itemStyle: {
color: scoreringcolor
}
}],
coordinateSystem: 'polar',
roundCap: true,
barWidth: scoreringwidth,
barGap: '-100%', // 两环重叠
z: 2
}, { // 灰色环
type: 'bar',
data: [{
value: 100,
itemStyle: {
color: bgringcolor,
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 2,
shadowOffsetY: 2
}
}],
coordinateSystem: 'polar',
roundCap: true,
barWidth: bgringwidth,
barGap: bgringposition, // 两环重叠
z: 1
}]
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
// }
// });
}
/**
* 雷达图组件
*/
function showAssembly_RadarChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualRadarChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editRadarChart('" + content.id + "');\">";
divHtml += "<svg t='1632552240692' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2194' width='16' height='16'>";
divHtml += "<path d='M683.52 798.515H340.992L234.496 465.101l278.016-206.08L790.528 465.1 683.52 798.515z m-324.096-26.112h305.664l94.72-297.37L512 291.38 264.192 475.034l95.232 297.37z' p-id='2195'></path>";
divHtml += "<path d='M827.904 1023.898H196.608L0 409.293 512 29.49l512 379.802-196.096 614.605z m-609.792-30.772H806.4l182.784-572.364L512 67.072 34.816 420.762l183.296 572.364z' p-id='2196'></path>";
divHtml += "<path d='M499.2 39.424h25.6v487.27h-25.6z' p-id='2197'></path>";
divHtml += " <path d='M1011.251 398.694l5.632 25.447-502.016 115.097-5.632-25.446z' p-id='2198'></path>";
divHtml += " <path d='M522.65 519.475l305.766 481.28-21.504 14.234-305.715-481.331z' p-id='2199'></path>";
divHtml += " <path d='M500.94 519.475l21.505 14.183-308.839 486.144-21.504-14.132z' p-id='2200'></path>";
divHtml += " <path d='M19.2 400.18l495.514 113.612-5.632 25.446L13.568 425.626z' p-id='2201'></path>";
divHtml += " </svg>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_RadarChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualRadarChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let onmouseupSt = "";
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showRadarChart(contentId, showData, showSeriesData, showAxisData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualRadarChart/getChartJson.do?contentId=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
var dataVisualRadarChart = showData;
var dataVisualRadarChartSerieslist = showSeriesData;
var dataVisualRadarChartAxislist = showAxisData;
// console.log(data)
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let colors = dataVisualRadarChart.colors.split(',');
let titleText = "";
if (dataVisualRadarChart.titleText != null && dataVisualRadarChart.titleText != "") {
titleText = dataVisualRadarChart.titleText;
}
let titlePosition = "left";
if (dataVisualRadarChart.titlePosition != null && dataVisualRadarChart.titlePosition != "") {
titlePosition = dataVisualRadarChart.titlePosition;
}
let titleColor = "#000000";
if (dataVisualRadarChart.titleColor != null && dataVisualRadarChart.titleColor != "") {
titleColor = dataVisualRadarChart.titleColor;
}
let titleFontSize = "18";
if (dataVisualRadarChart.titleFontSize != null && dataVisualRadarChart.titleFontSize != "") {
titleFontSize = dataVisualRadarChart.titleFontSize;
}
let titleFontWeight = "bolder";
if (dataVisualRadarChart.titleFontWeight != null && dataVisualRadarChart.titleFontWeight != "") {
titleFontWeight = dataVisualRadarChart.titleFontWeight;
}
let radius = 100;
if (dataVisualRadarChart.radius != null && dataVisualRadarChart.radius != "") {
radius = dataVisualRadarChart.radius;
}
let shapeData = "polygon";
if (dataVisualRadarChart.shape != null && dataVisualRadarChart.shape != "") {
shapeData = dataVisualRadarChart.shape;
}
let axisNameData = [];
let axisnameformatter = "{value}";
if (dataVisualRadarChart.axisnameformatter != null && dataVisualRadarChart.axisnameformatter != "") {
axisnameformatter = dataVisualRadarChart.axisnameformatter;
}
let axisnamecolor = "#333";
if (dataVisualRadarChart.axisnamecolor != null && dataVisualRadarChart.axisnamecolor != "") {
axisnamecolor = dataVisualRadarChart.axisnamecolor;
}
let axisnamefontSize = "16";
if (dataVisualRadarChart.axisnamefontSize != null && dataVisualRadarChart.axisnamefontSize != "") {
axisnamefontSize = dataVisualRadarChart.axisnamefontSize;
}
let axisnamefontWeight = "normal";
if (dataVisualRadarChart.axisnamefontWeight != null && dataVisualRadarChart.axisnamefontWeight != "") {
axisnamefontWeight = dataVisualRadarChart.axisnamefontWeight;
}
axisNameData.push({
formatter: axisnameformatter,
color: axisnamecolor,
fontSize: axisnamefontSize,
fontWeight: axisnamefontWeight
})
let splitNumber = 5;
if (dataVisualRadarChart.splitNumber != null && dataVisualRadarChart.splitNumber != "") {
splitNumber = dataVisualRadarChart.splitNumber;
}
let axislinecolor = "#e0e0e0";
if (dataVisualRadarChart.axislinecolor != null && dataVisualRadarChart.axislinecolor != "") {
axislinecolor = dataVisualRadarChart.axislinecolor;
}
let splitlinecolor = "#e0e0e0";
if (dataVisualRadarChart.splitlinecolor != null && dataVisualRadarChart.splitlinecolor != "") {
splitlinecolor = dataVisualRadarChart.splitlinecolor;
}
let splitareacolors = "#FFFFFF|#F6F8FC";
if (dataVisualRadarChart.splitareacolors != null && dataVisualRadarChart.splitareacolors != "") {
splitareacolors = dataVisualRadarChart.splitareacolors;
}
splitareacolors = splitareacolors.split("|");
let legendPushData = [];
let seriesPushDatas = [];
for (let s = 0; s < dataVisualRadarChartSerieslist.length; s++) {
legendPushData.push(dataVisualRadarChartSerieslist[s].name);
let seriesPushData = [];
let mpid = "";
if (dataVisualRadarChartSerieslist[s].mpid != null && dataVisualRadarChartSerieslist[s].mpid != "") {
mpid = dataVisualRadarChartSerieslist[s].mpid;
}
if (mpid != "") {
let mpvalues = dataVisualRadarChartSerieslist[s].fixedvalue.split(",");
for (let i = 0; i < mpvalues.length; i++) {
seriesPushData.push(mpvalues[i]);
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: mpids[i],
// valuemethod: dataVisualRadarChartSerieslist[s].valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// seriesPushData.push(mp.parmvalue);
// }
// });
}
} else {
let fixedvalue = "";
if (dataVisualRadarChartSerieslist[s].fixedvalue != null && dataVisualRadarChartSerieslist[s].fixedvalue != "") {
fixedvalue = dataVisualRadarChartSerieslist[s].fixedvalue;
}
seriesPushData = fixedvalue.split(",");
}
let areaStyleData = [];
if (dataVisualRadarChartSerieslist[s].areastyle == "true") {
let areastylecolor = colors[s];
if (dataVisualRadarChartSerieslist[s].areastylecolor != null && dataVisualRadarChartSerieslist[s].areastylecolor != "") {
areastylecolor = dataVisualRadarChartSerieslist[s].areastylecolor;
}
areaStyleData.push({
color: areastylecolor,
opacity: 1
})
} else if (dataVisualRadarChartSerieslist[s].areastyle == "false") {
areaStyleData.push({
opacity: 0
})
}
seriesPushDatas.push({
value: seriesPushData,
name: dataVisualRadarChartSerieslist[s].name,
areaStyle: areaStyleData[0]
});
}
let legendData = [];
let legendShow = eval("true".toLowerCase());
let legendPosition = "center";
let legendSt = dataVisualRadarChart.legendPosition;
if (legendSt == 'false') {
legendShow = eval("false".toLowerCase());
} else {
legendPosition = legendSt;
legendShow = eval("true".toLowerCase());
}
legendData.push({
show: legendShow,
data: legendPushData,
left: legendPosition,
textStyle: {
color: colors
}
})
let indicatorData = [];
for (let s = 0; s < dataVisualRadarChartAxislist.length; s++) {
if (dataVisualRadarChartAxislist[s].max != null && dataVisualRadarChartAxislist[s].max != '') {
indicatorData.push({
name: dataVisualRadarChartAxislist[s].name,
max: dataVisualRadarChartAxislist[s].max
})
} else {
indicatorData.push({
name: dataVisualRadarChartAxislist[s].name
})
}
}
let option = {
color: colors,
title: {
text: titleText,
textStyle: {
color: titleColor,
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
left: titlePosition
},
legend: legendData,
tooltip: {
trigger: 'item'
},
radar: {
shape: shapeData,
indicator: indicatorData,
center: ['50%', '50%'],
radius: radius,
axisName: axisNameData[0],
splitNumber: splitNumber,
splitArea: {
areaStyle: {
color: splitareacolors
}
},
axisLine: {
lineStyle: {
color: axislinecolor
}
},
splitLine: {
lineStyle: {
color: splitlinecolor
}
}
},
series: [
{
type: 'radar',
data: seriesPushDatas
}
]
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
// }
// });
}
/**
* 饼图组件
*/
function showAssembly_PieChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualPieChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editPieChart('" + content.id + "');\">";
divHtml += " <i class=\"fa fa-pie-chart\"></i>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_PieChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPieChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let onmouseupSt = "";
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showPieChart(contentId, showData, showSeriesData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPieChart/getChartJson.do?contentId=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
var dataVisualPieChart = showData;
var dataVisualPieChartSerieslist = showSeriesData;
// console.log(data)
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let colors = dataVisualPieChart.colors.split(',');
let titleText = "";
if (dataVisualPieChart.titleText != null && dataVisualPieChart.titleText != "") {
titleText = dataVisualPieChart.titleText;
}
let titlePosition = "left";
if (dataVisualPieChart.titlePosition != null && dataVisualPieChart.titlePosition != "") {
titlePosition = dataVisualPieChart.titlePosition;
}
let titleColor = "#000000";
if (dataVisualPieChart.titleColor != null && dataVisualPieChart.titleColor != "") {
titleColor = dataVisualPieChart.titleColor;
}
let titleFontSize = "18";
if (dataVisualPieChart.titleFontSize != null && dataVisualPieChart.titleFontSize != "") {
titleFontSize = dataVisualPieChart.titleFontSize;
}
let titleFontWeight = "bolder";
if (dataVisualPieChart.titleFontWeight != null && dataVisualPieChart.titleFontWeight != "") {
titleFontWeight = dataVisualPieChart.titleFontWeight;
}
let subtitleText = "";
if (dataVisualPieChart.subtitleText != null && dataVisualPieChart.subtitleText != "") {
subtitleText = dataVisualPieChart.subtitleText;
}
let subtitleColor = "#333";
if (dataVisualPieChart.subtitleColor != null && dataVisualPieChart.subtitleColor != "") {
subtitleColor = dataVisualPieChart.subtitleColor;
}
let subtitleFontSize = "16";
if (dataVisualPieChart.subtitleFontSize != null && dataVisualPieChart.subtitleFontSize != "") {
subtitleFontSize = dataVisualPieChart.subtitleFontSize;
}
let subtitleFontWeight = "normal";
if (dataVisualPieChart.subtitleFontWeight != null && dataVisualPieChart.subtitleFontWeight != "") {
subtitleFontWeight = dataVisualPieChart.subtitleFontWeight;
}
let radius = "60%";
if (dataVisualPieChart.radius != null && dataVisualPieChart.radius != "") {
radius = dataVisualPieChart.radius;
}
if (radius.indexOf(",") >= 0) {
radius = radius.split(",");
}
let lableShow = eval("true".toLowerCase());
if (dataVisualPieChart.lableShow != null && dataVisualPieChart.lableShow != "") {
lableShow = eval(dataVisualPieChart.lableShow.toLowerCase());
}
let lablePosition = "outside";
if (dataVisualPieChart.lablePosition != null && dataVisualPieChart.lablePosition != "") {
lablePosition = dataVisualPieChart.lablePosition;
}
let lableColor = "#333";
if (dataVisualPieChart.lableColor != null && dataVisualPieChart.lableColor != "") {
lableColor = dataVisualPieChart.lableColor;
}
let lableFontsize = "12";
if (dataVisualPieChart.lableFontsize != null && dataVisualPieChart.lableFontsize != "") {
lableFontsize = dataVisualPieChart.lableFontsize;
}
let lableFontweight = "normal";
if (dataVisualPieChart.lableFontweight != null && dataVisualPieChart.lableFontweight != "") {
lableFontweight = dataVisualPieChart.lableFontweight;
}
let borderradius = "0";
if (dataVisualPieChart.borderradius != null && dataVisualPieChart.borderradius != "") {
borderradius = dataVisualPieChart.borderradius;
}
let legendDataD = [];
let seriesData = [];
for (let i = 0; i < dataVisualPieChartSerieslist.length; i++) {
let seriesPushData = [];
let dataVisualPieChartSeries = dataVisualPieChartSerieslist[i];
legendDataD.push(dataVisualPieChartSeries.name);
let mpid = "";
if (dataVisualPieChartSeries.mpid != null && dataVisualPieChartSeries.mpid != "") {
mpid = dataVisualPieChartSeries.mpid;
}
if (mpid != "") {
let outData = dataVisualPieChartSeries.fixedvalue;
//系数
if (dataVisualPieChartSeries.rate != null && dataVisualPieChartSeries.rate != "") {
let rate = dataVisualPieChartSeries.rate;
if ("+-*/".indexOf(rate.substring(0, 1)) == -1) {
rate = "*" + rate;
}
outData = eval(outData + rate);
}
if (dataVisualPieChartSeries.numtail != null && dataVisualPieChartSeries.numtail != "") {
outData = Number(outData).toFixed(Number(dataVisualPieChartSeries.numtail));
}
seriesPushData.push(outData);
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: mpid,
// valuemethod: dataVisualPieChartSeries.valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// seriesPushData.push(mp.parmvalue);
// }
// });
} else {
let fixedvalue = "";
if (dataVisualPieChartSeries.fixedvalue != null && dataVisualPieChartSeries.fixedvalue != "") {
fixedvalue = dataVisualPieChartSeries.fixedvalue;
}
seriesPushData = fixedvalue.split(",");
}
seriesData.push({
value: seriesPushData,
name: dataVisualPieChartSeries.name
})
}
let legendData = [];
let legendShow = eval("true".toLowerCase());
let legendPosition = "center";
let legendSt = dataVisualPieChart.legendPosition;
if (legendSt == 'false') {
legendShow = eval("false".toLowerCase());
} else {
legendPosition = legendSt;
legendShow = eval("true".toLowerCase());
}
legendData.push({
show: legendShow,
data: legendDataD,
left: legendPosition,
textStyle: {
color: colors
}
})
let option = {
color: colors,
title: {
text: titleText,
textStyle: {
color: titleColor,
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
subtext: subtitleText,
subtextStyle: {
color: subtitleColor,
fontSize: subtitleFontSize,
fontWeight: subtitleFontWeight
},
left: dataVisualPieChart.titlePositionX,
top: dataVisualPieChart.titlePositionY
},
tooltip: {
trigger: 'item'
},
legend: legendData,
series: [
{
type: 'pie',
radius: radius,
itemStyle: {
borderRadius: borderradius
},
label: {
show: lableShow,
position: lablePosition,
color: lableColor,
fontSize: lableFontsize,
fontWeight: lableFontweight
},
labelLine: {
show: true
},
data: seriesData
}
]
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
// }
// });
}
/**
* 图片组件
*/
function showAssembly_Picture(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var paths = getFilePictureShowList(content.id, 'tb_pro_dataVisual_picture_file').split(",");
let borderStyle = "border:2px solid red;";
if (paths != "") {
borderStyle = "border:0px solid transparent;";
}
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"" + borderStyle + "background-color: " + content.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editPicture('" + content.id + "');\">";
if (paths.length > 1) {
divHtml += "<img onmouseup=\"doUp2('" + content.id + "');\" style=\"position: absolute;width:100%;height:100%;\" src=\"" + paths[paths.length - 2] + "\" >";
} else {
divHtml += " <i class=\"fa fa-picture-o\"></i>";
}
divHtml += "</div>";
return divHtml;
}
function showAssembly_Picture_View(content, showData) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
//需要绑定开关组件加
let hiddenSt = "display:block;";
if (switchHiddenPoints.indexOf(content.id) != -1) {
hiddenSt = "display:none;";
}
style += hiddenSt;
// var paths = getFilePictureShowList(content.id, 'tb_pro_dataVisual_picture_file').split(",");
let path = "";
if (showData != null) {
if (showData.length > 0) {
for (let p = 0; p < showData.length; p++) {
let nowPath = showData[p].abspath;
nowPath = nowPath.substring(nowPath.indexOf('webapps') + 7, nowPath.length);
nowPath = ext.basePath.replace(ext.contextPath, '') + nowPath.replace(/\\/g, "\/");
path += nowPath + ",";
}
}
}
var paths = path.split(",");
// let voiceSt = "";
// if (content.isvoiceknow != null && content.isvoiceknow != '') {
// if (content.isvoiceknow == 'true') {
// voiceSt += "onclick=\"voiceClick('" + content.voicetext + "','" + content.voicemethod + "','" + paths + "','" + content.id + "');\" ";
// // voiceSt += "onmousedown=\"voicemousedown();\" ";
// // voiceSt += "onmouseup=\"voicemouseup('"+content.voicetext+"','"+content.voicemethod+"');\" ";
// }
// }
divHtml = "<div style=\"background-color: " + content.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
if (paths.length > 1) {
divHtml += "<img id=\"" + content.id + "Img\" style=\"position: absolute;width:100%;height:100%;\" ondragstart=\"return false\" src=\"" + paths[paths.length - 2] + "\" >";
}
// else {
// divHtml += " <i class=\"fa fa-picture-o\"></i>";
// }
divHtml += "</div>";
return divHtml;
}
function getFilePictureShowList(masterId, tbName) {
var path = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/base/getInputFileList.do",
async: false,
globle: false,
data: {masterId: masterId, tbName: tbName},
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
if (data.length > 0) {
for (let p = 0; p < data.length; p++) {
let nowPath = data[p].abspath;
nowPath = nowPath.substring(nowPath.indexOf('webapps') + 7, nowPath.length);
nowPath = ext.basePath.replace(ext.contextPath, '') + nowPath.replace(/\\/g, "\/");
path += nowPath + ",";
}
}
}
});
return path;
};
/**
* 仪表盘组件
*/
function showAssembly_GaugeChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualGaugeChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editGaugeChart('" + content.id + "');\">";
divHtml += "<svg t='1634179849674' class='icon' viewBox='0 0 1024 1024' version='1.1' p-id='2967' width='16' height='16'>";
divHtml += "<path d='M956.5 601.2V794h-50V605c0-53.3-10.4-104.9-31-153.5-19.9-47-48.3-89.2-84.6-125.4-36.2-36.2-78.4-64.7-125.4-84.6-48.6-20.6-100.3-31-153.5-31-53.3 0-104.9 10.4-153.5 31-47 19.9-89.2 48.3-125.4 84.6-36.2 36.2-64.7 78.4-84.6 125.4-20.6 48.6-31 100.3-31 153.5v189h-50V601.2c2-243.7 200.3-440.7 444.5-440.7s442.4 196.9 444.5 440.7zM186.3 454.4l409.1 282.8v126.3H469.2L186.3 454.4z m359.2 309.1L383.2 651.3l112.2 162.2h50.1v-50z' fill='' p-id='2968'></path>";
divHtml += "</svg>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_GaugeChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualGaugeChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let onmouseupSt = "";
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showGaugeChart(contentId, showData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualGaugeChart/getJson.do?pid=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
// console.log(data)
var dataVisualGaugeChart = showData;
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let showValue = "0";
let mpid = "";
if (dataVisualGaugeChart.mpid != null && dataVisualGaugeChart.mpid != "") {
mpid = dataVisualGaugeChart.mpid;
}
if (mpid != "") {
showValue = dataVisualGaugeChart.fixedvalue;
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: mpid,
// valuemethod: dataVisualGaugeChart.valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// showValue = mp.parmvalue;
// }
// });
} else {
let fixedvalue = "";
if (dataVisualGaugeChart.fixedvalue != null && dataVisualGaugeChart.fixedvalue != "") {
fixedvalue = dataVisualGaugeChart.fixedvalue;
showValue = fixedvalue;
}
}
showValue = Number(showValue);
let jsshowValue = "0";
let max = "100";
if (dataVisualGaugeChart.max != null && dataVisualGaugeChart.max != "") {
max = dataVisualGaugeChart.max;
}
max = Number(max);
let min = "0";
if (dataVisualGaugeChart.min != null && dataVisualGaugeChart.min != "") {
min = dataVisualGaugeChart.min;
}
min = Number(min);
jsshowValue = (showValue - min) / (max - min);
let startAngle = "225";
if (dataVisualGaugeChart.startAngle != null && dataVisualGaugeChart.startAngle != "") {
startAngle = dataVisualGaugeChart.startAngle;
}
let endAngle = "-45";
if (dataVisualGaugeChart.endAngle != null && dataVisualGaugeChart.endAngle != "") {
endAngle = dataVisualGaugeChart.endAngle;
}
let radius = "100%";
if (dataVisualGaugeChart.radius != null && dataVisualGaugeChart.radius != "") {
radius = dataVisualGaugeChart.radius;
}
let pointerst = eval("true".toLowerCase());
if (dataVisualGaugeChart.pointerst != null && dataVisualGaugeChart.pointerst != "") {
pointerst = eval(dataVisualGaugeChart.pointerst.toLowerCase());
}
let pointerLength = "60%";
if (dataVisualGaugeChart.pointerLength != null && dataVisualGaugeChart.pointerLength != "") {
pointerLength = dataVisualGaugeChart.pointerLength;
}
let pointerWidth = "6";
if (dataVisualGaugeChart.pointerWidth != null && dataVisualGaugeChart.pointerWidth != "") {
pointerWidth = dataVisualGaugeChart.pointerWidth;
}
let pointerColor = "#2ec7c9";
if (dataVisualGaugeChart.pointerColor != null && dataVisualGaugeChart.pointerColor != "") {
pointerColor = dataVisualGaugeChart.pointerColor;
}
let splitlinest = eval("true".toLowerCase());
if (dataVisualGaugeChart.splitlinest != null && dataVisualGaugeChart.splitlinest != "") {
splitlinest = eval(dataVisualGaugeChart.splitlinest.toLowerCase());
}
let splitlineDistance = "10";
if (dataVisualGaugeChart.splitlineDistance != null && dataVisualGaugeChart.splitlineDistance != "") {
splitlineDistance = dataVisualGaugeChart.splitlineDistance;
}
let splitlineLength = "10";
if (dataVisualGaugeChart.splitlineLength != null && dataVisualGaugeChart.splitlineLength != "") {
splitlineLength = dataVisualGaugeChart.splitlineLength;
}
let splitlineColor = "#63677A";
if (dataVisualGaugeChart.splitlineColor != null && dataVisualGaugeChart.splitlineColor != "") {
splitlineColor = dataVisualGaugeChart.splitlineColor;
}
let splitlineWidth = "3";
if (dataVisualGaugeChart.splitlineWidth != null && dataVisualGaugeChart.splitlineWidth != "") {
splitlineWidth = dataVisualGaugeChart.splitlineWidth;
}
let axistickst = eval("true".toLowerCase());
if (dataVisualGaugeChart.axistickst != null && dataVisualGaugeChart.axistickst != "") {
axistickst = eval(dataVisualGaugeChart.axistickst.toLowerCase());
}
let axistickSplitnumber = "5";
if (dataVisualGaugeChart.axistickSplitnumber != null && dataVisualGaugeChart.axistickSplitnumber != "") {
axistickSplitnumber = dataVisualGaugeChart.axistickSplitnumber;
}
let axistickDistance = "10";
if (dataVisualGaugeChart.axistickDistance != null && dataVisualGaugeChart.axistickDistance != "") {
axistickDistance = dataVisualGaugeChart.axistickDistance;
}
let axistickLength = "6";
if (dataVisualGaugeChart.axistickLength != null && dataVisualGaugeChart.axistickLength != "") {
axistickLength = dataVisualGaugeChart.axistickLength;
}
let axistickColor = "#63677A";
if (dataVisualGaugeChart.axistickColor != null && dataVisualGaugeChart.axistickColor != "") {
axistickColor = dataVisualGaugeChart.axistickColor;
}
let axistickWidth = "10";
if (dataVisualGaugeChart.axistickWidth != null && dataVisualGaugeChart.axistickWidth != "") {
axistickWidth = dataVisualGaugeChart.axistickWidth;
}
let axislabelst = eval("true".toLowerCase());
if (dataVisualGaugeChart.axislabelst != null && dataVisualGaugeChart.axislabelst != "") {
axislabelst = eval(dataVisualGaugeChart.axislabelst.toLowerCase());
}
let axislabelDistance = "15";
if (dataVisualGaugeChart.axislabelDistance != null && dataVisualGaugeChart.axislabelDistance != "") {
axislabelDistance = dataVisualGaugeChart.axislabelDistance;
}
let axislabelColor = "#000000";
if (dataVisualGaugeChart.axislabelColor != null && dataVisualGaugeChart.axislabelColor != "") {
axislabelColor = dataVisualGaugeChart.axislabelColor;
}
let axislabelFontSize = "12";
if (dataVisualGaugeChart.axislabelFontSize != null && dataVisualGaugeChart.axislabelFontSize != "") {
axislabelFontSize = dataVisualGaugeChart.axislabelFontSize;
}
let axislabelFontWeight = "normal";
if (dataVisualGaugeChart.axislabelFontWeight != null && dataVisualGaugeChart.axislabelFontWeight != "") {
axislabelFontWeight = dataVisualGaugeChart.axislabelFontWeight;
}
let titleText = "";
if (dataVisualGaugeChart.titleText != null && dataVisualGaugeChart.titleText != "") {
titleText = dataVisualGaugeChart.titleText;
}
let titleColor = "#464646";
if (dataVisualGaugeChart.titleColor != null && dataVisualGaugeChart.titleColor != "") {
titleColor = dataVisualGaugeChart.titleColor;
}
let titleFontSize = "16";
if (dataVisualGaugeChart.titleFontSize != null && dataVisualGaugeChart.titleFontSize != "") {
titleFontSize = dataVisualGaugeChart.titleFontSize;
}
let titleFontWeight = "normal";
if (dataVisualGaugeChart.titleFontWeight != null && dataVisualGaugeChart.titleFontWeight != "") {
titleFontWeight = dataVisualGaugeChart.titleFontWeight;
}
let titleXPosition = "0";
if (dataVisualGaugeChart.titleXPosition != null && dataVisualGaugeChart.titleXPosition != "") {
titleXPosition = dataVisualGaugeChart.titleXPosition;
}
let titleYPosition = "20%";
if (dataVisualGaugeChart.titleYPosition != null && dataVisualGaugeChart.titleYPosition != "") {
titleYPosition = dataVisualGaugeChart.titleYPosition;
}
let datast = eval("true".toLowerCase());
if (dataVisualGaugeChart.datast != null && dataVisualGaugeChart.datast != "") {
datast = eval(dataVisualGaugeChart.datast.toLowerCase());
}
let dataColor = "#464646";
if (dataVisualGaugeChart.dataColor != null && dataVisualGaugeChart.dataColor != "") {
dataColor = dataVisualGaugeChart.dataColor;
}
let dataFontSize = "20";
if (dataVisualGaugeChart.dataFontSize != null && dataVisualGaugeChart.dataFontSize != "") {
dataFontSize = dataVisualGaugeChart.dataFontSize;
}
let dataFontWeight = "normal";
if (dataVisualGaugeChart.dataFontWeight != null && dataVisualGaugeChart.dataFontWeight != "") {
dataFontWeight = dataVisualGaugeChart.dataFontWeight;
}
let dataXPosition = "0";
if (dataVisualGaugeChart.dataXPosition != null && dataVisualGaugeChart.dataXPosition != "") {
dataXPosition = dataVisualGaugeChart.dataXPosition;
}
let dataYPosition = "40%";
if (dataVisualGaugeChart.dataYPosition != null && dataVisualGaugeChart.dataYPosition != "") {
dataYPosition = dataVisualGaugeChart.dataYPosition;
}
let axislinest = eval("true".toLowerCase());
if (dataVisualGaugeChart.axislinest != null && dataVisualGaugeChart.axislinest != "") {
axislinest = eval(dataVisualGaugeChart.axislinest.toLowerCase());
}
let axislineWidth = "10";
if (dataVisualGaugeChart.axislineWidth != null && dataVisualGaugeChart.axislineWidth != "") {
axislineWidth = dataVisualGaugeChart.axislineWidth;
}
let axislineColors = [];
let axislineColor = "";
let firstColor = "";
let endColor = "";
if (dataVisualGaugeChart.axislineColor != null && dataVisualGaugeChart.axislineColor != "") {
axislineColor = dataVisualGaugeChart.axislineColor.split(",");
}
if (axislineColor != null && axislineColor.length >= 2) {
endColor = axislineColor[axislineColor.length - 1];
for (let c = 0; c < axislineColor.length - 1; c++) {
firstColor = axislineColor[c];
axislineColors.push(axislineColor[c])
}
}
let axislineColorsData = [];
if (axislineColors != '' && axislineColors.length > 1) {
let axislineColorsDataD = [];
for (let c = 0; c < axislineColors.length; c++) {
axislineColorsDataD.push({
offset: (1 / (axislineColors.length - 1)) * c,
color: axislineColors[c]
})
}
axislineColorsData = [ //颜色为渐变色
[
jsshowValue,
new echarts.graphic.LinearGradient(0, 0, 1, 0, axislineColorsDataD)
],
[1, endColor]
]
} else {
axislineColorsData = [[jsshowValue, firstColor], [1, endColor]];
}
let option = {
series: [{
type: 'gauge',
startAngle: startAngle,
endAngle: endAngle,
max: max,
min: min,
radius: radius,//仪表盘半径
pointer: {//是否显示指针
show: pointerst,
length: pointerLength,
width: pointerWidth,
itemStyle: {
color: pointerColor
}
},
splitLine: {//是否显示分隔线
show: splitlinest,
distance: Number(splitlineDistance),
length: Number(splitlineLength),
lineStyle: {
color: splitlineColor,
width: Number(splitlineWidth)
}
},
axisLine: {//仪表盘轴线
show: axislinest,
lineStyle: {
width: Number(axislineWidth),
color: axislineColorsData
}
},
axisTick: {//刻度
show: axistickst,
splitNumber: Number(axistickSplitnumber),
distance: Number(axistickDistance),
length: Number(axistickLength),
lineStyle: {
color: axistickColor,
width: Number(axistickWidth)
}
},
axisLabel: {
show: axislabelst,
distance: Number(axislabelDistance),
color: axislabelColor,
fontSize: axislabelFontSize,
fontWeight: axislabelFontWeight
},
data: [{
value: showValue,
name: titleText,
title: {
show: true,
color: titleColor,
offsetCenter: [titleXPosition, titleYPosition],
fontSize: titleFontSize,
fontWeight: titleFontWeight
},
detail: {
show: datast,
color: dataColor,
offsetCenter: [dataXPosition, dataYPosition],
fontSize: dataFontSize,
fontWeight: dataFontWeight
},
}]
}]
};
myChart.setOption(option, true);
myChart.hideLoading();
// }
// });
}
/**
* 日期控件
*/
function showAssembly_Date(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualDate/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
data = data[0];
// console.log(data)
let style = "";
let zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";";
if (data.background != null && data.background != '') {
style += "background:" + data.background + ";";
}
if (data.fontcolor != null && data.fontcolor != '') {
style += "color:" + data.fontcolor + ";";
} else {
style += "color:#000000;";
}
let fontsize = "font-size:14px;";
if (data.fontsize != null && data.fontsize != '') {
fontsize = data.fontsize.replace("px", "");
style += "font-size:" + fontsize + "px;";
} else {
style += fontsize;
}
if (data.fontweight != null && data.fontweight != '') {
style += "font-weight:" + data.fontweight + ";";
} else {
style += "font-weight:400;";
}
if (data.textAlign != null && data.textAlign != '') {
style += "text-align:" + data.textAlign + ";";
} else {
style += "text-align:center;";
}
let showContent = "";
if (data.types != null && data.types != '') {
showContent = data.types;
}
// let nowDate = getNowTime();
let myDate = new Date;
if (showContent.indexOf("year") >= 0) {
let year = myDate.getFullYear(); //获取当前年
showContent = showContent.replaceAll("year", year);
}
if (showContent.indexOf("month") >= 0) {
let mon = myDate.getMonth() + 1; //获取当前月
if (mon < 10) {
mon = "0" + mon;
}
showContent = showContent.replaceAll("month", mon);
}
if (showContent.indexOf("day") >= 0) {
let day = myDate.getDate(); //获取当前日
if (day < 10) {
day = "0" + day;
}
showContent = showContent.replaceAll("day", day);
}
if (showContent.indexOf("12hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
if (Number(h) > 12) {
if ((Number(h) - 12) < 10) {
h = "下午 0" + ((Number(h) - 12));
} else {
h = "下午 " + ((Number(h) - 12));
}
} else {
h = "上午 " + h;
}
showContent = showContent.replaceAll("12hour", h);
}
if (showContent.indexOf("24hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
showContent = showContent.replaceAll("24hour", h);
}
if (showContent.indexOf("min") >= 0) {
let m = myDate.getMinutes();//获取当前分钟数(0-59)
if (m < 10) {
m = "0" + m;
}
showContent = showContent.replaceAll("min", m);
}
if (showContent.indexOf("sec") >= 0) {
let s = myDate.getSeconds();//获取当前秒
if (s < 10) {
s = "0" + s;
}
showContent = showContent.replaceAll("sec", s);
}
if (showContent.indexOf("week") >= 0) {
var weekday = myDate.getDay();
var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
let week = weeks[weekday];
showContent = showContent.replaceAll("week", week);
}
if (showContent.indexOf("lunar") >= 0) {
var yy = myDate.getFullYear();
var mm = myDate.getMonth() + 1;
var dd = myDate.getDate();
console.log(yy + "-" + mm + "-" + dd);
let lunar = GetLunarDay(yy, mm, dd);
console.log(lunar);
showContent = showContent.replaceAll("lunar", lunar);
}
if (content.style != null && content.style != '') {
style += content.style;
}
divHtml += "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editDate('" + content.id + "');\">";
divHtml += showContent;
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_Date_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualDate/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
let data = showData;
// console.log(data)
let style = "";
let zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";line-height:" + height + ";";
if (data.background != null && data.background != '') {
style += "background:" + data.background + ";";
}
if (data.fontcolor != null && data.fontcolor != '') {
style += "color:" + data.fontcolor + ";";
} else {
style += "color:#000000;";
}
if (data.fontsize != null && data.fontsize != '') {
style += "font-size:" + data.fontsize + ";";
} else {
style += "font-size:14px;";
}
if (data.fontweight != null && data.fontweight != '') {
style += "font-weight:" + data.fontweight + ";";
} else {
style += "font-weight:400;";
}
if (data.textAlign != null && data.textAlign != '') {
style += "text-align:" + data.textAlign + ";";
} else {
style += "text-align:center;";
}
let showContent = "";
if (data.types != null && data.types != '') {
showContent = data.types;
}
// let nowDate = getNowTime();
let myDate = new Date;
if (showContent.indexOf("year") >= 0) {
let year = myDate.getFullYear(); //获取当前年
showContent = showContent.replaceAll("year", year);
}
if (showContent.indexOf("month") >= 0) {
let mon = myDate.getMonth() + 1; //获取当前月
if (mon < 10) {
mon = "0" + mon;
}
showContent = showContent.replaceAll("month", mon);
}
if (showContent.indexOf("day") >= 0) {
let day = myDate.getDate(); //获取当前日
if (day < 10) {
day = "0" + day;
}
showContent = showContent.replaceAll("day", day);
}
if (showContent.indexOf("12hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
if (Number(h) > 12) {
if ((Number(h) - 12) < 10) {
h = "下午 0" + ((Number(h) - 12));
} else {
h = "下午 " + ((Number(h) - 12));
}
} else {
h = "上午 " + h;
}
showContent = showContent.replaceAll("12hour", h);
}
if (showContent.indexOf("24hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
showContent = showContent.replaceAll("24hour", h);
}
if (showContent.indexOf("min") >= 0) {
let m = myDate.getMinutes();//获取当前分钟数(0-59)
if (m < 10) {
m = "0" + m;
}
showContent = showContent.replaceAll("min", m);
}
if (showContent.indexOf("sec") >= 0) {
let s = myDate.getSeconds();//获取当前秒
if (s < 10) {
s = "0" + s;
}
showContent = showContent.replaceAll("sec", s);
}
if (showContent.indexOf("week") >= 0) {
var weekday = myDate.getDay();
var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
let week = weeks[weekday];
showContent = showContent.replaceAll("week", week);
}
if (content.style != null && content.style != '') {
style += content.style;
}
divHtml += "<div class=\"moveDiv\" style=\"position:absolute;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += showContent;
divHtml += "</div>";
// }
// });
return divHtml;
}
function showAssembly_Date_View_Show(contentId, types) {
let showContent = types;
// let nowDate = getNowTime();
let myDate = new Date;
if (showContent.indexOf("year") >= 0) {
let year = myDate.getFullYear(); //获取当前年
showContent = showContent.replaceAll("year", year);
}
if (showContent.indexOf("month") >= 0) {
let mon = myDate.getMonth() + 1; //获取当前月
if (mon < 10) {
mon = "0" + mon;
}
showContent = showContent.replaceAll("month", mon);
}
if (showContent.indexOf("day") >= 0) {
let day = myDate.getDate(); //获取当前日
if (day < 10) {
day = "0" + day;
}
showContent = showContent.replaceAll("day", day);
}
if (showContent.indexOf("12hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
if (Number(h) > 12) {
if ((Number(h) - 12) < 10) {
h = "下午 0" + ((Number(h) - 12));
} else {
h = "下午 " + ((Number(h) - 12));
}
} else {
h = "上午 " + h;
}
showContent = showContent.replaceAll("12hour", h);
}
if (showContent.indexOf("24hour") >= 0) {
let h = myDate.getHours();//获取当前小时数(0-23)
if (h < 10) {
h = "0" + h;
}
showContent = showContent.replaceAll("24hour", h);
}
if (showContent.indexOf("min") >= 0) {
let m = myDate.getMinutes();//获取当前分钟数(0-59)
if (m < 10) {
m = "0" + m;
}
showContent = showContent.replaceAll("min", m);
}
if (showContent.indexOf("sec") >= 0) {
let s = myDate.getSeconds();//获取当前秒
if (s < 10) {
s = "0" + s;
}
showContent = showContent.replaceAll("sec", s);
}
if (showContent.indexOf("week") >= 0) {
var weekday = myDate.getDay();
var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
let week = weeks[weekday];
showContent = showContent.replaceAll("week", week);
}
$('#' + contentId).html(showContent);
}
/**
* 日期选择控件
*/
function showAssembly_DateSelect(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualDateSelect/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
data = data[0];
// console.log(data)
let style = "";
if (content.style != null && content.style != '') {
style += content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";";
let inputStyle = "";
if (data.style != null && data.style != '') {
inputStyle += data.style;
}
let background = "transparent";
if (data.background != null && data.background != '') {
inputStyle += "background:" + data.background + ";";
background = data.background;
}
let fontsize = "14px";
if (data.fontsize != null && data.fontsize != '') {
inputStyle += "font-size:" + data.fontsize + "px;";
fontsize = data.fontsize + "px";
}
let fontcolor = "#333";
if (data.fontcolor != null && data.fontcolor != '') {
inputStyle += "color:" + data.fontcolor + ";";
fontcolor = data.fontcolor;
}
let fontweight = "400";
if (data.fontweight != null && data.fontweight != '') {
inputStyle += "font-weight:" + data.fontweight + ";";
fontweight = data.fontweight;
}
let jsWidth = 20 * Number(width.replace("px", "")) / 200;
if (jsWidth < 20) {
jsWidth = 20;
}
divHtml += "<div onmouseup=\"doUp2('" + content.id + "');\" style=\"position:absolute;border:2px solid red;cursor:move;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editDateSelect('" + content.id + "');\">";
divHtml += " <input type=\"text\" class=\"form-control pull-left\" id=\"" + content.id + "reservationtime\" style=\"width:calc(100% - " + jsWidth + "px);height:100%;" + inputStyle + ";border:0px;\" autocomplete=\"off\"></input>";
divHtml += "<i style=\"width:" + jsWidth + "px;text-align: center;line-height:" + height + ";font-size:" + fontsize + ";font-weight:" + fontweight + ";background:" + background + ";color:" + fontcolor + ";\" class=\"fa fa-calendar\"></i>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_DateSelect_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualDateSelect/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
data = showData;
// console.log(data)
let style = "";
if (content.style != null && content.style != '') {
style += content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";";
let inputStyle = "";
if (data.style != null && data.style != '') {
inputStyle += data.style;
}
let background = "transparent";
if (data.background != null && data.background != '') {
inputStyle += "background:" + data.background + ";";
background = data.background;
}
let fontsize = "14px";
if (data.fontsize != null && data.fontsize != '') {
inputStyle += "font-size:" + data.fontsize + "px;";
fontsize = data.fontsize + "px";
}
let fontcolor = "#333";
if (data.fontcolor != null && data.fontcolor != '') {
inputStyle += "color:" + data.fontcolor + ";";
fontcolor = data.fontcolor;
}
let fontweight = "400";
if (data.fontweight != null && data.fontweight != '') {
inputStyle += "font-weight:" + data.fontweight + ";";
fontweight = data.fontweight;
}
let jsWidth = 20 * Number(width.replace("px", "")) / 200;
if (jsWidth < 20) {
jsWidth = 20;
}
divHtml += "<div style=\"position:absolute;cursor:move;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += " <input type=\"text\" class=\"form-control pull-left\" id=\"" + content.id + "reservationtime\" style=\"width:calc(100% - " + jsWidth + "px);height:100%;" + inputStyle + ";border:0px;\" autocomplete=\"off\"></input>";
divHtml += "<i style=\"width:" + jsWidth + "px;text-align: center;line-height:" + height + ";font-size:" + fontsize + ";font-weight:" + fontweight + ";background:" + background + ";color:" + fontcolor + ";\" class=\"fa fa-calendar\"></i>";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showDateSelect(contentId, type) {
var beginTimeStore = '';
var endTimeStore = '';
let separator = " ~ ";
let singleDatePicker = "false";
let calendarMode = "day";
let format = "YYYY-MM-DD";
if (type == '0') {
singleDatePicker = "true";
calendarMode = "day";
format = "YYYY-MM-DD";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 10);
} else {
beginTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore);
} else if (type == '1') {
singleDatePicker = "true";
calendarMode = "month";
format = "YYYY-MM";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 7);
} else {
beginTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore);
} else if (type == '2') {
singleDatePicker = "true";
calendarMode = "year";
format = "YYYY";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 4);
} else {
beginTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore);
} else if (type == '3') {
singleDatePicker = "false";
calendarMode = "day";
format = "YYYY-MM-DD";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 10);
} else {
beginTimeStore = moment().subtract(6, 'days').format(format);
}
if (edt != '') {
endTimeStore = edt.substring(0, 10);
} else {
endTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore + separator + endTimeStore);
} else if (type == '4') {
singleDatePicker = "false";
calendarMode = "month";
format = "YYYY-MM";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 7);
} else {
beginTimeStore = moment().subtract(1, 'month').format(format);
}
if (edt != '') {
endTimeStore = edt.substring(0, 7);
} else {
endTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore + separator + endTimeStore);
} else if (type == '5') {
singleDatePicker = "false";
calendarMode = "year";
format = "YYYY";
if (sdt != '') {
beginTimeStore = sdt.substring(0, 4);
} else {
beginTimeStore = moment().subtract(1, 'year').format(format);
}
if (edt != '') {
endTimeStore = edt.substring(0, 4);
} else {
endTimeStore = moment().subtract(0, 'days').format(format);
}
$('#' + contentId + 'reservationtime').val(beginTimeStore + separator + endTimeStore);
}
var locale = {
"format": format,
"separator": separator,
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#' + contentId + 'reservationtime').daterangepicker({
startDate: beginTimeStore,
endDate: endTimeStore,
singleDatePicker: eval(singleDatePicker.toLowerCase()), //单日历
// minDate: '1937-01-01',
// maxDate: moment(),
// dateLimit: {
// days: 14000
// },
calendarMode: calendarMode,
showDropdowns: false,
showWeekNumbers: false,
timePicker: false,
timePickerIncrement: 1,
timePicker12Hour: false,
linkedCalendars: false,
autoUpdateInput: false,
timePickerSeconds: false,
// buttonClasses: ['btn'],
// applyClass: 'green',
// cancelClass: 'default',
format: format,
separator: separator,
// alwaysShowCalendars:true,
// autoApply:true,
// 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')]
// },
locale: locale
}, function (start, end, label) {
beginTimeStore = start.format(format);
endTimeStore = end.format(format);
sdt = beginTimeStore;
edt = endTimeStore;
if (sdt.length == 7) {
sdt = sdt + "-01";
} else if (sdt.length == 4) {
sdt = sdt + "-01-01";
}
if (type == '0') {
edt = sdt.substring(0, 10) + " 23:59";
} else if (type == '1') {
let lastDay = getMonthMaxDay(sdt);
edt = sdt.substring(0, 7) + "-" + lastDay + " 23:59";
} else if (type == '2') {
edt = sdt.substring(0, 4) + "-12-31 23:59";
}
if (edt.length == 7) {
edt = edt + "-01";
} else if (edt.length == 4) {
edt = edt + "-01-01";
}
// console.log(sdt)
// console.log(edt)
showFrame(frameId);
});
// if (sdt != '') {
// sdt = sdt;
// } else {
sdt = beginTimeStore;
// }
// if (edt != '') {
// edt = edt;
// } else {
edt = endTimeStore;
// }
if (sdt.length == 7) {
sdt = sdt + "-01";
} else if (sdt.length == 4) {
sdt = sdt + "-01-01";
}
if (type == '0') {
edt = sdt.substring(0, 10) + " 23:59";
} else if (type == '1') {
let lastDay = getMonthMaxDay(sdt);
edt = sdt.substring(0, 7) + "-" + lastDay + " 23:59";
} else if (type == '2') {
edt = sdt.substring(0, 4) + "-12-31 23:59";
}
if (edt.length == 7) {
edt = edt + "-01";
} else if (edt.length == 4) {
edt = edt + "-01-01";
}
// console.log(sdt)
// console.log(edt)
}
/**
* 外部链接组件
*/
function showAssembly_Iframe(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let showName = "";
if (content.name != "") {
showName = content.name;
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + content.background + ";color:#00ff00;text-align:center;width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editIframe('" + content.id + "');\">" +
"" + showName + "";
divHtml += "<svg t='1634724475152' class='icon' viewBox='0 0 1024 1024' p-id='1780' data-spm-anchor-id='a313x.7781069.0.i1' width='16' height='16'>";
divHtml += "<path d='M554.4 611.3l-20-20c-6.2-6.2-16.4-6.2-22.6 0-6.2 6.2-6.2 16.4 0 22.6l20 20c13.6 13.6 21.4 31.4 21.9 50 0.5 18.3-6.1 35.2-18.5 47.7L356.8 910c-26 26-69.8 24.5-97.7-3.4L117.6 765.1c-13.6-13.6-21.4-31.4-21.9-50-0.5-18.3 6.1-35.2 18.5-47.7L292.6 489c26-26 69.8-24.5 97.7 3.4l23.2 23.2c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6l-23.2-23.2c-40.3-40.3-104.5-41.9-142.9-3.4L91.6 644.8c-18.8 18.8-28.7 44-27.9 71.2 0.8 26.8 11.9 52.3 31.3 71.7l141.5 141.5c20.8 20.8 47.9 31.3 74.6 31.3 25 0 49.7-9.2 68.3-27.9l178.4-178.4c18.8-18.8 28.7-44 27.9-71.2-0.7-26.8-11.9-52.3-31.3-71.7zM928.3 237.4L786.9 95.9c-19.4-19.4-44.9-30.5-71.7-31.3-27.2-0.8-52.5 9.1-71.2 27.9L465.5 270.9c-38.5 38.5-36.9 102.6 3.4 142.9l20 20c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6l-20-20c-27.9-27.9-29.4-71.7-3.4-97.7l178.4-178.4c12.5-12.5 29.4-19 47.7-18.5 18.6 0.5 36.4 8.3 50 21.9L905.7 260c27.9 27.9 29.4 71.7 3.4 97.7L730.7 536.1c-12.5 12.5-29.4 19.1-47.7 18.5-18.6-0.5-36.4-8.3-50-21.9l-23.2-23.2c-6.2-6.2-16.4-6.2-22.6 0-6.2 6.2-6.2 16.4 0 22.6l23.2 23.2c19.4 19.4 44.9 30.5 71.7 31.3h2.9c26 0 50.2-9.9 68.3-27.9l178.4-178.4c38.5-38.5 37-102.6-3.4-142.9z' fill='#2c2c2c' p-id='1781'></path>";
divHtml += "<path d='M349.1 676.1c-13.7-13.7-13.7-36 0-49.7l278.1-278.1c13.7-13.7 36-13.7 49.7 0 13.7 13.7 13.7 36 0 49.7L398.8 676.1c-13.7 13.8-36 13.8-49.7 0z' fill='#2c2c2c' p-id='1782'></path>";
divHtml += "</svg>";
divHtml += "</div>";
return divHtml;
}
/**
* 外部链接组件
*/
function showAssembly_Iframe_View(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
//需要绑定开关组件加
let hiddenSt = "display:block;";
if (switchHiddenPoints.indexOf(content.id) != -1) {
hiddenSt = "display:none;";
}
style += hiddenSt;
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "").replace("px", "") + "%";
height = height.replace("%", "").replace("px", "") + "%";
}
let src = "";
if (content.src != null && content.src != '') {
src = content.src;
}
if (src.indexOf("http") >= 0) {
src = src;
} else {
if (src.substring(0, 1) == '/') {
src = ext.contextPath + src;
} else {
src = ext.contextPath + '/' + src;
}
}
divHtml = "<div style=\"position:absolute;top:" + postY + ";left:" + postX + ";background-color: " + content.background + ";width:" + width + ";height:" + height + ";cursor: move;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "<iframe scrolling=\"auto\" allowtransparency=\"yes\" style=\"height:100%;width:100%;border:0px;padding:0px;margin:0px;\" src=\"" + src + "\"></iframe>";
divHtml += "</div>";
return divHtml;
}
/**
* 标签页组件
*/
function showAssembly_Tab(content) {
var style = content.style;
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmouseup=\"doUp2('" + content.id + "');\" \"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;width:" + width + ";height:" + height + ";" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"showContainerTab('" + content.id + "');\">";
if (content.tabtype != null && content.tabtype == 'se') {//下拉
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualTab/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
var ckData = JSON.stringify(data);
for (let i = 0; i < data.length; i++) {
let tab = data[i];
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let height = '100%';
if (tab.height != null && tab.height != '') {
height = tab.height;
}
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
if (i == 0) {
divHtml += "<select id=\"" + content.id + "TabSelect\" class=\"form-control select2\" style=\"width:100%;height:100%;background-color: " + ckbackground + ";color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";" + ckstyle + "\" onchange='clickTab(this.value," + ckData + ")'>";
}
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let selected = '';
if (firstck == 'true') {
selected = "selected='selected'";
}
divHtml += "<option value=\"" + tab.id + "\" style='background-color: " + ckbackground + ";' " + selected + ">" + text + "</option>";
}
}
})
divHtml += "</select>";
} else if (content.tabtype != null && content.tabtype == 'sheet') {
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualTab/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
var ckData = JSON.stringify(data);
for (let i = 0; i < data.length; i++) {
let tab = data[i];
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let width = '120';
if (tab.width != null && tab.width != '') {
width = tab.width;
}
let height = '60';
if (tab.height != null && tab.height != '') {
height = tab.height;
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
if (ckbackground.indexOf("/") >= 0) {
var path = getRootPath() + ckbackground;
ckbackground = 'url(' + path + ') no-repeat';
}
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let cktextAlign = 'center';
// if (tab.cktextAlign != null && tab.cktextAlign != '') {
// cktextAlign = tab.cktextAlign;
// }
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
let unckbackground = 'transparent';
if (tab.unckbackground != null && tab.unckbackground != '') {
unckbackground = tab.unckbackground;
if (unckbackground.indexOf("/") >= 0) {
var path = getRootPath() + unckbackground;
unckbackground = 'url(' + path + ') no-repeat';
}
}
let unckfontcolor = '#555555';
if (tab.unckfontcolor != null && tab.unckfontcolor != '') {
unckfontcolor = tab.unckfontcolor;
}
let unckfontsize = '14';
if (tab.unckfontsize != null && tab.unckfontsize != '') {
unckfontsize = tab.unckfontsize;
}
let unckfontweight = '400';
if (tab.unckfontweight != null && tab.unckfontweight != '') {
unckfontweight = tab.unckfontweight;
}
let uncktextAlign = 'center';
// if (tab.uncktextAlign != null && tab.uncktextAlign != '') {
// uncktextAlign = tab.uncktextAlign;
// }
let unckstyle = '';
if (tab.unckstyle != null && tab.unckstyle != '') {
unckstyle = tab.unckstyle;
}
if (firstck == 'true') {
divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + ckbackground + ";background-size:100% 100%;color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";text-align: " + cktextAlign + ";cursor: pointer;" + ckstyle + "' ondblclick='clickTab(\"" + tab.id + "\"," + ckData + ")' >";
} else {
divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + unckbackground + ";background-size:100% 100%;color: " + unckfontcolor + ";font-size: " + unckfontsize + "px;font-weight: " + unckfontweight + ";text-align: " + uncktextAlign + ";cursor: pointer;" + unckstyle + "' ondblclick='clickTab(\"" + tab.id + "\"," + ckData + ")'>";
}
divHtml += text;
divHtml += "</div>";
}
}
});
} else if (content.tabtype != null && content.tabtype == 'radio') {
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualTab/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
var ckData = JSON.stringify(data);
for (let i = 0; i < data.length; i++) {
let tab = data[i];
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let width = '120';
if (tab.width != null && tab.width != '') {
width = tab.width;
}
let height = '60';
if (tab.height != null && tab.height != '') {
height = tab.height;
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
if (ckbackground.indexOf("/") >= 0) {
var path = getRootPath() + ckbackground;
ckbackground = 'url(' + path + ') no-repeat';
}
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let cktextAlign = 'center';
// if (tab.cktextAlign != null && tab.cktextAlign != '') {
// cktextAlign = tab.cktextAlign;
// }
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
let unckbackground = 'transparent';
if (tab.unckbackground != null && tab.unckbackground != '') {
unckbackground = tab.unckbackground;
if (unckbackground.indexOf("/") >= 0) {
var path = getRootPath() + unckbackground;
unckbackground = 'url(' + path + ') no-repeat';
}
}
let unckfontcolor = '#555555';
if (tab.unckfontcolor != null && tab.unckfontcolor != '') {
unckfontcolor = tab.unckfontcolor;
}
let unckfontsize = '14';
if (tab.unckfontsize != null && tab.unckfontsize != '') {
unckfontsize = tab.unckfontsize;
}
let unckfontweight = '400';
if (tab.unckfontweight != null && tab.unckfontweight != '') {
unckfontweight = tab.unckfontweight;
}
let uncktextAlign = 'center';
// if (tab.uncktextAlign != null && tab.uncktextAlign != '') {
// uncktextAlign = tab.uncktextAlign;
// }
let unckstyle = '';
if (tab.unckstyle != null && tab.unckstyle != '') {
unckstyle = tab.unckstyle;
}
let radioBackground = tab.radioBackground;
let radioCkBackground = tab.radioCkBackground;
let radioSize = tab.radioSize.replace("px", "");
let radioCkSize = tab.radioCkSize.replace("px", "");
let m_t = (height.replace("px", "") - radioSize) / 2;
let m_t2 = (radioSize - radioCkSize) / 2;
divHtml += "<div style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + ckbackground + ";background-size:100% 100%;color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";text-align: " + cktextAlign + ";cursor: pointer;" + ckstyle + "' >";
if (firstck == 'true') {
divHtml += "<div id='" + tab.pid + "_" + i + "_out' style='float:left;margin-top: " + m_t + "px;width: " + radioSize + "px;height: " + radioSize + "px;border-radius: 50%;background: " + radioBackground + ";position: relative;' onclick='radioSelect(\"" + tab.pid + "\",\"" + data.length + "\",\"" + i + "\",\"" + radioCkBackground + "\",\"" + tab.id + "\"," + ckData + ")'>";
divHtml += "<div id='" + tab.pid + "_" + i + "_in' style='position: absolute;left: " + m_t2 + "px;top:" + m_t2 + "px;width:" + radioCkSize + "px;height:" + radioCkSize + "px;background: " + radioCkBackground + ";border-radius: 50%;'></div>";
divHtml += "</div>";
divHtml += "<div style='float:left;'>" + text + "</div>";
} else {
divHtml += "<div id='" + tab.pid + "_" + i + "_out' style='float:left;margin-top: " + m_t + "px;width: " + radioSize + "px;height: " + radioSize + "px;border-radius: 50%;background: #616161;position: relative;' onclick='radioSelect(\"" + tab.pid + "\",\"" + data.length + "\",\"" + i + "\",\"" + radioCkBackground + "\",\"" + tab.id + "\"," + ckData + ")'>";
divHtml += "<div id='" + tab.pid + "_" + i + "_in' style='position: absolute;left: " + m_t2 + "px;top:" + m_t2 + "px;width:" + radioCkSize + "px;height:" + radioCkSize + "px;background: transparent;border-radius: 50%;'></div>";
divHtml += "</div>";
divHtml += "<div style='float:left;'>" + text + "</div>";
}
divHtml += "</div>";
}
}
});
}
divHtml += "</div>";
return divHtml;
}
function showAssembly_Tab_View(content, showData) {
var contentStyle = content.style;
var divwidth = content.width;
var divheight = content.height;
let onmouseupSt = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
contentStyle += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (divwidth.indexOf("px") < 0 && divwidth.indexOf("%") < 0) {
divwidth += "px";
}
if (divheight.indexOf("px") < 0 && divheight.indexOf("%") < 0) {
divheight += "px";
}
var divHtml = "<div style=\"position:absolute;top:" + postY + ";left:" + postX + ";width:" + divwidth + ";height:" + divheight + ";" + contentStyle + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
var ckData = JSON.stringify(showData);
if (content.tabtype != null && content.tabtype == 'se') {//下拉
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualTab/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
for (let i = 0; i < showData.length; i++) {
let tab = showData[i];
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
if (i == 0) {
divHtml += "<select id=\"" + content.id + "TabSelect\" class=\"form-control select2\" style=\"width:100%;height:100%;background: " + ckbackground + ";color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";" + ckstyle + "\" onchange='clickTab(this.value," + ckData + ")'>";
}
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let selected = '';
if (firstck == 'true') {
selected = "selected='selected'";
}
divHtml += "<option value=\"" + tab.id + "\" " + selected + ">" + text + "</option>";
}
// }
// })
divHtml += "</select>";
} else if (content.tabtype != null && content.tabtype == 'sheet') {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualTab/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
// console.log(showData)
for (let i = 0; i < showData.length; i++) {
let tab = showData[i];
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let width = '120';
if (tab.width != null && tab.width != '') {
width = tab.width;
}
let height = '60';
if (tab.height != null && tab.height != '') {
height = tab.height;
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
if (ckbackground.indexOf("/") >= 0) {
var path = getRootPath() + ckbackground;
ckbackground = 'url(' + path + ') no-repeat';
}
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let cktextAlign = 'center';
// if (tab.cktextAlign != null && tab.cktextAlign != '') {
// cktextAlign = tab.cktextAlign;
// }
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
let unckbackground = 'transparent';
if (tab.unckbackground != null && tab.unckbackground != '') {
unckbackground = tab.unckbackground;
if (unckbackground.indexOf("/") >= 0) {
var path = getRootPath() + unckbackground;
unckbackground = 'url(' + path + ') no-repeat';
}
}
let unckfontcolor = '#555555';
if (tab.unckfontcolor != null && tab.unckfontcolor != '') {
unckfontcolor = tab.unckfontcolor;
}
let unckfontsize = '14';
if (tab.unckfontsize != null && tab.unckfontsize != '') {
unckfontsize = tab.unckfontsize;
}
let unckfontweight = '400';
if (tab.unckfontweight != null && tab.unckfontweight != '') {
unckfontweight = tab.unckfontweight;
}
let uncktextAlign = 'center';
// if (tab.uncktextAlign != null && tab.uncktextAlign != '') {
// uncktextAlign = tab.uncktextAlign;
// }
let unckstyle = '';
if (tab.unckstyle != null && tab.unckstyle != '') {
unckstyle = tab.unckstyle;
}
// if (nowCk == '') {
// nowTabIds = tab.id;
if (firstck == 'true') {
divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + ckbackground + ";background-size:100% 100%;color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";text-align: " + cktextAlign + ";cursor: pointer;" + ckstyle + "' onclick='clickTab(\"" + tab.id + "\"," + ckData + ")' >";
} else {
divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + unckbackground + ";background-size:100% 100%;color: " + unckfontcolor + ";font-size: " + unckfontsize + "px;font-weight: " + unckfontweight + ";text-align: " + uncktextAlign + ";cursor: pointer;" + unckstyle + "' onclick='clickTab(\"" + tab.id + "\"," + ckData + ")'>";
}
// } else {
// nowTabIds = nowCk;
// if(tab.id==nowCk){
// divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + ckbackground + ";color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";text-align: " + cktextAlign + ";cursor: pointer;' ondblclick='clickTab(\"" + tab.id + "\"," + ckData + ")' >";
// }else{
// divHtml += "<div id='" + tab.id + "' pid='" + tab.pid + "' style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + unckbackground + ";color: " + unckfontcolor + ";font-size: " + unckfontsize + "px;font-weight: " + unckfontweight + ";text-align: " + uncktextAlign + ";cursor: pointer;' ondblclick='clickTab(\"" + tab.id + "\"," + ckData + ")'>";
// }
// }
divHtml += text;
divHtml += "</div>";
}
// }
// });
} else if (content.tabtype != null && content.tabtype == 'radio') {
for (let i = 0; i < showData.length; i++) {
let tab = showData[i];
let text = '';
if (tab.text != null && tab.text != '') {
text = tab.text;
}
let firstck = 'false';
if (tab.firstck != null && tab.firstck != '') {
firstck = tab.firstck;
}
let width = '120';
if (tab.width != null && tab.width != '') {
width = tab.width;
}
let height = '60';
if (tab.height != null && tab.height != '') {
height = tab.height;
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let ckbackground = 'transparent';
if (tab.ckbackground != null && tab.ckbackground != '') {
ckbackground = tab.ckbackground;
if (ckbackground.indexOf("/") >= 0) {
var path = getRootPath() + ckbackground;
ckbackground = 'url(' + path + ') no-repeat';
}
}
let ckfontcolor = '#3c8dbc';
if (tab.ckfontcolor != null && tab.ckfontcolor != '') {
ckfontcolor = tab.ckfontcolor;
}
let ckfontsize = '14';
if (tab.ckfontsize != null && tab.ckfontsize != '') {
ckfontsize = tab.ckfontsize;
}
let ckfontweight = '400';
if (tab.ckfontweight != null && tab.ckfontweight != '') {
ckfontweight = tab.ckfontweight;
}
let cktextAlign = 'center';
// if (tab.cktextAlign != null && tab.cktextAlign != '') {
// cktextAlign = tab.cktextAlign;
// }
let ckstyle = '';
if (tab.ckstyle != null && tab.ckstyle != '') {
ckstyle = tab.ckstyle;
}
let unckbackground = 'transparent';
if (tab.unckbackground != null && tab.unckbackground != '') {
unckbackground = tab.unckbackground;
if (unckbackground.indexOf("/") >= 0) {
var path = getRootPath() + unckbackground;
unckbackground = 'url(' + path + ') no-repeat';
}
}
let unckfontcolor = '#555555';
if (tab.unckfontcolor != null && tab.unckfontcolor != '') {
unckfontcolor = tab.unckfontcolor;
}
let unckfontsize = '14';
if (tab.unckfontsize != null && tab.unckfontsize != '') {
unckfontsize = tab.unckfontsize;
}
let unckfontweight = '400';
if (tab.unckfontweight != null && tab.unckfontweight != '') {
unckfontweight = tab.unckfontweight;
}
let uncktextAlign = 'center';
// if (tab.uncktextAlign != null && tab.uncktextAlign != '') {
// uncktextAlign = tab.uncktextAlign;
// }
let unckstyle = '';
if (tab.unckstyle != null && tab.unckstyle != '') {
unckstyle = tab.unckstyle;
}
let radioBackground = tab.radioBackground;
let radioCkBackground = tab.radioCkBackground;
let radioSize = tab.radioSize.replace("px", "");
let radioCkSize = tab.radioCkSize.replace("px", "");
let m_t = (height.replace("px", "") - radioSize) / 2;
let m_t2 = (radioSize - radioCkSize) / 2;
divHtml += "<div style='float:left;width:" + width + ";height:" + height + ";line-height:" + height + ";background: " + ckbackground + ";background-size:100% 100%;color: " + ckfontcolor + ";font-size: " + ckfontsize + "px;font-weight: " + ckfontweight + ";text-align: " + cktextAlign + ";cursor: pointer;" + ckstyle + "' >";
if (firstck == 'true') {
divHtml += "<div id='" + tab.pid + "_" + i + "_out' style='float:left;margin-top: " + m_t + "px;width: " + radioSize + "px;height: " + radioSize + "px;border-radius: 50%;background: " + radioBackground + ";position: relative;' onclick='radioSelect(\"" + tab.pid + "\",\"" + showData.length + "\",\"" + i + "\",\"" + radioCkBackground + "\",\"" + tab.id + "\"," + ckData + ")'>";
divHtml += "<div id='" + tab.pid + "_" + i + "_in' style='position: absolute;left: " + m_t2 + "px;top:" + m_t2 + "px;width:" + radioCkSize + "px;height:" + radioCkSize + "px;background: " + radioCkBackground + ";border-radius: 50%;'></div>";
divHtml += "</div>";
divHtml += "<div style='float:left;'>" + text + "</div>";
} else {
divHtml += "<div id='" + tab.pid + "_" + i + "_out' style='float:left;margin-top: " + m_t + "px;width: " + radioSize + "px;height: " + radioSize + "px;border-radius: 50%;background: #616161;position: relative;' onclick='radioSelect(\"" + tab.pid + "\",\"" + showData.length + "\",\"" + i + "\",\"" + radioCkBackground + "\",\"" + tab.id + "\"," + ckData + ")'>";
divHtml += "<div id='" + tab.pid + "_" + i + "_in' style='position: absolute;left: " + m_t2 + "px;top:" + m_t2 + "px;width:" + radioCkSize + "px;height:" + radioCkSize + "px;background: transparent;border-radius: 50%;'></div>";
divHtml += "</div>";
divHtml += "<div style='float:left;'>" + text + "</div>";
}
divHtml += "</div>";
}
}
divHtml += "</div>";
return divHtml;
}
/**
* 下拉跳转
*/
function showAssembly_SelectJump(content) {
var style = content.style;
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;position:absolute;width:" + width + ";height:" + height + ";padding:2px;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editSelectJump('" + content.id + "');\">";
divHtml += "<svg t='1703644888986' class='icon' viewBox='0 0 1024 1024' p-id='7596' width='16' height='16'>";
divHtml += "<path d='M839.68 445.44H614.4l112.64 122.88z' fill='#515151' p-id='7597'></path>";
divHtml += "<path d='M957.44 194.56H81.92c-10.24 0-20.48 10.24-20.48 25.6V742.4c0 10.24 10.24 20.48 25.6 20.48h875.52c10.24 0 25.6-10.24 25.6-20.48V220.16c-5.12-15.36-15.36-25.6-30.72-25.6z m-51.2 471.04c0 10.24-10.24 15.36-20.48 15.36H158.72c-10.24 0-20.48-5.12-20.48-15.36V291.84c0-10.24 10.24-15.36 20.48-15.36h727.04c10.24 0 20.48 5.12 20.48 15.36V665.6z' fill='#515151' p-id='7598'></path>";
divHtml += "</svg>";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSelect/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (datas) {
// console.log(datas)
if (datas.length > 0) {
divHtml += "<div id=\"" + content.id + "_select-menu-list\" style='display: none;background-color: transparent;margin-top: " + (Number(height.replace("px", "")) - 25) + "px;'>";
for (let i = 0; i < datas.length; i++) {
let data = datas[i];
let text = data.textcontent;
let fontsize = '';
if (data.fontsize != null && data.fontsize != '') {
fontsize = data.fontsize;
}
let fontcolor = '';
if (data.fontcolor != null && data.fontcolor != '') {
fontcolor = data.fontcolor;
}
let fontweight = '';
if (data.fontweight != null && data.fontweight != '') {
fontweight = data.fontweight;
}
let height = '';
if (data.height != null && data.height != '') {
height = data.height.replace("px", "") + "px";
}
let background = '';
if (data.background != null && data.background != '') {
background = data.background;
}
let style = '';
if (data.style != null && data.style != '') {
style = data.style;
}
style += "color: " + fontcolor + ";font-size: " + fontsize + "px;font-weight: " + fontweight + ";height:" + height + ";line-height:" + height + ";background:" + background + ";";
divHtml += "<div id=\"" + data.id + "_select-menu-list-option\" style=\"padding-left: 10px;" + style + "cursor: pointer;\">" + text + "</div>";
}
divHtml += "</div>";
}
}
});
divHtml += "</div>";
return divHtml;
}
function showAssembly_SelectJump_View(content, showData) {
var style = content.style;
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var divHtml = "<div " + onmouseupSt + " style=\"width:" + width + ";height:" + height + ";" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
// console.log(datas)
if (showData.length > 0) {
divHtml += "<div id=\"" + content.id + "_select-menu-list\" style='display: none;background-color: transparent;margin-top: " + (Number(height.replace("px", "")) - 2) + "px;'>";
for (let i = 0; i < showData.length; i++) {
let data = showData[i];
let text = data.textcontent;
let fontsize = '';
if (data.fontsize != null && data.fontsize != '') {
fontsize = data.fontsize;
}
let fontcolor = '';
if (data.fontcolor != null && data.fontcolor != '') {
fontcolor = data.fontcolor;
}
let fontweight = '';
if (data.fontweight != null && data.fontweight != '') {
fontweight = data.fontweight;
}
let height = '';
if (data.height != null && data.height != '') {
height = data.height.replace("px", "") + "px";
}
let background = '';
if (data.background != null && data.background != '') {
background = data.background;
}
let style = '';
if (data.style != null && data.style != '') {
style = data.style;
}
let urlstring = '';
if (data.urlstring != null && data.urlstring != '') {
urlstring = data.urlstring;
}
style += "color: " + fontcolor + ";font-size: " + fontsize + "px;font-weight: " + fontweight + ";height:" + height + ";line-height:" + height + ";background:" + background + ";";
divHtml += "<div id=\"" + data.id + "_select-menu-list-option\" style=\"padding-left: 10px;" + style + "cursor: pointer;\" onclick=\"reFrame('" + urlstring + "');\">" + text + "</div>";
}
divHtml += "</div>";
}
divHtml += "</div>";
return divHtml;
}
/**
* 数据映射组件
*/
function showAssembly_MpView(content) {
var style = content.style;
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv\" onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;position:absolute;width:" + width + ";height:" + height + ";padding:2px;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"showContainerMpView('" + content.id + "');\">";
divHtml += "<svg t='1635149151873' class='icon' viewBox='0 0 1217 1024' p-id='5835' width='16' height='16'>";
divHtml += "<path d='M81.279482 403.912645l1.601294-0.055217 1054.866326-0.110434h0.55217a54.112699 54.112699 0 0 0 54.057482-53.33966 52.732273 52.732273 0 0 0-23.246374-44.78102L775.026368 35.780642a55.051389 55.051389 0 0 0-74.211701 11.871663l-1.766945 2.374333a52.014451 52.014451 0 0 0-8.503424 39.424966 51.904017 51.904017 0 0 0 21.755513 33.903263l253.611863 173.712806H83.101645a53.450094 53.450094 0 0 0-1.822163 106.844972zM1137.471016 619.976921H82.273389a54.112699 54.112699 0 0 0-54.057482 53.394877 52.897924 52.897924 0 0 0 23.301591 44.781019l394.028795 269.790456v0.055217c9.276463 6.294743 20.099002 9.607765 31.308061 9.607765h0.165651a55.051389 55.051389 0 0 0 44.449717-22.528552l1.104341-1.546077a52.621839 52.621839 0 0 0-14.35643-72.996927l-253.611863-173.712806H1137.471016a53.450094 53.450094 0 0 0 0-106.844972z'></path>";
divHtml += "</svg>";
divHtml += "</div>";
return divHtml;
}
function showAssembly_MpView_View(content, showData, mqSt) {
var contentStyle = content.style;
var divwidth = content.width;
var divheight = content.height;
if (content.zIndex != null && content.zIndex != '') {
contentStyle += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("px") < 0 && postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("px") < 0 && postY.indexOf("%") < 0) {
postY += "px";
}
if (divwidth.indexOf("px") < 0 && divwidth.indexOf("%") < 0) {
divwidth += "px";
}
if (divheight.indexOf("px") < 0 && divheight.indexOf("%") < 0) {
divheight += "px";
}
var divHtml = "<div style=\"position:absolute;top:" + postY + ";left:" + postX + ";width:" + divwidth + ";height:" + divheight + ";" + contentStyle + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualMpView/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
let background = "";
for (let i = 0; i < showData.length; i++) {
let mpView = showData[i];
let mpid = "";
if (mpView.mpid != null && mpView.mpid != '') {
mpid = mpView.mpid;
// mqttMpcode = mqttMpcode + mpid + ",";
}
let jsmpValue = "";
if (mpView.jsmpValue != null) {
jsmpValue = mpView.jsmpValue;
}
let jsvalue = "";
if (jsmpValue != '') {
jsvalue = jsmpValue;
} else {
if (mpView.jsvalue != null) {
jsvalue = mpView.jsvalue;
}
}
let jsmethod = "";
if (mpView.jsmethod != null && mpView.jsmethod != '') {
jsmethod = mpView.jsmethod;
}
let forbackground = "";
if (mpView.background != null && mpView.background != '') {
forbackground = mpView.background;
} else {
forbackground = "transparent";
}
let parmvalue = "";
if (mpView.mpid != null && mpView.mpid != '') {
parmvalue = mpView.mpValue;
} else if (mpView.url != null && mpView.url != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + mpView.url,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
parmvalue = result.result;
}
});
}
let showBackground = getMpValueForShow(parmvalue, jsvalue, jsmethod, forbackground, i);
if (showBackground != '-') {
background += showBackground + "|";
} else {
// background += "-|";
}
}
background = background.substring(0, background.length - 1);
background = background.split("|");
// console.log(background)
// mpValueDataJson
if (background != null && background.length > 0) {
// for (let j = 0; j < background.length; j++) {
// mpValueDataJson.nowIndex = background[1];
let bkData = background[0];
if (bkData != '-' && bkData != '') {
let bkS = bkData.split(",");
//为mq更新使用 记录 首次或者上次采用的映射条件序号
eval("mpValueDataJson.AA" + content.id + "").nowIndex = bkS[1];
// console.log(eval("mpValueDataJson.AA" + content.id + ".nowIndex"))
let backgroundT = "";
let filest = "false";
if (showData[Number(bkS[1])].filest != '') {
filest = showData[Number(bkS[1])].filest;
}
let ckid = showData[Number(bkS[1])].id;
let ckMinioId = "";
if (filest == 'true') {
ckMinioId = showData[Number(bkS[1])].id;
if (mqSt == 'true') {
backgroundT = "url(" + getMinioFile(showData[Number(bkS[1])].id, 'tb_pro_dataVisual_mpView_file', 'datavisual') + ")";
}
} else {
backgroundT = bkS[0];
}
let fontsize = "14px";
if (showData[Number(bkS[1])].fontsize != null) {
if (showData[Number(bkS[1])].fontsize != '') {
fontsize = showData[Number(bkS[1])].fontsize.replace("px") + "px";
}
}
let fontcolor = "#000000";
if (showData[Number(bkS[1])].fontcolor != null) {
if (showData[Number(bkS[1])].fontcolor != '') {
fontcolor = showData[Number(bkS[1])].fontcolor;
}
}
let fontweight = "400";
if (showData[Number(bkS[1])].fontweight != null) {
if (showData[Number(bkS[1])].fontweight != '') {
fontweight = showData[Number(bkS[1])].fontweight;
}
}
let outValueType = "0";
if (showData[Number(bkS[1])].outValueType != null) {
if (showData[Number(bkS[1])].outValueType != '') {
outValueType = showData[Number(bkS[1])].outValueType;
}
}
let autoBkSt = "false";
let autoheight = "100";
let textShow = "";
if (outValueType == '0') {
if (showData[Number(bkS[1])].textshow != null) {
if (showData[Number(bkS[1])].textshow != '') {
textShow = showData[Number(bkS[1])].textshow;
}
}
} else if (outValueType == '1') {
if (showData[Number(bkS[1])].autoBkSt != null) {
if (showData[Number(bkS[1])].autoBkSt != '') {
autoBkSt = showData[Number(bkS[1])].autoBkSt;
}
}
if (autoBkSt == 'true') {
let autoBkStMaxvalue = "";
if (showData[Number(bkS[1])].autoBkStMaxvalue != null) {
if (showData[Number(bkS[1])].autoBkStMaxvalue != '') {
autoBkStMaxvalue = showData[Number(bkS[1])].autoBkStMaxvalue;
}
}
if (autoBkStMaxvalue != '') {
autoheight = ((Number(showData[Number(bkS[1])].mpValue) / Number(autoBkStMaxvalue)) * 100).toFixed(0);
}
}
}
if (Number(autoheight) > 100) {
autoheight = "100";
}
let opacity = "1";
if (showData[Number(bkS[1])].opacity != null) {
if (showData[Number(bkS[1])].opacity != '') {
opacity = showData[Number(bkS[1])].opacity;
}
}
let style = "";
if (showData[Number(bkS[1])].style != null) {
if (showData[Number(bkS[1])].style != '') {
style = showData[Number(bkS[1])].style;
}
}
if (autoBkSt == 'true') {
let autoBkTextSt = "true";
if (showData[Number(bkS[1])].autoBkTextSt != null) {
if (showData[Number(bkS[1])].autoBkTextSt != '') {
autoBkTextSt = showData[Number(bkS[1])].autoBkTextSt;
}
}
let autoBkTextType = "";
if (showData[Number(bkS[1])].autoBkTextType != null) {
if (showData[Number(bkS[1])].autoBkTextType != '') {
autoBkTextType = showData[Number(bkS[1])].autoBkTextType;
}
}
if (autoBkTextSt == 'true') {
if (autoBkTextType == '1') {
textShow = showData[Number(bkS[1])].mpValue;
} else if (autoBkTextType == '2') {
textShow = autoheight + "%";
} else {
textShow = "";
}
}
let autoBkBackground = "";
if (showData[Number(bkS[1])].autoBkBackground != null) {
if (showData[Number(bkS[1])].autoBkBackground != '') {
autoBkBackground = showData[Number(bkS[1])].autoBkBackground;
}
}
divHtml += "<div id=\"" + ckid + "\" ckMinioId=\"" + ckMinioId + "\" style='position: relative;width:100%;height:100%;text-align:center;font-size: " + fontsize + ";color: " + fontcolor + ";font-weight: " + fontweight + ";background: " + backgroundT + ";background-size:100% 100%;" + style + ";' ondblclick=\"openLine('" + showData[Number(bkS[1])].mpid + "');\" >" +
"<div style='position: absolute;top:0px;width:100%;height:" + (100 - autoheight) + "%;'></div>" +
"<div style='position: absolute;bottom:0px;width:100%;height:" + autoheight + "%;opacity:" + opacity + ";line-height:" + Number(divheight.replace("px", "")) * (Number(autoheight) / 100) + "px;background: " + autoBkBackground + ";background-size:100% 100%;'>" + textShow + "</div>" +
"</div>";
} else {
divHtml += "<div id=\"" + ckid + "\" ckMinioId=\"" + ckMinioId + "\" style='float:left;width:100%;height:100%;text-align:center;line-height:" + divheight + ";font-size: " + fontsize + ";color: " + fontcolor + ";font-weight: " + fontweight + ";opacity:" + opacity + ";background: " + backgroundT + ";background-size:100% 100%;" + style + ";' ondblclick=\"openLine('" + showData[Number(bkS[1])].mpid + "');\" >" + textShow + "</div>";
}
}
// }
}
// }
// });
divHtml += "</div>";
return divHtml;
}
function getMpValueForShow(parmvalue, jsvalue, jsmethod, forbackground, index) {
let showBackground = "-";
if (jsmethod == '0') {
if (Number(parmvalue) > Number(jsvalue)) {
if (forbackground.indexOf("/") >= 0) {
var path = getRootPath() + forbackground;
showBackground = 'url(' + path + ') no-repeat';
} else {
showBackground = forbackground;
}
return showBackground + "," + index;
}
} else if (jsmethod == '1') {
if (Number(parmvalue) >= Number(jsvalue)) {
if (forbackground.indexOf("/") >= 0) {
var path = getRootPath() + forbackground;
showBackground = 'url(' + path + ') no-repeat';
} else {
showBackground = forbackground;
}
return showBackground + "," + index;
}
} else if (jsmethod == '2') {
if (Number(parmvalue) == Number(jsvalue)) {
if (forbackground.indexOf("/") >= 0) {
var path = getRootPath() + forbackground;
showBackground = 'url(' + path + ') no-repeat';
} else {
showBackground = forbackground;
}
return showBackground + "," + index;
}
} else if (jsmethod == '3') {
if (Number(parmvalue) < Number(jsvalue)) {
if (forbackground.indexOf("/") >= 0) {
var path = getRootPath() + forbackground;
showBackground = 'url(' + path + ') no-repeat';
} else {
showBackground = forbackground;
}
return showBackground + "," + index;
}
} else if (jsmethod == '4') {
if (Number(parmvalue) <= Number(jsvalue)) {
if (forbackground.indexOf("/") >= 0) {
var path = getRootPath() + forbackground;
showBackground = 'url(' + path + ') no-repeat';
} else {
showBackground = forbackground;
}
return showBackground + "," + index;
}
}
return showBackground;
}
function getMinioFile(masterId, tbName, bucketName) {
let path = "-";
$.ajax({
type: 'GET',
url: ext.contextPath + "/base/getInputFileList_minio.do",
async: false,
globle: false,
data: {
masterId: masterId,
tbName: tbName,
bucketName: bucketName
},
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
if (data.length > 0) {
path = 'data:image/png;base64,' + data[0].streamFile;
}
}
});
return path;
}
/**
* 进度条组件
*/
function showAssembly_ProgressBarChart(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualProgressBarChart/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editProgressBarChart('" + content.id + "');\">";
divHtml += "<svg t='1635173307290' class='icon' viewBox='0 0 1024 1024' p-id='7676' width='16' height='16'>";
divHtml += "<path d='M199.111111 398.222222m28.444445 0l341.333333 0q28.444444 0 28.444444 28.444445l0 170.666666q0 28.444444-28.444444 28.444445l-341.333333 0q-28.444444 0-28.444445-28.444445l0-170.666666q0-28.444444 28.444445-28.444445Z' p-id='7677'></path><path d='M824.888889 312.888889H199.111111a85.333333 85.333333 0 0 0-85.333333 85.333333v227.555556a85.333333 85.333333 0 0 0 85.333333 85.333333h625.777778a85.333333 85.333333 0 0 0 85.333333-85.333333v-227.555556a85.333333 85.333333 0 0 0-85.333333-85.333333z m28.444444 298.666667a42.666667 42.666667 0 0 1-42.666666 42.666666h-597.333334A42.666667 42.666667 0 0 1 170.666667 611.555556v-199.111112A42.666667 42.666667 0 0 1 213.333333 369.777778h597.333334a42.666667 42.666667 0 0 1 42.666666 42.666666z' p-id='7678'></path>";
divHtml += "</svg>";
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_ProgressBarChart_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualProgressBarChart/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showProgressBarChart(contentId, showData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualProgressBarChart/getJson.do?pid=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
// console.log(data)
var dataVisualGaugeChart = showData;
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let showValue = "0";
let mpid = "";
if (dataVisualGaugeChart.mpid != null && dataVisualGaugeChart.mpid != "") {
mpid = dataVisualGaugeChart.mpid;
}
if (mpid != "") {
showValue = dataVisualGaugeChart.text;
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEXAndDV.do",
// async: false,
// globle: false,
// data: {
// mpid: mpid,
// valuemethod: dataVisualGaugeChart.valuemethod,
// sdt: sdt,
// edt: edt
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// showValue = mp.parmvalue;
// }
// });
} else {
if (dataVisualGaugeChart.text != null && dataVisualGaugeChart.text != "") {
showValue = dataVisualGaugeChart.text;
}
}
showValue = Number(showValue);
let showbktextValue = "100";
let bkmptext = "";
if (dataVisualGaugeChart.bkmptext != null && dataVisualGaugeChart.bkmptext != "") {
bkmptext = dataVisualGaugeChart.bkmptext;
}
if (bkmptext != "") {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
async: false,
globle: false,
data: {
mpid: bkmptext
},
dataType: 'json',
error: function () {
return false;
},
success: function (result) {
let mp = result[0];
showbktextValue = mp.parmvalue;
}
});
} else {
if (dataVisualGaugeChart.bktext != null && dataVisualGaugeChart.bktext != "") {
showbktextValue = dataVisualGaugeChart.bktext;
}
}
showbktextValue = Number(showbktextValue);
let textPosition = "false";
if (dataVisualGaugeChart.textPosition != null && dataVisualGaugeChart.textPosition != '') {
textPosition = dataVisualGaugeChart.textPosition;
}
let labelShow = "false";
if (textPosition != 'false') {
labelShow = 'true';
}
labelShow = eval(labelShow.toLowerCase());
let textColor = "#fff";
if (dataVisualGaugeChart.textColor != null && dataVisualGaugeChart.textColor != '') {
textColor = dataVisualGaugeChart.textColor;
}
let textFontsize = "16";
if (dataVisualGaugeChart.textFontsize != null && dataVisualGaugeChart.textFontsize != '') {
textFontsize = dataVisualGaugeChart.textFontsize;
}
let textFontweight = "normal";
if (dataVisualGaugeChart.textFontweight != null && dataVisualGaugeChart.textFontweight != '') {
textFontweight = dataVisualGaugeChart.textFontweight;
}
let datacolor = "#69F6F9";
if (dataVisualGaugeChart.datacolors != null && dataVisualGaugeChart.datacolors != '') {
datacolor = dataVisualGaugeChart.datacolors;
}
let datacolors = datacolor.split(",");
let colorsData = [];
if (datacolors != '' && datacolors.length > 1) {
let colorsDataD = [];
for (let c = 0; c < datacolors.length; c++) {
colorsDataD.push({
offset: (1 / (datacolors.length - 1)) * c,
color: datacolors[c]
})
}
colorsData = new echarts.graphic.LinearGradient(0, 0, 1, 0, colorsDataD)
} else {
colorsData = datacolor;
}
let databarwidth = "40";
if (dataVisualGaugeChart.databarwidth != null && dataVisualGaugeChart.databarwidth != '') {
databarwidth = dataVisualGaugeChart.databarwidth;
}
let dataradius = "20";
if (dataVisualGaugeChart.dataradius != null && dataVisualGaugeChart.dataradius != '') {
dataradius = dataVisualGaugeChart.dataradius;
}
let bkcolors = "#e0e0e0";
if (dataVisualGaugeChart.bkcolors != null && dataVisualGaugeChart.bkcolors != '') {
bkcolors = dataVisualGaugeChart.bkcolors;
}
let bkbarwidth = "40";
if (dataVisualGaugeChart.bkbarwidth != null && dataVisualGaugeChart.bkbarwidth != '') {
bkbarwidth = dataVisualGaugeChart.bkbarwidth;
}
let bkradius = "20";
if (dataVisualGaugeChart.bkradius != null && dataVisualGaugeChart.bkradius != '') {
bkradius = dataVisualGaugeChart.bkradius;
}
let option = {
grid: {
left: 0, // 与容器左侧的距离
right: 0, // 与容器右侧的距离
top: 0,
bottom: 0
},
xAxis: {
show: false,
type: "value",
max: showbktextValue
// boundaryGap: [0, 0]
},
yAxis: [
{
show: false,
// type: "category",
data: [""],
// axisLine: {show: false},
// axisTick: [
// {
// show: false
// }
// ]
}
],
series: [
{
name: "数据",
type: "bar",
zlevel: 1,
itemStyle: {
normal: {
barBorderRadius: Number(dataradius),
color: colorsData
}
},
label: {
show: labelShow,
position: textPosition,
color: textColor,
fontSize: textFontsize,
fontWeight: textFontweight
},
barWidth: databarwidth,
data: [showValue],
showBackground: true,
backgroundStyle: {
color: bkcolors,
borderRadius: Number(bkradius)
}
}
// ,
// {
// name: "背景",
// type: "bar",
// barWidth: bkbarwidth,
// barGap: "-100%",
// data: [showbktextValue],
// itemStyle: {
// normal: {
// color: bkcolors,
// barBorderRadius: Number(bkradius)
// }
// }
// }
]
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
// }
// });
}
/**
* 线条组件
*/
function showAssembly_Line(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
divHtml = "<div " + onmouseupSt + " style=\"border:1px solid red;position:absolute;top:" + postY + ";left:" + postX + ";background-color: " + content.background + ";width:" + width + ";height:" + height + ";cursor: move;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editLine('" + content.id + "');\">";
divHtml += "</div>";
return divHtml;
}
function showAssembly_Line_View(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
//需要绑定开关组件加
let hiddenSt = "display:block;";
if (switchHiddenPoints.indexOf(content.id) != -1) {
hiddenSt = "display:none;";
}
style += hiddenSt;
divHtml = "<div style=\"position:absolute;top:" + postY + ";left:" + postX + ";background-color: " + content.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editPictureChart('" + content.id + "');\">";
divHtml += "</div>";
return divHtml;
}
/**
* 开关组件
*/
function showAssembly_Switch(content) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
divHtml = "<div " + onmouseupSt + " style=\"border:2px solid red;position:absolute;top:" + postY + ";left:" + postX + ";background-color: " + content.background + ";width:" + width + ";height:" + height + ";cursor: move;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editSwitch('" + content.id + "');\">";
divHtml += "<i class=\"fa fa-toggle-on\"></i>";
divHtml += "</div>";
return divHtml;
}
function showAssembly_Switch_View(content, showData) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
let opacityst = "1";
if (content.opacityst != null && content.opacityst != '') {
opacityst = content.opacityst;
}
style += "top:" + postY + ";left:" + postX + ";opacity:" + opacityst + ";";
let switchId = "switch_" + showData.id;
//获取绑定点
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSwitchPoint/getPoints.do?pid=" + switchId.replace("switch_", ""),
async: false,
globle: false,
error: function () {
return false;
},
success: function (datas) {
if (showData.openst == 'false') {
switchHiddenPoints += datas;
}
switchAllPoints["AA"+showData.id] = datas;
}
});
divHtml += "<div style=\"position:absolute;width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
return divHtml;
}
/**
* 悬浮框组件
*/
function showAssembly_SuspensionFrame(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSuspensionFrame/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (datas) {
let data = eval('(' + datas + ')');
data = data[0];
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
var textcontent = "";
if (data.textcontent != null && data.textcontent != "") {
textcontent = data.textcontent;
}
divHtml += "<div " + onmouseupSt + " style=\"border:2px solid red;position:absolute;font-size:" + data.fontsize + "px;font-weight:" + data.fontweight + ";color:" + data.fontcolor + ";text-align:" + data.textalign + ";background-color: " + data.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editSuspensionFrame('" + content.id + "');\">";
divHtml += textcontent;
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_SuspensionFrame_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualSuspensionFrame/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (datas) {
// let data = eval('(' + datas + ')');
// data = data[0];
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "top:" + postY + ";left:" + postX + ";";
var textcontent = "";
if (showData.textcontent != null && showData.textcontent != "") {
textcontent = showData.textcontent;
}
divHtml += "<div style=\"position:absolute;font-size:" + showData.fontsize + "px;font-weight:" + showData.fontweight + ";color:" + showData.fontcolor + ";text-align:" + showData.textalign + ";background-color: " + showData.background + ";width:" + width + ";height:" + height + ";cursor: pointer;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"showVoice('" + showData.id + "');\">";
divHtml += textcontent;
divHtml += "</div>";
// }
// });
return divHtml;
}
function showVoice(id) {
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSuspensionFrame/getById.do?id=" + id,
async: true,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
let to_speak = window.speechSynthesis;
to_speak = new SpeechSynthesisUtterance(data[0].textcontent);
window.speechSynthesis.speak(to_speak);
}
});
}
/**
* 极坐标组件
*/
function showAssembly_PolarCoordinates(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualPolarCoordinates/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;background-color: " + datas[0].background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editPolarCoordinates('" + content.id + "');\">";
divHtml += "<svg t='1636883916821' class='icon' viewBox='0 0 1024 1024' width='16' height='16'>";
divHtml += " <path d='M512 672a161.92 161.92 0 0 1-69.44-15.68 32 32 0 0 1-14.72-42.88 32 32 0 0 1 42.56-14.72A96 96 0 0 0 512 608a96 96 0 0 0 0-192 32 32 0 0 1 0-64 160 160 0 0 1 0 320z' fill='#2c2c2c' p-id='6630'></path>";
divHtml += " <path d='M512 832a314.24 314.24 0 0 1-142.72-32c-8.32-4.16-16-8.32-24-13.12a32 32 0 0 1 32-54.72c6.4 3.84 12.8 7.36 19.52 10.56A250.56 250.56 0 0 0 512 768a256 256 0 0 0 0-512 32 32 0 0 1 0-64 320 320 0 0 1 0 640z' fill='#2c2c2c' p-id='6631'></path>";
divHtml += " <path d='M512 992a480 480 0 0 1-268.16-81.92 32 32 0 1 1 35.84-53.12A416 416 0 1 0 512 96a32 32 0 0 1 0-64 480 480 0 0 1 0 960z' fill='#2c2c2c' p-id='6632'></path>";
divHtml += " <path d='M512 672a160 160 0 0 1-160-160 32 32 0 0 1 64 0 96 96 0 0 0 96 96 32 32 0 0 1 0 64z' fill='#2c2c2c' p-id='6633'></path>";
divHtml += " <path d='M512 832A320 320 0 0 1 192 512a32 32 0 0 1 64 0 256 256 0 0 0 256 256 32 32 0 0 1 0 64z' fill='#2c2c2c' p-id='6634'></path>";
divHtml += " <path d='M512 992A480 480 0 0 1 32 512a32 32 0 0 1 64 0 416 416 0 0 0 416 416 32 32 0 0 1 0 64z' fill='#2c2c2c' p-id='6635'></path>";
divHtml += " </svg>";
divHtml += "</div>";
// divHtml+="<div style=\"position:absolute;top:"+(Number(content.posty)+Number(content.height))+"px;left:"+(Number(content.postx)+(Number(content.width)/2-20))+"px;width: 0;height: 0;border-width: 20px;border-style: solid;border-color:#FFFFFF transparent transparent transparent;\">";
}
});
return divHtml;
}
function showAssembly_PolarCoordinates_View(content, showData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPolarCoordinates/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (data) {
// let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
}
divHtml = "<div style=\"background-color: " + showData.background + ";width:" + width + ";height:" + height + ";overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "</div>";
// }
// });
return divHtml;
}
function showPolarCoordinates(contentId, showData, showSeriesData) {
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualPolarCoordinates/getChartJson.do?contentId=" + contentId,
// async: true,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
// console.log(data)
var dataVisualGaugeChart = showData;
var dataVisualPolarCoordinatesSeries = showSeriesData;
document.getElementById(contentId).removeAttribute("_echarts_instance_");
var myChart = echarts.init(document.getElementById(contentId));
myChart.showLoading({
text: '数据正在加载...',
textStyle: {fontSize: 30, color: '#444'},
effectOption: {backgroundColor: 'rgba(0, 0, 0, 0)'},
zlevel: 0
});
let colors = dataVisualGaugeChart.colors.split(',');
let radius = '80%';
if (dataVisualGaugeChart.radius != null && dataVisualGaugeChart.radius != '') {
radius = dataVisualGaugeChart.radius;
}
let barWidth = '20';
if (dataVisualGaugeChart.barwidth != null && dataVisualGaugeChart.barwidth != '') {
barWidth = dataVisualGaugeChart.barwidth;
}
let roundCap = 'true';
if (dataVisualGaugeChart.roundcapst != null && dataVisualGaugeChart.roundcapst != '') {
roundCap = dataVisualGaugeChart.roundcapst;
}
let showBackground = 'true';
if (dataVisualGaugeChart.backgroundst != null && dataVisualGaugeChart.backgroundst != '') {
showBackground = dataVisualGaugeChart.backgroundst;
}
let backgroundcolor = '#27333F';
if (dataVisualGaugeChart.backgroundcolor != null && dataVisualGaugeChart.backgroundcolor != '') {
backgroundcolor = dataVisualGaugeChart.backgroundcolor;
}
let max = 100;
if (dataVisualGaugeChart.max != null && dataVisualGaugeChart.max != '') {
max = dataVisualGaugeChart.max;
}
let legendShow = eval("true".toLowerCase());
let legendPosition = "center";
let legendSt = dataVisualGaugeChart.legendPosition;
if (legendSt == 'false') {
legendShow = eval("false".toLowerCase());
} else {
legendPosition = legendSt;
legendShow = eval("true".toLowerCase());
}
let legendFontsize = '16px';
if (dataVisualGaugeChart.legendFontsize != null && dataVisualGaugeChart.legendFontsize != '') {
legendFontsize = dataVisualGaugeChart.legendFontsize;
}
let legendData = [];
let series = [];
for (let s = 0; s < dataVisualPolarCoordinatesSeries.length; s++) {
let seriesData = dataVisualPolarCoordinatesSeries[s];
legendData.push(seriesData.name);
let showValue = 0;
if (seriesData.mpid != null && seriesData.mpid != '') {
showValue = seriesData.fixedvalue;
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/work/mpoint/getMpointJsonForEX.do",
// async: false,
// globle: false,
// data: {
// mpid: seriesData.mpid
// },
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (result) {
// let mp = result[0];
// showValue = mp.parmvalue;
// }
// });
} else {
if (seriesData.fixedvalue != null && seriesData.fixedvalue != '') {
showValue = seriesData.fixedvalue;
}
}
let cdata = [];
for (let i = 0; i < (s + 1); i++) {
// console.log(s);
if (i == s) {
cdata.push(Number(showValue));
} else {
cdata[i] = 0;
}
}
if (s == 0) {
series.push({
type: "bar",
barWidth: barWidth,
data: cdata,
coordinateSystem: "polar",
name: seriesData.name,
stack: "a",
roundCap: eval(roundCap.toLowerCase()),
showBackground: eval(showBackground.toLowerCase()),
backgroundStyle: {
color: backgroundcolor
}
})
} else {
series.push({
type: "bar",
data: cdata,
coordinateSystem: "polar",
name: seriesData.name,
stack: "a",
roundCap: eval(roundCap.toLowerCase()),
showBackground: eval(showBackground.toLowerCase()),
backgroundStyle: {
color: backgroundcolor
}
})
}
}
let option = {
color: colors,
angleAxis: {
max: max,
type: "value",
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
show: false
},
axisLabel: {
show: false
}
},
radiusAxis: {
type: "category",
data: legendData,
z: 100,
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
}
},
polar: {
center: ["50%", "50%"],
radius: radius
},
tooltip: {
show: true
},
series: series,
legend: {
show: legendShow,
left: legendPosition,
data: legendData,
textStyle: {
fontSize: legendFontsize
}
}
};
myChart.setOption(option, true);
myChart.hideLoading();
window.addEventListener('resize', function () {//执行
myChart.resize();
})
// }
// });
}
/**
* 日期控件
*/
function showAssembly_Weather(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualWeather/getJson.do?pid=" + content.id,
async: false,
globle: false,
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
data = data[0];
// console.log(data)
let style = "";
let zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "class=\"moveDiv reSize\" onmousedown=\"doDown();\" onmouseup=\"doUp();\" onmousemove=\"doMove();\"";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";";
if (data.background != null && data.background != '') {
style += "background:" + data.background + ";";
}
if (data.fontcolor != null && data.fontcolor != '') {
style += "color:" + data.fontcolor + ";";
} else {
style += "color:#000000;";
}
let fontsize = "font-size:14px;";
if (data.fontsize != null && data.fontsize != '') {
fontsize = data.fontsize.replace("px", "");
style += "font-size:" + fontsize + "px;";
} else {
style += fontsize;
}
if (data.fontweight != null && data.fontweight != '') {
style += "font-weight:" + data.fontweight + ";";
} else {
style += "font-weight:400;";
}
if (data.textAlign != null && data.textAlign != '') {
style += "text-align:" + data.textAlign + ";";
} else {
style += "text-align:center;";
}
let type = "weather";
if (data.type != null && data.type != '') {
type = data.type;
}
// let showContent = "";
if (content.style != null && content.style != '') {
style += content.style;
}
divHtml += "<div " + onmouseupSt + " onmousemove=\"doMove();\" style=\"border:2px solid red;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editWeather('" + content.id + "');\">";
divHtml += "<svg t='1652160662685' class='icon' viewBox='0 0 1024 1024' p-id='2000' width='16' height='16'>";
divHtml += "<path d='M512 223.361137c16.954137 0 30.699186-13.745049 30.699186-30.699186L542.699186 94.429673c0-16.954137-13.745049-30.699186-30.699186-30.699186s-30.699186 13.745049-30.699186 30.699186l0 98.232279C481.300814 209.617112 495.04484 223.361137 512 223.361137z' p-id='2001'></path>";
divHtml += " <path d='M264.485767 307.901579c5.994528 5.995551 13.850449 8.991792 21.707394 8.991792 7.855922 0 15.71389-2.998287 21.707394-8.991792 11.989055-11.989055 11.989055-31.426757 0-43.414789l-69.459978-69.461001c-11.988032-11.989055-31.426757-11.989055-43.414789 0-11.989055 11.989055-11.989055 31.426757 0 43.414789L264.485767 307.901579z' p-id='2002'></path>";
divHtml += "<path d='M94.429673 542.698163l98.232279 0c16.954137 0 30.699186-13.744026 30.699186-30.699186s-13.745049-30.699186-30.699186-30.699186l-98.232279 0c-16.954137 0-30.699186 13.745049-30.699186 30.699186S77.475536 542.698163 94.429673 542.698163z' p-id='2003'></path>";
divHtml += "<path d='M800.63784 512c0 16.954137 13.745049 30.699186 30.699186 30.699186l98.232279 0c16.954137 0 30.699186-13.744026 30.699186-30.699186s-13.745049-30.699186-30.699186-30.699186l-98.232279 0C814.382888 481.300814 800.63784 495.04484 800.63784 512z' p-id='2004'></path>";
divHtml += "<path d='M737.805816 316.89337c7.856945 0 15.712867-2.997264 21.707394-8.991792l69.461001-69.461001c11.989055-11.989055 11.989055-31.426757 0-43.415812-11.988032-11.989055-31.426757-11.989055-43.414789 0l-69.461001 69.461001c-11.989055 11.989055-11.989055 31.426757 0 43.415812C722.091926 313.896106 729.948871 316.89337 737.805816 316.89337z' p-id='2005'></path>";
divHtml += "<path d='M824.811402 636.81368c-4.625344-50.765197-24.583908-98.751095-57.501622-137.949862-3.197832-63.572898-29.557176-122.878608-74.978668-168.08009-48.234561-47.999201-112.277156-74.43427-180.329065-74.43427-68.288293 0-132.488477 26.592658-180.774203 74.878384-48.285726 48.28675-74.878384 112.486934-74.878384 180.774203 0 6.978948 0.300852 13.957897 0.865717 20.906146-17.141402 6.476505-32.683377 16.902972-45.360094 30.66951-19.584034 21.267373-30.651091 48.705282-31.338752 77.54512-28.018124 9.185196-53.315276 25.775037-73.081459 48.26219-26.650987 30.318516-41.328267 69.264527-41.328267 109.664655 0 91.629907 74.610278 166.175717 166.317956 166.175717l559.799656 0c43.736107 0 85.134982-17.198707 116.570949-48.425919 31.658024-31.448246 49.093115-73.135694 49.093115-117.380384 0-43.585681-16.817014-84.754313-47.351448-115.923196C886.962927 659.431817 857.222579 643.363863 824.811402 636.81368zM512.00307 317.748854c51.708686 0 100.369965 20.085454 137.019677 56.55711 18.577101 18.48705 32.961716 40.08188 42.660612 63.612807-4.607948-2.412956-9.302877-4.689812-14.08274-6.828522-32.242332-14.422478-66.62849-21.735024-102.204753-21.735024-92.582605 0-176.346357 50.889017-219.72226 130.127709-11.594059-6.268774-24.205285-10.57587-37.370119-12.701277-0.370437-4.910846-0.555655-9.843182-0.555655-14.777565C317.748854 404.89054 404.89054 317.748854 512.00307 317.748854zM865.523639 873.241414c-19.854187 19.723204-45.887097 30.586622-73.299423 30.586622l-559.799656 0c-57.852616 0-104.919585-47.003524-104.919585-104.777345 0-52.106752 38.842657-96.722902 90.349751-103.780645 8.607028-1.179872 16.311501-5.950526 21.202904-13.130042 4.891404-7.18054 6.512321-16.095583 4.459568-24.537859-1.086751-4.470825-1.638313-9.051143-1.638313-13.613042 0-14.431687 5.377474-28.216645 15.140839-38.820144 9.713222-10.54824 22.880103-17.042141 37.07643-18.285458 0.022513-0.002047 0.045025-0.00614 0.068562-0.008186 0.016373-0.001023 0.031722-0.002047 0.048095-0.00307 1.598404-0.146333 3.281743-0.220011 5.002944-0.220011 17.323551 0 33.540907 7.711636 44.493354 21.158902 5.888104 7.227612 14.665001 11.311627 23.799032 11.311627 1.789763 0 3.593851-0.156566 5.392824-0.477884 10.975982-1.957585 20.027126-9.711176 23.64656-20.25737 26.200732-76.342736 98.074689-127.634936 178.847318-127.634936 26.879184 0 52.831252 5.51255 77.134775 16.383132 23.502273 10.512425 44.313252 25.480324 61.853743 44.48926 0.00307 0.004093 0.007163 0.007163 0.010233 0.010233 32.279171 34.982746 50.057069 80.465636 50.057069 128.070864 0 0.937348 0.021489 1.852184 0.045025 2.761903 0.010233 0.38374 0.027629 0.76441 0.021489 1.152243-0.339738 16.871249 13.000082 30.853705 29.868261 31.308053 27.41642 0.73678 53.090149 11.935843 72.290443 31.534204 19.22383 19.62292 29.811979 45.532009 29.811979 72.955592C896.489908 827.187519 885.492436 853.404624 865.523639 873.241414z' p-id='2006'></path>";
divHtml += " </svg>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_Weather_View(content, showData, showWeatherData) {
var divHtml = "";
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualDate/getJson.do?pid=" + content.id,
// async: false,
// globle: false,
// dataType: 'json',
// error: function () {
// return false;
// },
// success: function (data) {
let data = showData;
// console.log(data)
let style = "";
let zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let width = content.width;
let height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX += "px";
}
if (postY.indexOf("%") < 0) {
postY += "px";
}
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
style += "top:" + postY + ";left:" + postX + ";width:" + width + ";height:" + height + ";line-height:" + height + ";";
if (data.background != null && data.background != '') {
style += "background:" + data.background + ";";
}
if (data.fontcolor != null && data.fontcolor != '') {
style += "color:" + data.fontcolor + ";";
} else {
style += "color:#000000;";
}
if (data.fontsize != null && data.fontsize != '') {
style += "font-size:" + data.fontsize + ";";
} else {
style += "font-size:14px;";
}
if (data.fontweight != null && data.fontweight != '') {
style += "font-weight:" + data.fontweight + ";";
} else {
style += "font-weight:400;";
}
if (data.textAlign != null && data.textAlign != '') {
style += "text-align:" + data.textAlign + ";";
} else {
style += "text-align:center;";
}
let type = "";
if (data.type != null && data.type != '') {
type = data.type;
}
let showContent = "";
if (showWeatherData != null && showWeatherData.length > 0) {
showWeatherData = showWeatherData[0];
if (type == 'weather') {
showContent = showWeatherData.weather;
} else if (type == 'temp') {
showContent = showWeatherData.temp;
} else if (type == 'wind') {
showContent = showWeatherData.wind;
} else if (type == 'windPower') {
showContent = showWeatherData.windPower;
} else if (type == 'humidity') {
showContent = showWeatherData.humidity;
}
}
if (content.style != null && content.style != '') {
style += content.style;
}
divHtml += "<div class=\"moveDiv\" style=\"position:absolute;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += showContent;
divHtml += "</div>";
// }
// });
return divHtml;
}
/**
* 人员定位
*/
function showAssembly_PersonnelPositioning(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualPersonnelPositioning/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
let color = datas[0].color;
var showContent = "";
showContent += "<svg class=\"icon\" viewBox=\"0 0 1024 1024\" p-id=\"4071\" width=\"" + content.width + "\" height=\"" + content.height + "\" ondblclick=\"editPersonnelPositioning('" + content.id + "');\">";
showContent += "<path d=\"M507.712 157.696m-93.696 0a1.464 1.464 0 1 0 187.392 0 1.464 1.464 0 1 0-187.392 0Z\" fill=\"" + color + "\" p-id=\"4072\"></path>";
showContent += "<path d=\"M570.624 292.864 448.704 292.864c-41.152 0-78.144 14.976-104.448 38.912l0 172.928 0 46.784 0 21.952 91.648 0 19.712 283.84L567.68 857.28l19.072-283.84 92.992 0L679.744 563.328 679.744 500.224 679.744 336.32C653.248 309.76 614.272 292.864 570.624 292.864z\" fill=\"" + color + "\" p-id=\"4073\"></path>";
showContent += "<path d=\"M654.272 685.376l0 49.408c103.872 15.36 175.232 47.232 175.232 84.032 0 52.032-142.144 94.08-317.44 94.08s-317.504-42.048-317.504-94.08c0-36.928 71.872-68.864 176.448-84.288l0-49.344c-173.632 18.816-298.688 71.488-298.688 133.632C72.192 896.768 269.184 960 512 960c242.816 0 439.744-63.232 439.744-141.12C951.744 756.864 827.264 704.384 654.272 685.376z\" fill=\"" + color + "\" p-id=\"4074\"></path>";
showContent += "</svg>";
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = Number(postX.replace("px", ""));
postX = postX + "px";
}
if (postY.indexOf("%") < 0) {
postY = Number(postY.replace("px", ""));
postY = postY + "px";
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " class=\"moveDiv\" style=\"width:" + content.width + "px;height:" + content.width + "px;cursor: move;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
divHtml += "<div style=\"float:left;color:" + color + ";width:" + content.width + "px;height:" + content.height + "px;\">" + showContent + "</div>"
divHtml += "<div style=\"float: left;width: 100%;height: 20px;color: " + datas[0].fontcolor + ";font-size: " + (datas[0].fontsize).replace("px", "") + "px;text-align: center;\">人名</div>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_PersonnelPositioning_View(content, showData) {
var divHtml = "";
let color = showData.color;
if (showData.mqTheme != '') {
personnelPositioning_auto_mq_theme.push({
themeName: showData.mqTheme
})
}
var showContent = "";
showContent += "<svg class=\"icon\" viewBox=\"0 0 1024 1024\" p-id=\"4071\" width=\"" + content.width + "\" height=\"" + content.height + "\" >";
showContent += "<path d=\"M507.712 157.696m-93.696 0a1.464 1.464 0 1 0 187.392 0 1.464 1.464 0 1 0-187.392 0Z\" fill=\"" + color + "\" p-id=\"4072\"></path>";
showContent += "<path d=\"M570.624 292.864 448.704 292.864c-41.152 0-78.144 14.976-104.448 38.912l0 172.928 0 46.784 0 21.952 91.648 0 19.712 283.84L567.68 857.28l19.072-283.84 92.992 0L679.744 563.328 679.744 500.224 679.744 336.32C653.248 309.76 614.272 292.864 570.624 292.864z\" fill=\"" + color + "\" p-id=\"4073\"></path>";
showContent += "<path d=\"M654.272 685.376l0 49.408c103.872 15.36 175.232 47.232 175.232 84.032 0 52.032-142.144 94.08-317.44 94.08s-317.504-42.048-317.504-94.08c0-36.928 71.872-68.864 176.448-84.288l0-49.344c-173.632 18.816-298.688 71.488-298.688 133.632C72.192 896.768 269.184 960 512 960c242.816 0 439.744-63.232 439.744-141.12C951.744 756.864 827.264 704.384 654.272 685.376z\" fill=\"" + color + "\" p-id=\"4074\"></path>";
showContent += "</svg>";
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = Number(postX.replace("px", ""));
postX = postX + "px";
}
if (postY.indexOf("%") < 0) {
postY = Number(postY.replace("px", ""));
postY = postY + "px";
}
let shiftingLeft = 0;
let shiftingTop = 0;
if (content.shiftingLeft != null && content.shiftingLeft != '') {
shiftingLeft = content.shiftingLeft
}
if (content.shiftingTop != null && content.shiftingTop != '') {
shiftingTop = content.shiftingTop
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div style=\"width:" + content.width + "px;height:" + (Number(content.height) + 20) + "px;transition:all 0.5s ease-in-out;display: none;" + style + "\" id=\"RYDW_" + showData.mqTheme + "\" pid=\"" + content.pid + "\" " +
"peopleFontcolor='" + showData.fontcolor + "' peopleFontsize='" + showData.fontsize + "' shiftingLeft='" + shiftingLeft + "' shiftingTop='" + shiftingTop + "' >";
divHtml += "<div style=\"float:left;color:" + color + ";width:" + content.width + "px;height:" + content.height + "px;\">" + showContent + "</div>"
divHtml += "</div>";
return divHtml;
}
/**
* svg图形
*/
function showAssembly_Svg(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSvg/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
// console.log(datas)
let dataContent = datas[0];
let type = dataContent.type;
let fill = "none";
if (dataContent.fill != null && dataContent.fill != '') {
fill = dataContent.fill;
}
let stroke = "red";
if (dataContent.stroke != null && dataContent.stroke != '') {
stroke = dataContent.stroke;
}
let strokeWidth = dataContent.strokeWidth;
let points = dataContent.points.split("|");
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = Number(postX.replace("px", "")) - (Number(strokeWidth) / 2);
postX = postX + "px";
}
if (postY.indexOf("%") < 0) {
postY = Number(postY.replace("px", "")) - (Number(strokeWidth) / 2);
postY = postY + "px";
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
// if (postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
// } else {
// onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
// }
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " style=\"width:" + (Number(content.width) + Number(strokeWidth)) + "px;height:" + (Number(content.height) + Number(strokeWidth)) + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editSvg('" + content.id + "');\">";
divHtml += "<svg style='width: 100%;height: 100%;'>";
let pointsContent = "";
for (let i = 0; i < points.length; i++) {
let point = points[i].split(",");
let point_x = Number(point[0]) - Number(postX.replace("px", ""));
let point_y = Number(point[1]) - Number(postY.replace("px", ""));
// let point_x = Number(point[0]);
// let point_y = Number(point[1]);
pointsContent += point_x + "," + point_y + " ";
}
let dasharrayStyle = "";
let dashedlinetype = "false";
if (dataContent.dashedlinetype != null && dataContent.dashedlinetype != '') {
dashedlinetype = dataContent.dashedlinetype;
}
if (dashedlinetype == 'true') {
let dashedline1 = "10";
let dashedline2 = "5";
if (dataContent.dashedline1 != null && dataContent.dashedline1 != '') {
dashedline1 = dataContent.dashedline1;
}
if (dataContent.dashedline2 != null && dataContent.dashedline2 != '') {
dashedline2 = dataContent.dashedline2;
}
dasharrayStyle = "stroke-dasharray=\"" + dashedline1 + " " + dashedline2 + "\"";
}
if (type == 'polyline') {
divHtml += "<polyline points=\"" + pointsContent + "\" " + dasharrayStyle + " style=\"fill:" + fill + ";stroke:" + stroke + ";stroke-width:" + strokeWidth + ";\" />";
} else if (type == 'polygon') {
divHtml += "<polygon points=\"" + pointsContent + "\" " + dasharrayStyle + " style=\"fill:" + fill + ";stroke:" + stroke + ";stroke-width:" + strokeWidth + ";\" />";
}
divHtml += "</svg>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_Svg_View(content, showData) {
var divHtml = "";
// let datas = eval('(' + data + ')');
// // console.log(datas)
// let dataContent = datas[0];
if (showData.mqTheme != '') {
svgAlarm_auto_mq_theme.push({
themeName: showData.mqTheme
})
// personnelPositioning_auto_mq_theme += showData.mqTheme + ",";
}
let type = showData.type;
let fill = "none";
if (showData.fill != null && showData.fill != '') {
fill = showData.fill;
}
let stroke = "transparent";
if (showData.stroke != null && showData.stroke != '') {
stroke = showData.stroke;
}
let strokeWidth = showData.strokeWidth;
let points = showData.points.split("|");
var style = "";
var zIndex = "";
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = Number(postX.replace("px", "")) - (Number(strokeWidth) / 2);
postX = postX + "px";
}
if (postY.indexOf("%") < 0) {
postY = Number(postY.replace("px", "")) - (Number(strokeWidth) / 2);
postY = postY + "px";
}
let onmouseupSt = "";
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
divHtml = "<div " + onmouseupSt + " style=\"width:" + (Number(content.width) + Number(strokeWidth)) + "px;height:" + (Number(content.height) + Number(strokeWidth)) + "px;overflow: hidden;" + style + "\" id=\"" + content.id + "\" name=\"" + content.id + "\">";
divHtml += "<svg style='width: 100%;height: 100%;'>";
let pointsContent = "";
for (let i = 0; i < points.length; i++) {
let point = points[i].split(",");
let point_x = Number(point[0]) - Number(postX.replace("px", ""));
let point_y = Number(point[1]) - Number(postY.replace("px", ""));
// let point_x = Number(point[0]);
// let point_y = Number(point[1]);
pointsContent += point_x + "," + point_y + " ";
}
let dasharrayStyle = "";
let dashedlinetype = "false";
if (showData.dashedlinetype != null && showData.dashedlinetype != '') {
dashedlinetype = showData.dashedlinetype;
}
if (dashedlinetype == 'true') {
let dashedline1 = "10";
let dashedline2 = "5";
if (showData.dashedline1 != null && showData.dashedline1 != '') {
dashedline1 = showData.dashedline1;
}
if (showData.dashedline2 != null && showData.dashedline2 != '') {
dashedline2 = showData.dashedline2;
}
dasharrayStyle = "stroke-dasharray=\"" + dashedline1 + " " + dashedline2 + "\"";
}
if (type == 'polyline') {
divHtml += "<polyline id='" + showData.mqTheme.replace("dataVisualData_svg_", "") + "_id' " + dasharrayStyle + " points=\"" + pointsContent + "\" style=\"fill:" + fill + ";stroke:" + stroke + ";stroke-width:" + strokeWidth + ";\" />";
} else if (type == 'polygon') {
divHtml += "<polygon id='" + showData.mqTheme.replace("dataVisualData_svg_", "") + "_id' " + dasharrayStyle + " points=\"" + pointsContent + "\" style=\"fill:" + fill + ";stroke:" + stroke + ";stroke-width:" + strokeWidth + ";\" />";
}
divHtml += "</svg>";
divHtml += "</div>";
if (showData.mqTheme != null && showData.mqTheme != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualSvgAlarm/getJson.do?pid=" + showData.id,
async: true,
error: function () {
return false;
},
success: function (data) {
var datas = eval('(' + data + ')');
svgAlarmList.push({
id: showData.mqTheme.replace("dataVisualData_svg_", "") + "_id",
mqId: showData.mqTheme.replace("dataVisualData_svg_", ""),
child: datas
})
}
});
}
return divHtml;
}
/**
* 任务点
*/
function showAssembly_TaskPoints(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualTaskPoints/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let point_code = datas[0].task_pointCode;
let point_name = datas[0].task_name;
divHtml = "<div title=\"" + point_name + "\" " + onmouseupSt + " style=\"padding:1px;width:" + content.width + "px;height:" + content.height + "px;border:2px solid red;" + style + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editTaskPoints('" + content.id + "');\">";
let img_path = "";
if (point_code == '1') {
img_path = ext.contextPath + "/IMG/dataVisual/safe_tool_normal.png";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div style='float: left;width: 100%;height: 24px;line-height: 20px;padding-left: 18px;background: #FCE6FF;border: 2px solid #DF0DFF;border-radius: 11px;color:#DF0DFF;font-size: 12px;text-align: center;'></div>";
} else if (point_code == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/fireFighting_tool_normal.png";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
} else {
}
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_TaskPoints_View(content, showData) {
var divHtml = "";
// let datas = showData;
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
// if (content.isfull == 'true') {
// width = width.replace("%", "") + "%";
// height = height.replace("%", "") + "%";
// } else {
// if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
// width += "px";
// }
// if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
// height += "px";
// }
// }
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let point_code = showData.task_pointCode;
let point_name = showData.task_name;
let task_id = showData.taskid;
divHtml = "<div title=\"" + point_name + "\" style=\"padding:1px;width:" + content.width + "px;height:" + content.height + "px;" + style + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
let img_path = "";
if (point_code == '1') {
let outValue = "-";
$.ajax({
type: 'GET',
url: ext.contextPath + "/timeEfficiency/patrolPlan/getNextTime.do",
async: false,
globle: false,
data: {
id: task_id,
type: 1
},
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
if (data.result != null) {
outValue = data.result;
}
}
});
img_path = ext.contextPath + "/IMG/dataVisual/safe_tool_normal.png";
divHtml += "<div id=\"" + task_id + "_IMG\" style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div id=\"" + task_id + "\" style='float: left;width: 100%;height: 24px;line-height: 20px;padding-left: 18px;background: #FCE6FF;border: 2px solid #DF0DFF;border-radius: 11px;color:#DF0DFF;font-size: 12px;text-align: center;'>" + outValue + "</div>";
} else if (point_code == '2') {
img_path = ext.contextPath + "/IMG/dataVisual/fireFighting_tool_normal.png";
divHtml += "<div id=\"" + task_id + "_IMG\" style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
}
divHtml += "</div>";
if (showData.mqTheme != '') {
let addthemeSt = true;
if (taskPointslarm_auto_mq_theme.length > 0) {
for (let i = 0; i < taskPointslarm_auto_mq_theme.length; i++) {
if (taskPointslarm_auto_mq_theme[i] == showData.mqTheme) {
addthemeSt = false;
}
}
if (addthemeSt) {
taskPointslarm_auto_mq_theme.push(showData.mqTheme);
}
} else {
taskPointslarm_auto_mq_theme.push(showData.mqTheme);
}
}
return divHtml;
}
/**
* 设备点
*/
function showAssembly_EqPoints(content) {
var divHtml = "";
$.ajax({
type: 'GET',
url: ext.contextPath + "/process/dataVisualEqPoints/getJson.do?pid=" + content.id,
async: false,
globle: false,
error: function () {
return false;
},
success: function (data) {
let datas = eval('(' + data + ')');
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
let onmouseupSt = "";
let isfixed = content.isfixed;
if (isfixed == 'true') {
} else {
if (width.indexOf("%") >= 0 || height.indexOf("%") >= 0 || postX.indexOf("%") >= 0 || postY.indexOf("%") >= 0) {
} else {
onmouseupSt = "onmouseup=\"doUp2('" + content.id + "');\" ";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let eq_name = datas[0].eqName;
divHtml = "<div title=\"" + eq_name + "\" " + onmouseupSt + " style=\"padding:1px;width:" + content.width + "px;height:" + content.height + "px;border:2px solid red;" + style + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" ondblclick=\"editEqPoints('" + content.id + "');\">";
let img_path = "";
img_path = ext.contextPath + "/IMG/dataVisual/special_eq.png";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div style='float: left;width: 100%;height: 24px;line-height: 20px;padding-left: 18px;background: #FFF4E4;border: 2px solid #FF9E0D;border-radius: 11px;color:#FF9E0D;font-size: 12px;text-align: center;'></div>";
divHtml += "</div>";
}
});
return divHtml;
}
function showAssembly_EqPoints_View(content, showData) {
var divHtml = "";
var style = "";
if (content.style != '') {
style = content.style;
}
if (content.zIndex != null && content.zIndex != '') {
style += "z-index:" + content.zIndex + ";";
}
var width = content.width;
var height = content.height;
let postX = content.postx;
let postY = content.posty;
if (postX.indexOf("%") < 0) {
postX = postX.replace("px", "") + "px";
}
if (postY.indexOf("%") < 0) {
postY = postY.replace("px", "") + "px";
}
if (content.isfull == 'true') {
width = width.replace("%", "") + "%";
height = height.replace("%", "") + "%";
} else {
if (width.indexOf("px") < 0 && width.indexOf("%") < 0) {
width += "px";
}
if (height.indexOf("px") < 0 && height.indexOf("%") < 0) {
height += "px";
}
}
style += "position:absolute;top:" + postY + ";left:" + postX + ";";
let eq_name = showData.eqName;
let eq_id = showData.eqid;
let outValue = "-";
$.ajax({
type: 'GET',
url: ext.contextPath + "/timeEfficiency/patrolPlan/getNextTime.do",
async: false,
globle: false,
data: {
id: eq_id,
type: 0
},
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
if (data.result != null) {
outValue = data.result;
}
}
});
divHtml = "<div title=\"" + eq_name + "\" style=\"padding:1px;width:" + content.width + "px;height:" + content.height + "px;" + style + ";\" id=\"" + content.id + "\" name=\"" + content.id + "\" >";
let img_path = "";
img_path = ext.contextPath + "/IMG/dataVisual/special_eq.png";
divHtml += "<div style='position:absolute;width: 22px;height: 36px;background: url(" + img_path + ");background-size: 100% 100%;'></div>";
divHtml += "<div style='float: left;width: 100%;height: 24px;line-height: 20px;padding-left: 18px;background: #FFF4E4;border: 2px solid #FF9E0D;border-radius: 11px;color:#FF9E0D;font-size: 12px;text-align: center;'>" + outValue + "</div>";
divHtml += "</div>";
return divHtml;
}
var client;
function getMqtt(mqttStatus, mqttHostWeb) {
try {
//初始化mqtt
if (mqttStatus == '0') {
let mqttId = "dataVisual_consumer_" + frameId + "_" + Math.random();
initialMqtt(mqttId, mqttHostWeb);
// setTimeout(function () {
//
// }, 10000);
} else {
console.log('mq已关闭')
}
} catch (err) {
//处理错误
}
}
function initialMqtt(mqttId, mqttHostWeb) {
//动态拿取mq定制化数据
$.ajax({
type: 'POST',
url: ext.contextPath + "/mqtt/addTopic.do",
async: false,
globle: false,
data: {
topic: 'topic_dataVisual_' + nowUnitId + '_' + frameId,
mpointIds: mqttMpcode
},
dataType: 'json',
error: function () {
return false;
},
success: function (data) {
}
});
// console.log(mqttMpcode);
const options = {
clean: true,
// cleanSession : false,
// reconnect : true,
connectTimeout: 10000,
clientId: mqttId,
username: "admin",
password: 'public'
}
const connectUrl = mqttHostWeb;
client = mqtt.connect(connectUrl, options);
//当重新连接启动触发回调
client.on('reconnect', function () {
// console.log('正在重连.....');
});
//连接断开后触发的回调
client.on("close", function () {
console.log('客户端已断开连接.....');
});
//从broker接收到断开连接的数据包后发出。MQTT 5.0特性
client.on("disconnect", function (packet) {
console.log('从broker接收到断开连接的数据包.....' + packet);
});
//客户端脱机下线触发回调
client.on("offline", function () {
console.log('客户端脱机下线.....');
});
//当客户端无法连接或出现错误时触发回调
client.on("error", (error) => {
console.log('客户端出现错误.....' + error);
});
//当客户端发送任何数据包时发出。这包括published()包以及MQTT用于管理订阅和连接的包
client.on("packetsend", (packet) => {
// console.log('客户端已发出数据包:' + packet);
});
//当客户端接收到任何数据包时发出。这包括来自订阅主题的信息包以及MQTT用于管理订阅和连接的信息包
client.on("packetreceive", (packet) => {
// console.log('收到:' + packet);
});
//成功连接后触发的回调
client.on("connect", function (connack) {
// layer.msg('成功连接上mq服务器');
console.log('可视化' + mqttId + '成功连接上mqtt服务器');
//订阅某主题
/**
* client.subscribe(topic/topic array/topic object, [options], [callback])
* topic:一个string类型的topic或者一个topic数组,也可以是一个对象
* options
*/
let auto_mq_theme_in = ['dataVisualData_' + frameId, 'topic_dataVisual_' + nowUnitId + '_' + frameId, nowUnitId + '_' + frameId + "_dataVisual"];
for (let i = 0; i < personnelPositioning_auto_mq_theme.length; i++) {
// dataVisualData_personnel_positioning_xxxx 人员定位
auto_mq_theme_in.push(personnelPositioning_auto_mq_theme[i].themeName);
}
for (let i = 0; i < cameraAlarm_auto_mq_theme.length; i++) {
// dataVisualData_cameraAlarm_xxxx 摄像头报警
auto_mq_theme_in.push(cameraAlarm_auto_mq_theme[i]);
}
for (let i = 0; i < svgAlarm_auto_mq_theme.length; i++) {
// dataVisualData_personnel_positioning_xxxx 区域变色
auto_mq_theme_in.push(svgAlarm_auto_mq_theme[i].themeName);
}
for (let i = 0; i < taskPointslarm_auto_mq_theme.length; i++) {
// dataVisualData_taskPointsAlarm_xxxx 任务点报警
auto_mq_theme_in.push(taskPointslarm_auto_mq_theme[i]);
}
client.subscribe(auto_mq_theme_in, {qos: 2});
//每隔2秒发布一次数据
// setInterval(publish, 2000)
});
function publish() {
//发布数据
/**
* client.publish(topic,message,[options], [callback])
*
* message: Buffer or String
* options:{
* qos:0, //默认0
* retain:false, //默认false
* dup:false, //默认false
* properties:{}
* }
* callback:function (err){}
*/
const message = "h5 message " + Math.random() + new Date();
client.publish("testtopic/123", message, {qos: 2});
}
//当客户端接收到发布消息时触发回调
/**
* topic:收到的数据包的topic
* message:收到的数据包的负载playload
* packet:收到的数据包
*/
client.on('message', (topic, message, packet) => {
// console.log(message.getpay);
// console.log(topic);
if (topic == 'dataVisualData_' + frameId) {
let json = JSON.parse(message.toString());
// console.log(json);
if (json.length > 0) {
for (let i = 0; i < json.length; i++) {
if (json[i].type == 'DI') {
if (document.getElementById(json[i].id)) {
let divHtml = showAssembly_mpdata_DI_View(json[i].content, json[i].showData);
$('#' + json[i].id).remove();
$('#' + json[i].cid + 'contentRelativeDiv').append(divHtml);
}
} else if (json[i].type == 'AI') {
if (document.getElementById(json[i].id)) {
let divHtml = showAssembly_mpdata_AI_View(json[i].content, json[i].showData);
$('#' + json[i].id).remove();
$('#' + json[i].cid + 'contentRelativeDiv').append(divHtml);
// $('#' + json[i].id+"value").text(json[i].value);
}
} else if (json[i].type == 'PercentChart') {
if (document.getElementById(json[i].id)) {
showPercentChart(json[i].id, json[i].showData);
}
} else if (json[i].type == 'MpView') {
if (document.getElementById(json[i].id)) {
let divHtml = showAssembly_MpView_View(json[i].content, json[i].showData, 'true');
$('#' + json[i].content.id).remove();
$('#' + json[i].cid + 'contentRelativeDiv').append(divHtml);
}
} else {
if (document.getElementById(json[i].id)) {
$('#' + json[i].id).text(json[i].value);
}
}
}
}
} else if (topic == nowUnitId + '_01_UP_VUE') {
let json = JSON.parse(message.toString());
// console.log(json);
if (json.length > 0) {
for (let i = 0; i < json.length; i++) {
$('.' + json[i].id).text(json[i].parmvalue);
}
}
} else if (topic == nowUnitId + "_" + frameId + "_dataVisual") {//以后这个推送方式为主
let json = JSON.parse(message.toString());
console.log(json);
if (json.length > 0) {
for (let i = 0; i < json.length; i++) {
if (json[i].type == 'DI' || json[i].type == 'AI' || json[i].type == 'Form') {
$('.' + json[i].mpid).text(json[i].parmvalue);
} else if (json[i].type == 'Text') {
let value = json[i].parmvalue;
let unitst = json[i].unitst;
let numtail = json[i].numtail;
if (numtail != '') {
value = Number(value).toFixed(Number(numtail));
}
value = value + unitst;
$('.' + json[i].mpid).text(value);
} else if (json[i].type == 'MpView') {
if (json[i].st != null && json[i].st == 'true') {
let mpViewData = eval("mpValueDataJson.AA" + json[i].contentId);
let mpViewData_showData = mpViewData.showData;
let showBackground = "";
let lastIndex = Number(eval("mpValueDataJson.AA" + json[i].contentId + ".nowIndex"));
//需要判断是否改变了值
if (eval("mpValueDataJson.AA" + json[i].contentId + ".nowIndex") != '-') {
if (mpViewData_showData[lastIndex].autoBkSt != null && mpViewData_showData[lastIndex].autoBkSt == 'true') {
if (mpViewData_showData.length > 0) {
if (Number(mpViewData_showData[0].mpValue) != Number(eval("json[" + i + "]." + mpViewData_showData[0].mpid))) {
//console.log('in')
mpViewData_showData[0].mpValue = eval("json[" + i + "]." + mpViewData_showData[0].mpid);
let divHtml = showAssembly_MpView_View(mpViewData.contnent, mpViewData_showData, 'true');
$('#' + mpViewData.contnent.id).remove();
$('#' + mpViewData.contnent.pid + 'contentRelativeDiv').append(divHtml);
}
}
} else {
for (let m = 0; m < mpViewData_showData.length; m++) {
let for_mpViewData_showData = mpViewData_showData[m];
if (eval("json[" + i + "]." + for_mpViewData_showData.mpid) != null) {
for_mpViewData_showData.mpValue = eval("json[" + i + "]." + for_mpViewData_showData.mpid);
}
}
let jsvalue = mpViewData_showData[lastIndex].jsvalue;
let jsmethod = mpViewData_showData[lastIndex].jsmethod;
let forbackground = "";
if (mpViewData_showData[lastIndex].background != null && mpViewData_showData[lastIndex].background != '') {
forbackground = mpViewData_showData[lastIndex].background;
} else {
forbackground = "transparent";
}
showBackground = getMpValueForShow(mpViewData_showData[lastIndex].mpValue, jsvalue, jsmethod, forbackground, lastIndex);
if (showBackground == '-') {
let divHtml = showAssembly_MpView_View(mpViewData.contnent, mpViewData_showData, 'true');
$('#' + mpViewData.contnent.id).remove();
$('#' + mpViewData.contnent.pid + 'contentRelativeDiv').append(divHtml);
}
}
}
}
} else if (json[i].type == 'PercentChart') {
let percentChartData = eval("percentChartDataJson.AA" + json[i].contentId);
let percentChartData_showData = percentChartData.showData;
percentChartData_showData.showData = json[i].parmvalue;
showPercentChart(json[i].contentId, percentChartData_showData);
}
}
}
} else if (topic == 'topic_dataVisual_' + nowUnitId + '_' + frameId) {
let json = JSON.parse(message.toString());
// console.log(json);
// console.log(nowFrameDataJson)
if (json.length > 0) {
for (let i = 0; i < json.length; i++) {
if (nowFrameDataJson.length > 0) {
for (let j = 0; j < nowFrameDataJson.length; j++) {
let showData = nowFrameDataJson[j].showData;
let ctype = nowFrameDataJson[j].type;
// console.log(showData);
// console.log(ctype)
if (showData != null) {
if (showData.mPoint != null) {
let nowMPoint = showData.mPoint;
if (nowMPoint.id == json[i].id) {
if (ctype == 'DI') {
let showColor = getDIColor(nowMPoint.ledtype, nowMPoint.ledcolor, json[i].parmvalue);
$('#' + json[i].id).css('color', showColor);
continue;
} else if (ctype == 'AI') {
$('.' + json[i].id).text(json[i].parmvalue);
continue;
} else {
$('.' + json[i].id).text(json[i].parmvalue);
continue;
}
}
} else {
// console.log(ctype)
if (ctype == 'Form') {
// console.log(json[i].parmvalue)
$('.' + json[i].id).text(json[i].parmvalue);
continue;
} else if (ctype == 'Text') {
// console.log(json[i].parmvalue)
$('.' + json[i].id).text(json[i].parmvalue);
continue;
} else if (ctype == 'MpView') {
// console.log(ctype)
// console.log(nowFrameDataJson[j])
if (showData.length > 0) {
for (let k = 0; k < showData.length; k++) {
if (showData[k].mpid == json[i].id) {
showData[k].mpValue = json[i].parmvalue;
}
}
}
// console.log(showData)
let divHtml = showAssembly_MpView_View(nowFrameDataJson[j].content, showData);
$('#' + nowFrameDataJson[j].content.id).remove();
// $('#'+nowFrameDataJson[j].content.id).html(divHtml);
$('#' + nowFrameDataJson[j].cid + 'contentRelativeDiv').append(divHtml);
continue;
}
}
}
}
}
}
}
} else if (topic.indexOf("dataVisualData_personnel_positioning") != -1) {
let json = JSON.parse(message.toString());
// console.log(json);
let name = json.name;
let outType = json.out;
let divContent = $('#RYDW_' + topic);
let width = divContent.css("width").replace("px", "");
let height = divContent.css("height").replace("px", "");
let left = divContent.css("left").replace("px", "");
let top = divContent.css("top").replace("px", "");
let fontsize = divContent.attr("peopleFontsize").replace("px", "");
let fontcolor = divContent.attr("peopleFontcolor");
//偏移量
let shiftingLeft = divContent.attr("shiftingLeft");
let shiftingTop = divContent.attr("shiftingTop");
if (document.getElementById("RYDW_" + json.name) == null) {
let divHtml = "";
divHtml += "<div style=\"width:" + width + "px;height:" + height + "px;transition:all 0.5s ease-in-out;position:absolute;top:0px;left:0px;z-index: 90;\" id=\"RYDW_" + name + "\" >";
divHtml += "</div>";
$("#" + divContent.attr("pid") + "contentRelativeDiv").append(divHtml);
$("#RYDW_" + name).html(divContent.html());
}
if (document.getElementById(json.name) == null) {
$('#RYDW_' + name).append("<div id='" + name + "' style=\"float: left;width: 100%;height: 20px;color: " + fontcolor + ";font-size: " + fontsize + "px;text-align: center;\">" + name + "</div>");
}
$('#RYDW_' + name).css("left", Number(left) + Number(json.left) + Number(shiftingLeft));
$('#RYDW_' + name).css("top", Number(top) + Number(json.top) + Number(shiftingTop));
if (outType == '1') {
$('#RYDW_' + name).remove();
}
} else if (topic.indexOf("dataVisualData_cameraAlarm") != -1) {
let json = JSON.parse(message.toString());
// console.log(cameraAlarmList)
for (let i = 0; i < cameraAlarmList.length; i++) {
let cameraId = cameraAlarmList[i].id;
if (cameraId == json.cameraid) {
let type = json.type;
let outColor = cameraAlarmSt(cameraAlarmList[i].child, type);
$('#' + cameraId).attr("fill", outColor);
}
}
} else if (topic.indexOf("dataVisualData_svg") != -1) {
let json = JSON.parse(message.toString());
// console.log(json)
// console.log(svgAlarmList)
for (let i = 0; i < svgAlarmList.length; i++) {
let mqId = svgAlarmList[i].mqId;
if (mqId == json.id) {
let result = json.result;
let outColor = svgAlarmSt(svgAlarmList[i].child, result).split("|");
let fill = outColor[0];
let stroke = outColor[1];
if (fill != '-') {
$('#' + svgAlarmList[i].id).css("fill", fill);
}
if (stroke != '-') {
$('#' + svgAlarmList[i].id).css("stroke", stroke);
}
}
}
} else if (topic.indexOf("dataVisualData_taskPointsAlarm") != -1) {
let json = JSON.parse(message.toString());
// console.log(json);
if (json.length > 0) {
for (let i = 0; i < json.length; i++) {
let taskPointId = json[i].id;
let status = json[i].status;
let nextDate = json[i].nextDate;
let type = json[i].type; // 1 安全用具;2 消防器具
let imgName = ext.contextPath + "/IMG/dataVisual/";
if (status == '0') {//正常
if (type == '1') {
imgName += "safe_tool_normal.png";
} else if (type == '2') {
imgName += "fireFighting_tool_normal.png";
}
} else if (status == '1') {//异常
if (type == '1') {
imgName += "safe_tool_abnormal.png";
} else if (type == '2') {
imgName += "fireFighting_tool_abnormal.png";
}
}
$('#' + taskPointId + '_IMG').css('background', 'url(' + imgName + ')');
$('#' + taskPointId + '_IMG').css('background-size', '100% 100%');
if (type == '1') {
$('#' + taskPointId).text(nextDate);
if (status == '0') {//正常
// $('#' + taskPointId).css("background", "#FCE6FF");
$('#' + taskPointId).css("border", "2px solid #DF0DFF");
$('#' + taskPointId).css("color", "#DF0DFF");
} else if (status == '1') {//异常
// $('#' + taskPointId).css("background", "#FCE6FF");
$('#' + taskPointId).css("border", "2px solid #FF0D0D");
$('#' + taskPointId).css("color", "#FF0D0D");
}
}
}
}
}
// else if (topic == nowUnitId + '_01_UP_VUE') {
// var json = JSON.parse(message.toString());
// // console.log(json);
// if (json.length > 0) {
// for (let i = 0; i < json.length; i++) {
// if (nowFrameDataJson.length > 0) {
// for (let j = 0; j < nowFrameDataJson.length; j++) {
// let showData = nowFrameDataJson[j].showData;
// if (showData.mPoint != null) {
// let nowMPoint = nowFrameDataJson[j].showData.mPoint;
// if (nowMPoint.id == json[i].id) {
// if (nowMPoint.signaltype == 'AI') {
// $('.' + json[i].id).text(json[i].parmvalue);
// break;
// } else if (nowMPoint.signaltype == 'DI') {
// let showColor = getDIColor(nowMPoint.ledtype, nowMPoint.ledcolor, json[i].parmvalue);
// $('#' + json[i].id).css('color', showColor);
// break;
// }
// }
// }
// }
// }
//
// }
// }
// }
});
//页面离开自动断开连接
$(window).bind("beforeunload", () => {
// console.log("客户端窗口关闭,断开连接");
client.disconnect();
})
}
function showAllContent(data) {
let divHtml = "";
if (data.type == 'AADateSelect') {
divHtml = showAssembly_DateSelect_View(data.content, data.showData);
} else if (data.type == 'DI') {
divHtml = showAssembly_mpdata_DI_View(data.content, data.showData);
} else if (data.type == 'AI') {
divHtml = showAssembly_mpdata_AI_View(data.content, data.showData);
} else if (data.type == 'Text') {
divHtml = showAssembly_Text_View(data.content, data.showData);
} else if (data.type == 'Camera') {
divHtml = showAssembly_Camera_View(data.content, data.showData);
} else if (data.type == 'Form') {
divHtml = showAssembly_Form_View(data.content, data.showData);
} else if (data.type == 'PieChart') {
divHtml = showAssembly_PieChart_View(data.content, data.showData);
} else if (data.type == 'PercentChart') {
divHtml = showAssembly_PercentChart_View(data.content, data.showData);
} else if (data.type == 'RadarChart') {
divHtml = showAssembly_RadarChart_View(data.content, data.showData);
} else if (data.type == 'GaugeChart') {
divHtml = showAssembly_GaugeChart_View(data.content, data.showData);
} else if (data.type == 'Picture') {
divHtml = showAssembly_Picture_View(data.content, data.showData);
} else if (data.type == 'Date') {
divHtml = showAssembly_Date_View(data.content, data.showData);
} else if (data.type == 'Weather') {
divHtml = showAssembly_Weather_View(data.content, data.showData, data.showWeatherData);
} else if (data.type == 'Iframe') {
divHtml = showAssembly_Iframe_View(data.content);
} else if (data.type == 'Line') {
divHtml = showAssembly_Line_View(data.content);
} else if (data.type == 'MpView') {
divHtml = showAssembly_MpView_View(data.content, data.showData);
} else if (data.type == 'ProgressBar') {
divHtml = showAssembly_ProgressBarChart_View(data.content, data.showData);
} else if (data.type == 'SuspensionFrame') {
divHtml = showAssembly_SuspensionFrame_View(data.content, data.showData);
} else if (data.type == 'PolarCoordinates') {
divHtml = showAssembly_PolarCoordinates_View(data.content, data.showData);
} else if (data.type == 'LineChart') {
divHtml = showAssembly_LineChart_View(data.content, data.showData);
} else if (data.type == 'BarChart') {
divHtml = showAssembly_BarChart_View(data.content, data.showData);
} else if (data.type == '11Switch') {
divHtml = showAssembly_Switch_View(data.content, data.showData);
} else if (data.type == 'personnelPositioning') {
divHtml = showAssembly_PersonnelPositioning_View(data.content, data.showData);
} else if (data.type == 'svg') {
divHtml = showAssembly_Svg_View(data.content, data.showData);
} else if (data.type == 'TaskPoints') {
divHtml = showAssembly_TaskPoints_View(data.content, data.showData);
} else if (data.type == 'EqPoints') {
divHtml = showAssembly_EqPoints_View(data.content, data.showData);
} else if (data.type == 'SelectJump') {
divHtml = showAssembly_SelectJump_View(data.content, data.showData);
} else if (data.type == 'Tab') {
divHtml = showAssembly_Tab_View(data.content, data.showData);
$('#' + data.cid + 'contentRelativeDiv').append(divHtml);
if (data.showTabData != null && data.showTabData.length > 0) {
for (let i = 0; i < data.showTabData.length; i++) {
data.showTabData[i].cid = data.cid;
showAllContent(data.showTabData[i]);
clearInterval(roundtimeT);
if (roundtimecontentList != '' && roundtimecontentList.length > 0) {
let roundtimecontentLists = roundtimecontentList.substring(0, roundtimecontentList.length - 1).split(",");
roundtimeT = setInterval(function () {
for (let t = 0; t < roundtimecontentLists.length; t++) {
if (roundtimecontentLists[t] == roundtimecontentLists[nowTNum - 1]) {
$("#" + roundtimecontentLists[t]).css('display', 'block');
} else {
$("#" + roundtimecontentLists[t]).css('display', 'none');
}
}
if (nowTNum < roundtimecontentLists.length) {
nowTNum++;
} else {
nowTNum = 1;
}
}, 5000);
}
}
}
}
if (data.type != 'Tab') {
$('#' + data.cid + 'contentRelativeDiv').append(divHtml);
}
if (data.type == 'DI') {
$("#" + data.content.id).mousedown(function (e) {
//右键为3
if (3 == e.which) {
let eqid = $("#" + data.content.id).attr('eqid');
if (eqid != '') {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/equipment/doview.do', {id: eqid}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
}
} else if (1 == e.which) {
//左键为1
showCurveForMp(data.content.id);
}
})
}
if (data.type == 'PieChart') {
showPieChart(data.content.id, data.showData, data.showSeriesData);
} else if (data.type == 'PercentChart') {
showPercentChart(data.content.id, data.showData);
} else if (data.type == 'RadarChart') {
showRadarChart(data.content.id, data.showData, data.showSeriesData, data.showAxisData);
} else if (data.type == 'GaugeChart') {
showGaugeChart(data.content.id, data.showData);
} else if (data.type == 'ProgressBar') {
showProgressBarChart(data.content.id, data.showData);
} else if (data.type == 'PolarCoordinates') {
showPolarCoordinates(data.content.id, data.showData, data.showSeriesData);
} else if (data.type == 'Date') {
if (data.content.refreshtime != null && data.content.refreshtime != '' && data.content.refreshtime != '0') {
setInterval(function () {
showAssembly_Date_View_Show(data.content.id, data.showData.types);
}, Number(data.content.refreshtime) * 1000);
}
} else if (data.type == 'LineChart') {
showLineChart(data.content.id, data.content.refreshtime, data.showData, data.showSeriesData, data.showYAxisData);
} else if (data.type == 'BarChart') {
showBarChart(data.content.id, data.content.refreshtime, data.showData, data.showSeriesData, data.showYAxisData);
} else if (data.type == 'AADateSelect') {
let dateSelectType = data.showData.type;
showDateSelect(data.content.id, dateSelectType);
} else if (data.type == 'Camera') {
$.ajax({
type: 'GET',
url: ext.contextPath + "/work/camera/getCameraAlarmType.do?cameraid=" + data.showData.cameraid,
async: false,
error: function () {
return false;
},
success: function (stData) {
stData = eval('(' + stData + ')');
if (stData != null && stData.length > 0) {
let type = stData[0].type;
for (let i = 0; i < cameraAlarmList.length; i++) {
let cameraId = cameraAlarmList[i].id;
if (cameraId == stData[0].cameraId) {
let outColor = cameraAlarmSt(cameraAlarmList[i].child, type);
$('#' + cameraId).attr("fill", outColor);
}
}
}
}
});
} else if (data.type == 'SelectJump') {
// $("#"+data.content.id+"select-menu-list").hide();
$("#" + data.content.id).on("click", function (e) {
$("#" + data.content.id + "_select-menu-list").toggle();
});
} else if (data.type == 'Form') {
// console.log(formSqlPointList)
if (formSqlPointList.length > 0) {
for (let fqMi = 0; fqMi < formSqlPointList.length; fqMi++) {
let fqMContent = formSqlPointList[fqMi];
for (let fqi = 0; fqi < fqMContent.length; fqi++) {
let nowSQLcontent = fqMContent[fqi];
$('#' + nowSQLcontent.id).text(nowSQLcontent.value);
$('#' + nowSQLcontent.id).attr('title', nowSQLcontent.value);
}
}
}
formSqlPointList = [];
if (formRowStyleList.length > 0) {
for (let i = 0; i < formRowStyleList.length; i++) {
let formRowStyleMContent = formRowStyleList[i];
// console.log(formRowStyleContent);
for (let j = 0; j < formRowStyleMContent.length; j++) {
let formRowStyleContent = formRowStyleMContent[j];
let tdText = $.trim($('#' + formRowStyleContent.pid).html());
if (formRowStyleContent.ckmethod == '=') {
if (formRowStyleContent.ckcontent == tdText) {
formRowStyleShow(formRowStyleContent, formRowStyleContent.showst);
break;
}
} else {
if (formRowStyleContent.ckmethod == '>') {
if (Number(tdText) > Number(formRowStyleContent.ckcontent)) {
formRowStyleShow(formRowStyleContent, formRowStyleContent.showst);
break;
}
} else if (formRowStyleContent.ckmethod == '>=') {
if (Number(tdText) >= Number(formRowStyleContent.ckcontent)) {
formRowStyleShow(formRowStyleContent, formRowStyleContent.showst);
break;
}
} else if (formRowStyleContent.ckmethod == '<') {
if (Number(tdText) < Number(formRowStyleContent.ckcontent)) {
formRowStyleShow(formRowStyleContent, formRowStyleContent.showst);
break;
}
} else if (formRowStyleContent.ckmethod == '<=') {
if (Number(tdText) <= Number(formRowStyleContent.ckcontent)) {
formRowStyleShow(formRowStyleContent, formRowStyleContent.showst);
break;
}
}
}
}
}
}
formRowStyleList = [];
} else if (data.type == '11Switch') {
let divId = data.content.id;
let switchType = "";
if (data.showData.type != null && data.showData.type != "") {
switchType = data.showData.type;
}
let background = "transparent";
if (data.showData.background != null && data.showData.background != "") {
background = data.showData.background;
}
let openst = "false";
if (data.showData.openst != null && data.showData.openst != "") {
openst = data.showData.openst;
}
if (switchType == 'point') {
let showStyle = "switch";
if (data.showData.showStyle != null && data.showData.showStyle != '') {
showStyle = data.showData.showStyle;
}
if (showStyle == 'switch') {
let switchId = "switch_" + data.showData.id;
let switch_divHtml = "";
switch_divHtml += "<div style='width: 100%;height: 100%;' class='switch' data-on='primary' data-off='info'>";
switch_divHtml += "<input id='" + switchId + "' type='checkbox'/>";
switch_divHtml += "</div>";
$('#' + divId).append(switch_divHtml);
$('#' + switchId).bootstrapSwitch({
onText: '显示',
offText: '隐藏',
size: "small",
onSwitchChange: function (event, state) {
let sid = event.target.id.replace("switch_", "");
let ck_datas = eval("switchAllPoints.AA" + sid);
ck_datas = ck_datas.substring(0, ck_datas.length - 1);
ck_datas = ck_datas.split(",");
if (state) {
for (let i = 0; i < ck_datas.length; i++) {
$('#' + ck_datas[i]).css("display", "block");
}
} else {
for (let i = 0; i < ck_datas.length; i++) {
$('#' + ck_datas[i]).css("display", "none");
}
}
// console.log(event.target.id);
//获取绑定点
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualSwitchPoint/getPoints.do?pid=" + sid,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (datas) {
// datas = datas.substring(0, datas.length - 1);
// datas = datas.split(",");
// if (state) {
// for (let i = 0; i < datas.length; i++) {
// $('#' + datas[i]).css("display", "block");
// }
// } else {
// for (let i = 0; i < datas.length; i++) {
// $('#' + datas[i]).css("display", "none");
// }
// }
// }
// });
}
});
if (openst == 'false') {
$('#' + switchId).bootstrapSwitch('state', false, true);
} else if (openst == 'true') {
$('#' + switchId).bootstrapSwitch('state', true, true);
} else {
$('#' + switchId).bootstrapSwitch('state', false, true);
}
} else if (showStyle == 'check') {
let ckColor = "#FFFFFF";
if (data.showData.ckColor != null && data.showData.ckColor != "") {
ckColor = data.showData.ckColor;
}
let ckSize = "14";
if (data.showData.ckSize != null && data.showData.ckSize != "") {
ckSize = data.showData.ckSize;
}
let ckStyle = "";
if (data.showData.ckStyle != null && data.showData.ckStyle != "") {
ckStyle = data.showData.ckStyle;
}
// //获取绑定点
// $.ajax({
// type: 'GET',
// url: ext.contextPath + "/process/dataVisualSwitchPoint/getPoints.do?pid=" + data.showData.id,
// async: false,
// globle: false,
// error: function () {
// return false;
// },
// success: function (datas) {
// ck_datas = datas.substring(0, datas.length - 1);
// // ck_datas = datas.substring(0, datas.length - 1);
// // ck_datas = ck_datas.split(",");
// }
// });
let showT = "";
if (openst == 'true') {
showT = "✔";
}
let check_divHtml = "";
check_divHtml += "<div id='" + data.showData.id + "' onclick='switch_check_click(\"" + divId + "\",\"" + data.showData.id + "\");' openst=\"" + openst + "\" style='width: 100%;height: 100%;padding:2px;background: " + background + ";cursor: pointer;color: " + ckColor + ";font-size:" + ckSize.replace("px","") + "px;text-align: center;line-height: " + (Number(data.content.height.replace("px", ""))-2) + "px;"+ckStyle+"' >" +
"" + showT + "";
check_divHtml += "</div>";
$('#' + divId).append(check_divHtml);
}
} else if (switchType == 'url') {
$('#' + divId).css('cursor', 'pointer');
$("#" + divId).on("click", function () {
let switchUrl = switchType = data.showData.url;
if (switchUrl.substring(0, 1) != '/') {
switchUrl = "/" + switchUrl;
}
if (data.showData.urlType == '0') {
let submodalName = switchType = data.showData.submodalName;
$.post(ext.contextPath + switchUrl, {}, function (data) {
$("#subDiv").html(data);
openModal(submodalName);
});
} else if (data.showData.urlType == '1') {
let urlWidth = switchType = data.showData.urlWidth;
let urlHeight = switchType = data.showData.urlHeight;
$.post(ext.contextPath + "/process/dataVisualSwitch/urlOpen.do", {
switchUrl: switchUrl,
urlWidth: urlWidth.replace("px", ""),
urlHeight: urlHeight.replace("px", "")
}, function (data) {
$("#subDiv").html(data);
openModal('urlOpenSubModal');
});
}
})
}
} else if (data.type == 'MpView') {
$('#' + data.content.id + ' div').each(function () {
let ckMinioId = $(this).attr("ckMinioId");
// console.log(ckMinioId);
if (ckMinioId != null && ckMinioId != '') {
$.ajax({
type: 'GET',
url: ext.contextPath + "/base/getInputFileList_minio.do",
async: true,
globle: true,
data: {
masterId: ckMinioId,
tbName: 'tb_pro_dataVisual_mpView_file',
bucketName: 'datavisual'
},
dataType: 'json',
error: function () {
return false;
},
success: function (data_minio) {
if (data_minio.length > 0) {
let mpView_minio = 'data:image/png;base64,' + data_minio[0].streamFile;
// console.log(mpView_minio);
$('#' + ckMinioId).css('background', "url(" + mpView_minio + ")");
$('#' + ckMinioId).css('background-size', "100% 100%");
}
}
});
// let mpView_minio = getMinioFile(ckMinioId, 'tb_pro_dataVisual_mpView_file', 'datavisual');
// console.log(mpView_minio);
// $('#' + ckMinioId).css('background', "url(" + mpView_minio + ")");
}
})
}
}
function formRowStyleShow(formRowStyleContent, st) {
// console.log(formRowStyleContent)
if (formRowStyleContent.background != '') {
if (st == '0') {
$('#' + formRowStyleContent.pid).css('background', formRowStyleContent.background);
} else {
$('#' + formRowStyleContent.pid).parent().css('background', formRowStyleContent.background);
$('#' + formRowStyleContent.pid).parent().children().css('background', formRowStyleContent.background);
}
}
if (formRowStyleContent.fontcolor != '') {
if (st == '0') {
$('#' + formRowStyleContent.pid).css('color', formRowStyleContent.fontcolor);
} else {
$('#' + formRowStyleContent.pid).parent().css('color', formRowStyleContent.fontcolor);
$('#' + formRowStyleContent.pid).parent().children().css('color', formRowStyleContent.fontcolor);
}
}
if (formRowStyleContent.fontsize != '') {
if (st == '0') {
$('#' + formRowStyleContent.pid).css('font-size', formRowStyleContent.fontsize);
} else {
$('#' + formRowStyleContent.pid).parent().css('font-size', formRowStyleContent.fontsize);
$('#' + formRowStyleContent.pid).parent().children().css('font-size', formRowStyleContent.fontsize);
}
}
if (formRowStyleContent.fontweight != '') {
if (st == '0') {
$('#' + formRowStyleContent.pid).css('font-weight', formRowStyleContent.fontweight);
} else {
$('#' + formRowStyleContent.pid).parent().css('font-weight', formRowStyleContent.fontweight);
$('#' + formRowStyleContent.pid).parent().children().css('font-weight', formRowStyleContent.fontweight);
}
}
}
function cameraAlarmSt(cameraAlarmList, value) {
let outColor = "";
for (let i = 0; i < cameraAlarmList.length; i++) {
let jsmethod = cameraAlarmList[i].jsmethod;
let jsvalue = cameraAlarmList[i].jsvalue;
let colorSt = false;
if (jsmethod == '>') {
if (Number(value) > jsvalue) {
colorSt = true;
}
} else if (jsmethod == '>=') {
if (Number(value) >= jsvalue) {
colorSt = true;
}
} else if (jsmethod == '=') {
if (Number(value) == jsvalue) {
colorSt = true;
}
} else if (jsmethod == '<') {
if (Number(value) < jsvalue) {
colorSt = true;
}
} else if (jsmethod == '<=') {
if (Number(value) <= jsvalue) {
colorSt = true;
}
} else if (jsmethod == '!=') {
if (Number(value) != jsvalue) {
colorSt = true;
}
}
if (colorSt) {
outColor = cameraAlarmList[i].color;
}
}
return outColor;
}
function svgAlarmSt(svgAlarmList, value) {
let outColor = "";
for (let i = 0; i < svgAlarmList.length; i++) {
let jsmethod = svgAlarmList[i].jsmethod;
let jsvalue = svgAlarmList[i].jsvalue;
let colorSt = false;
if (jsmethod == '>') {
if (Number(value) > jsvalue) {
colorSt = true;
}
} else if (jsmethod == '>=') {
if (Number(value) >= jsvalue) {
colorSt = true;
}
} else if (jsmethod == '=') {
if (value == jsvalue) {
colorSt = true;
}
} else if (jsmethod == '<') {
if (Number(value) < jsvalue) {
colorSt = true;
}
} else if (jsmethod == '<=') {
if (Number(value) <= jsvalue) {
colorSt = true;
}
} else if (jsmethod == '!=') {
if (Number(value) != jsvalue) {
colorSt = true;
}
}
if (colorSt) {
let fill = "-";
let stroke = "-";
if (svgAlarmList[i].fill != '') {
fill = svgAlarmList[i].fill;
}
if (svgAlarmList[i].stroke != '') {
stroke = svgAlarmList[i].stroke;
}
outColor = fill + "|" + stroke;
}
}
return outColor;
}
function showSvgLine(points) {
$("#lssvg").remove();
let pointss = points.split("|");
let linePoint = "";
for (let i = 0; i < pointss.length; i++) {
linePoint += pointss[i] + " ";
}
let html = "<div id='lssvg' style='width: 100%;height: 100%;'><svg style='width: 100%;height: 100%;'><polyline points=\"" + linePoint + "\" style=\"fill:none;stroke:red;stroke-width:2\" /></svg><div>";
return html;
}
/*
* 浏览器全屏
*/
function fullScreen() {
$("#fullScreenSt1").css("display", "none");
$("#fullScreenSt2").css("display", "block");
var elem = document.body;
if (elem.webkitRequestFullScreen) {
elem.webkitRequestFullScreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.requestFullScreen) {
elem.requestFullscreen();
} else {
//浏览器不支持全屏API或已被禁用
}
}
/*
* 浏览器退出全屏
*/
function exitFullScreen() {
$("#fullScreenSt2").css("display", "none");
$("#fullScreenSt1").css("display", "block");
var de = document;
if (de.exitFullscreen) {
de.exitFullscreen();
} else if (de.msExitFullscreen) {
de.msExitFullscreen();
} else if (de.mozCancelFullScreen) {
de.mozCancelFullScreen();
} else if (de.webkitExitFullscreen) {
de.webkitExitFullscreen();
}
}
function radioSelect(pid, num, nowck, radioCkBackground, id, ckData) {
for (let i = 0; i < num; i++) {
if (i == nowck) {
$('#' + pid + '_' + i + '_in').css('background', radioCkBackground);
} else {
$('#' + pid + '_' + i + '_in').css('background', 'transparent');
}
}
clickTab(id, ckData);
}
function switch_check_click(divId, showDataId) {
// console.log("switchAllPoints", switchAllPoints);
// console.log("switchHiddenPoints", switchHiddenPoints);
let ck_datas = eval("switchAllPoints.AA" + showDataId);
ck_datas = ck_datas.substring(0, ck_datas.length - 1);
ck_datas = ck_datas.split(",");
// console.log("ck_datas",ck_datas);
let obj = $('#' + showDataId);
let st = obj.attr('openst');
if (st == 'true') {
obj.attr('openst', 'false');
obj.text("");
for (let i = 0; i < ck_datas.length; i++) {
$('#' + ck_datas[i]).css("display", "none");
}
} else {
obj.attr('openst', 'true');
obj.text("✔");
for (let i = 0; i < ck_datas.length; i++) {
$('#' + ck_datas[i]).css("display", "block");
}
}
}