753 lines
27 KiB
Plaintext
753 lines
27 KiB
Plaintext
|
|
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
|||
|
|
<%@page import="java.util.Date" %>
|
|||
|
|
<%@page import="java.text.SimpleDateFormat" %>
|
|||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|||
|
|
<%
|
|||
|
|
SessionManager sessionManager = new SessionManager();
|
|||
|
|
%>
|
|||
|
|
<!DOCTYPE HTML>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<title></title>
|
|||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
|
|||
|
|
function getme(id,pid,name,type){
|
|||
|
|
if(type=='m3'){
|
|||
|
|
window.location="scadapicaction.do?method=picdesign&type=0&picid="+id+"&bizid="+pid+"&clientWidth=${clientWidth+20}";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
function getdataV2() {
|
|||
|
|
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
//var cobj= document.getElementById(obj[i].name);
|
|||
|
|
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatepic&type=1&clientWidth=${clientWidth}&picid=${cp.id}")),true);
|
|||
|
|
mpxmlhttp.setrequestheader("content-length", 0);
|
|||
|
|
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
mpxmlhttp.send(true);
|
|||
|
|
mpxmlhttp.onreadystatechange = function(){
|
|||
|
|
phasex();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* updateall();
|
|||
|
|
setInterval("updateall()",30000); */
|
|||
|
|
|
|||
|
|
|
|||
|
|
function getdataV2() {
|
|||
|
|
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
//var cobj= document.getElementById(obj[i].name);
|
|||
|
|
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatepic&type=0&clientWidth=${clientWidth}&picid=${cp.id}")),true);
|
|||
|
|
mpxmlhttp.setrequestheader("content-length", 0);
|
|||
|
|
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
mpxmlhttp.send(true);
|
|||
|
|
mpxmlhttp.onreadystatechange = function(){
|
|||
|
|
phasex();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function phasex(){
|
|||
|
|
if(mpxmlhttp.readyState==4){
|
|||
|
|
if(mpxmlhttp.status==200){
|
|||
|
|
var res = mpxmlhttp.responseText;
|
|||
|
|
//alert(res);
|
|||
|
|
var aa = res.split("|");
|
|||
|
|
//alert(aa);
|
|||
|
|
for(var i=0;i<aa.length;i++){
|
|||
|
|
if(aa[i].Trim().length>0){
|
|||
|
|
var bb = aa[i].split(",");
|
|||
|
|
//alert(bb);
|
|||
|
|
var divo = document.getElementById(bb[0]);
|
|||
|
|
//alert(divo.name);
|
|||
|
|
var mpid=document.getElementsByName(divo.id+divo.name);
|
|||
|
|
for(var j=0;j<mpid.length;j++){
|
|||
|
|
//alert(mpid[j].tagName);
|
|||
|
|
if(mpid[j].tagName=="DIV"){
|
|||
|
|
//alert(j);
|
|||
|
|
mpid[j].innerHTML=bb[1];
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(divo.className=='equdiv'){
|
|||
|
|
//alert(bb[2]);
|
|||
|
|
//var cc = bb[2].split("$");
|
|||
|
|
//alert(cc[2]);
|
|||
|
|
if(bb[3]){
|
|||
|
|
//alert('a');
|
|||
|
|
mpid[0].parentElement.parentElement.nextSibling.firstChild.innerText=bb[3];
|
|||
|
|
divo.firstChild.style.backgroundColor="#FFFF00"
|
|||
|
|
}else{
|
|||
|
|
//alert('b');
|
|||
|
|
//alert(mpid[0].parentElement.tagName);
|
|||
|
|
//alert(mpid);
|
|||
|
|
mpid[0].parentElement.parentElement.nextSibling.firstChild.innerText="";
|
|||
|
|
divo.firstChild.style.backgroundColor="#c5c5c5";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
function searchSelect(o){
|
|||
|
|
window.location="scadapicaction.do?method=picdesign&type=0&picid="+o+"&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function mpcopy(){
|
|||
|
|
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
var se = document.getElementById('frompicid');
|
|||
|
|
var post = " ";
|
|||
|
|
xmlobj.open("POST","scadapicaction.do?method=piccopy&topicid=${cp.id}&frompicid="+se.value,true);
|
|||
|
|
xmlobj.setrequestheader("content-length", post.length);
|
|||
|
|
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
xmlobj.send(post);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//为保存布局
|
|||
|
|
function setdata() {
|
|||
|
|
var obj = document.getElementsByTagName("DIV");
|
|||
|
|
for(var i=0;i<obj.length;i++){
|
|||
|
|
if(obj[i].className=="easyui-draggable"){
|
|||
|
|
console.info(obj[i].parentNode);
|
|||
|
|
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:'1', id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
|||
|
|
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height}, function(data) {
|
|||
|
|
if(data.res!=1){
|
|||
|
|
top.$.messager.alert('提示','更新失败','info');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//为恢复布局
|
|||
|
|
function returndata(){
|
|||
|
|
if(confirm("布局将被恢复到初始状态,请问是否要执行该操作?")){
|
|||
|
|
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
var post = " ";
|
|||
|
|
xmlobj.open("POST","scadapicaction.do?method=returndata&id=${cp.id}",false);
|
|||
|
|
xmlobj.setrequestheader("content-length", post.length);
|
|||
|
|
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
xmlobj.send(post);
|
|||
|
|
var res = xmlobj.responseText;
|
|||
|
|
if(res=="suc"){
|
|||
|
|
window.location="scadapicaction.do?method=picdesign&type=0&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
alert("布局恢复完成!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//为设置本布局为默认图,既进去时首选此图片进入
|
|||
|
|
function setpicdata(){
|
|||
|
|
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
var post = " ";
|
|||
|
|
xmlobj.open("POST","scadapicaction.do?method=setpicdata&picid=${cp.id}&bizid=${bizid}",false);
|
|||
|
|
xmlobj.setrequestheader("content-length", post.length);
|
|||
|
|
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
xmlobj.send(post);
|
|||
|
|
var res = xmlobj.responseText;
|
|||
|
|
if(res=="suc"){
|
|||
|
|
//window.location="scadapicaction.do?method=picdesign&type=0&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
alert("已设置为默认图!");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getdata() {
|
|||
|
|
var obj = document.getElementsByTagName("DIV");
|
|||
|
|
for(var i=0;i<obj.length;i++){
|
|||
|
|
if(obj[i].className=="mpdiv"){
|
|||
|
|
|
|||
|
|
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
var post = " ";
|
|||
|
|
|
|||
|
|
xmlobj.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatevalue&id="+obj[i].name)),false);
|
|||
|
|
xmlobj.setrequestheader("content-length", post.length);
|
|||
|
|
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
xmlobj.send(post);
|
|||
|
|
var res = xmlobj.responseText;
|
|||
|
|
//alert(res);
|
|||
|
|
var cobj= document.getElementById(obj[i].name);
|
|||
|
|
if(cobj){
|
|||
|
|
cobj.innerText=res;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function addmp(){
|
|||
|
|
//openx();
|
|||
|
|
window.location="scadapicaction.do?method=addmp&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
}
|
|||
|
|
function addequ(){
|
|||
|
|
//openx();
|
|||
|
|
window.location="scadapicaction.do?method=addequ&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function addsyb(){
|
|||
|
|
//openx();
|
|||
|
|
window.location="scadapicaction.do?method=addsyb&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
|||
|
|
}
|
|||
|
|
function addtext(){
|
|||
|
|
var width= $("#img").width();
|
|||
|
|
var height= $("#img").height();
|
|||
|
|
var workshopid = $("#workshopid").combobox('getValue');
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
iframeId:'iframeadd',
|
|||
|
|
title : '添加文本',
|
|||
|
|
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '保存',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
|||
|
|
}
|
|||
|
|
} ],
|
|||
|
|
onDestroy:function(){
|
|||
|
|
showTxt();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function closex(){
|
|||
|
|
$('divmid').style.display = "none";
|
|||
|
|
$('divtop').style.display = "none";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function setandclosex(mpd,title,tag,u){
|
|||
|
|
|
|||
|
|
var so= $('sltmp');
|
|||
|
|
if(so.disabled){
|
|||
|
|
closex();
|
|||
|
|
gdobj.name=mpd;
|
|||
|
|
gdobj.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
|||
|
|
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
|||
|
|
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
|||
|
|
}
|
|||
|
|
//alert(divx.innerHTML);
|
|||
|
|
}
|
|||
|
|
function mutclose(){
|
|||
|
|
alert("a");
|
|||
|
|
var so=$('sltmp');
|
|||
|
|
for(var i=0;i<so.length;i++ ){
|
|||
|
|
creatediv(so.options(i).value,so.options(i).innerText,'','');
|
|||
|
|
}
|
|||
|
|
closex();
|
|||
|
|
//alert(divx.innerHTML);
|
|||
|
|
}
|
|||
|
|
function hisview(o){
|
|||
|
|
//window.open("UnitPointAction.do?method=hisview&mpd="+o.name,"_blank");
|
|||
|
|
window.open(encodeURI(encodeURI("UnitPointAction.do?method=hisnewview&mpid="+o+"&dpdn=${biz.defaultprddbname}")),"_blank");
|
|||
|
|
}
|
|||
|
|
function creatediv(mpd,title,tag,u){
|
|||
|
|
var divx = document.createElement("div");
|
|||
|
|
document.body.appendChild(divx);
|
|||
|
|
divx.name=mpd;
|
|||
|
|
divx.ondblclick="hisview(this);";
|
|||
|
|
divx.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
|||
|
|
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
|||
|
|
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
|||
|
|
|
|||
|
|
divx.className="mpdiv";
|
|||
|
|
with (divx.style) {
|
|||
|
|
zIndex=19;
|
|||
|
|
position = "absolute";
|
|||
|
|
top="70px";
|
|||
|
|
left="70px";
|
|||
|
|
display="";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function setslt(mpd,title,tag){
|
|||
|
|
var so=$('sltmp');
|
|||
|
|
var oOption = document.createElement("OPTION");
|
|||
|
|
so.options.add(oOption);
|
|||
|
|
oOption.innerText = title;
|
|||
|
|
oOption.value = mpd;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function openx(flg){
|
|||
|
|
function isIE(){
|
|||
|
|
return (document.all && window.ActiveXObject && !window.opera) ? true : false;
|
|||
|
|
}
|
|||
|
|
var bgcolor="#FFFFFF";
|
|||
|
|
var trans=80;
|
|||
|
|
var body = document.body;
|
|||
|
|
var bodyWidth = parseInt((body.scrollWidth<body.clientWidth)?body.clientWidth:body.scrollWidth);
|
|||
|
|
var bodyHeight = body.clientWidth; parseInt((body.scrollHeight<body.clientHeight)?body.clientHeight:body.scrollHeight);
|
|||
|
|
var clientWidth=body.clientWidth;
|
|||
|
|
var clientHeight=body.clientHeight;
|
|||
|
|
if($('divtop')){
|
|||
|
|
var DivTop = $('divtop');
|
|||
|
|
}else{
|
|||
|
|
var DivTop = document.createElement("div");
|
|||
|
|
DivTop.id = "divtop";
|
|||
|
|
body.appendChild(DivTop);
|
|||
|
|
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
var post = " ";
|
|||
|
|
xml.open("POST", "UnitPointAction.do?method=getmplist&picid=<c:out value='${cp.id}' />&flg="+flg, false);
|
|||
|
|
xml.setrequestheader("content-length", post.length);
|
|||
|
|
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
|||
|
|
xml.send(post);
|
|||
|
|
var res = xml.responseText;
|
|||
|
|
alert(res);
|
|||
|
|
DivTop.innerHTML = res;
|
|||
|
|
}
|
|||
|
|
with(DivTop.style)
|
|||
|
|
{
|
|||
|
|
display = "none";
|
|||
|
|
zIndex = 30;
|
|||
|
|
position = "absolute";
|
|||
|
|
border = "thin";
|
|||
|
|
}
|
|||
|
|
if($('divmid')){
|
|||
|
|
var DivMid = $('divmid');
|
|||
|
|
}else{
|
|||
|
|
var DivMid = document.createElement("div");
|
|||
|
|
DivMid.id = "divmid";
|
|||
|
|
body.appendChild(DivMid);
|
|||
|
|
}
|
|||
|
|
with(DivMid.style){
|
|||
|
|
display = "none";
|
|||
|
|
zIndex = 20;
|
|||
|
|
position = "absolute";
|
|||
|
|
top = "0px";
|
|||
|
|
left = "0px";
|
|||
|
|
border = "0px";
|
|||
|
|
backgroundColor = bgcolor;
|
|||
|
|
}
|
|||
|
|
with(body.style){
|
|||
|
|
width = clientWidth;
|
|||
|
|
height = clientHeight;
|
|||
|
|
overflow = "hidden";
|
|||
|
|
}
|
|||
|
|
with(DivMid.style){
|
|||
|
|
width = "100%";
|
|||
|
|
height = "100%";
|
|||
|
|
overflow = "hidden";
|
|||
|
|
display = "";
|
|||
|
|
if (isIE()){
|
|||
|
|
filter = " Alpha(Opacity="+trans+")";
|
|||
|
|
}else{
|
|||
|
|
opacity = trans/100;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
with(DivTop.style){
|
|||
|
|
display = "";
|
|||
|
|
}
|
|||
|
|
DivTop.style.top="50px";
|
|||
|
|
DivTop.style.left="100px";
|
|||
|
|
var so= $('sltmp')
|
|||
|
|
if(flg=='chg'){
|
|||
|
|
so.disabled=true;
|
|||
|
|
}else{
|
|||
|
|
so.disabled=false;
|
|||
|
|
}
|
|||
|
|
so= $('mutadd')
|
|||
|
|
if(flg=='chg'){
|
|||
|
|
so.disabled=true;
|
|||
|
|
}else{
|
|||
|
|
so.disabled=false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var move = false;
|
|||
|
|
var ox, oy;
|
|||
|
|
|
|||
|
|
function settop(obj) {
|
|||
|
|
var obj = document.getElementsByTagName("DIV");
|
|||
|
|
for(var i=0;i<obj.length;i++){
|
|||
|
|
if((obj[i].className=="mpdiv" || obj[i].parentElement.className=="equdiv" || obj[i].parentElement.className=="sybdiv" || obj[i].parentElement.className=="txtdiv")&&obj[i].style.zIndex>9){
|
|||
|
|
document.all[i].style.zIndex = 9;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
while(obj.parentElement){
|
|||
|
|
if(obj.parentElement.className=="mpdiv" || obj.parentElement.className=="equdiv" || obj.parentElement.className=="sybdiv" || obj.parentElement.className=="txtdiv"){
|
|||
|
|
obj=obj.parentElement;
|
|||
|
|
break;
|
|||
|
|
}else{
|
|||
|
|
obj=obj.parentElement;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(obj.className=="mpdiv" || obj.className=="equdiv" || obj.className=="sybdiv" || obj.className=="txtdiv"){
|
|||
|
|
obj.style.zIndex = 10;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
function chgmp(){
|
|||
|
|
oPopup.hide();
|
|||
|
|
openx('chg');
|
|||
|
|
}
|
|||
|
|
function mpedit(id){
|
|||
|
|
//window.open(encodeURI(encodeURI("measurepointaction.do?method=doedit&id="+gdobj.name)));
|
|||
|
|
//window.open(encodeURI(encodeURI("mponpicaction.do?method=doedit&id="+gdobj.id)));
|
|||
|
|
window.showModalDialog(encodeURI(encodeURI("mponpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+id)),window);
|
|||
|
|
}
|
|||
|
|
function mpview(){
|
|||
|
|
window.showModalDialog(encodeURI(encodeURI("mponpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+gdobj.id)),window);
|
|||
|
|
}
|
|||
|
|
function txtedit(){
|
|||
|
|
//window.open(encodeURI(encodeURI("txtonpicaction.do?method=doedit&id="+gdobj.id)));
|
|||
|
|
window.showModalDialog(encodeURI(encodeURI("txtonpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+gdobj.id)),window);
|
|||
|
|
}
|
|||
|
|
var oPopup; //= window.createPopup();
|
|||
|
|
var gdobj;
|
|||
|
|
function contxtmenump(){
|
|||
|
|
//alert(event.srcElement.innerHTML);
|
|||
|
|
gdobj=event.srcElement;
|
|||
|
|
while(gdobj.parentElement){
|
|||
|
|
if(gdobj.parentElement.className=="mpdiv"){
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
break;
|
|||
|
|
}else{
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
oPopup.document.body.innerHTML=""
|
|||
|
|
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delmp();'>删除</td></tr>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.mpview();'>属性</td></tr>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.hisview();'>历史记录</td></tr><table>";
|
|||
|
|
oPopup.show(event.x, event.y, 90, 65,document.body);
|
|||
|
|
//alert(oPopup.document.body.innerHTML);
|
|||
|
|
}
|
|||
|
|
function contxtmenusyb(){
|
|||
|
|
//alert(event.srcElement.innerHTML);
|
|||
|
|
gdobj=event.srcElement;
|
|||
|
|
while(gdobj.parentElement){
|
|||
|
|
if(gdobj.parentElement.className=="sybdiv"){
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
break;
|
|||
|
|
}else{
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
oPopup.document.body.innerHTML=""
|
|||
|
|
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delsyb();'>删除</td></tr>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.sybview();'>属性</td></tr><table>";
|
|||
|
|
oPopup.show(event.x, event.y, 90, 24,document.body);
|
|||
|
|
//alert(oPopup.document.body.innerHTML);
|
|||
|
|
}
|
|||
|
|
function contxtmenuequ(){
|
|||
|
|
//alert(event.srcElement.innerHTML);
|
|||
|
|
gdobj=event.srcElement;
|
|||
|
|
while(gdobj.parentElement){
|
|||
|
|
if(gdobj.parentElement.className=="equdiv"){
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
break;
|
|||
|
|
}else{
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
oPopup.document.body.innerHTML=""
|
|||
|
|
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delequ();'>删除</td></tr>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.equview();'>属性</td></tr><table>";
|
|||
|
|
oPopup.show(event.x, event.y, 90, 24,document.body);
|
|||
|
|
//alert(oPopup.document.body.innerHTML);
|
|||
|
|
}
|
|||
|
|
function contxtmenutxt(){
|
|||
|
|
//alert(event.srcElement.innerHTML);
|
|||
|
|
gdobj=event.srcElement;
|
|||
|
|
while(gdobj.parentElement){
|
|||
|
|
if(gdobj.parentElement.className=="txtdiv"){
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
break;
|
|||
|
|
}else{
|
|||
|
|
gdobj=gdobj.parentElement;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
oPopup.document.body.innerHTML=""
|
|||
|
|
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.deltxt();'>删除</td></tr>"
|
|||
|
|
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.txtedit();'>属性</td></tr><table>";
|
|||
|
|
oPopup.show(event.x, event.y, 90, 45,document.body);
|
|||
|
|
//alert(oPopup.document.body.innerHTML);
|
|||
|
|
}
|
|||
|
|
function sybedit(o){
|
|||
|
|
window.open("sybonpicaction.do?method=doedit&id="+o);
|
|||
|
|
}
|
|||
|
|
//getdataV2();
|
|||
|
|
|
|||
|
|
function gb(){
|
|||
|
|
window.location="navigatepro.do?method=showlist";
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
|||
|
|
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
|||
|
|
<input type="hidden" name="picid" value="${clientWidth}">
|
|||
|
|
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
|||
|
|
<table >
|
|||
|
|
<tr >
|
|||
|
|
<th>车间</th>
|
|||
|
|
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
|||
|
|
<td style="vertical-align: middle">
|
|||
|
|
<div id="result">
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
|
|||
|
|
</td>
|
|||
|
|
<td align="right" style="padding-left:10px;padding-right:10px">
|
|||
|
|
</td>
|
|||
|
|
<td width="5">
|
|||
|
|
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div >
|
|||
|
|
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
|||
|
|
<%-- <div
|
|||
|
|
style="background-image: url('D:\Tomcat 7.0\webapps\UploadFile\document.DocFileMapper\69b73e6785124cf483721fff9f9dcf71_lct.jpg'); width:${cp._iconWidth }px; height:${cp._iconHeight }px;background-repeat:no-repeat;"
|
|||
|
|
id="<c:out value="${cp.picurl}" />"> --%>
|
|||
|
|
<!-- <div
|
|||
|
|
style="background-image: url('D:\Tomcat 7.0\/webapps\UploadFile\/document.DocFileMapper\/69b73e6785124cf483721fff9f9dcf71_lct.jpg'); width:800px; height:400px;background-repeat:no-repeat;"
|
|||
|
|
id="aaa"> </div> -->
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<%-- <c:forEach items="${mplist}" var="cmp">
|
|||
|
|
<div
|
|||
|
|
style="font-size:12px;z-index:9;position:absolute;top:${cmp._cleposy};left:${cmp._cleposx};"
|
|||
|
|
class="mpdiv" id="${cmp.id}" name="${cmp.mpid}">
|
|||
|
|
<c:if test="${empty cmp._icon}">
|
|||
|
|
<table bgcolor="#c5c5c5" style="font-size:12px"
|
|||
|
|
title="${cmp.name}"
|
|||
|
|
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
|||
|
|
onmouseup="StopDrag(this);"
|
|||
|
|
onmouseover="this.style.cursor='pointer';"
|
|||
|
|
oncontextmenu="contxtmenump();return false;">
|
|||
|
|
<tr>
|
|||
|
|
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
|||
|
|
ID="${cmp.mpid}" onDBLclick="mpedit('${cmp.id }');">
|
|||
|
|
<div id="${cmp.id}${cmp.mpid}" >
|
|||
|
|
${cmp.scadacode } ${cmp.cvalue }
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${not empty cmp._icon}">
|
|||
|
|
<div id="${cmp.id}${cmp.mpid}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
|||
|
|
onmouseup="StopDrag(this);"
|
|||
|
|
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenump();return false;">
|
|||
|
|
${cmp.scadacode } <img ondblclick="hisview('${cmp.mpid }');" name="${cmp.mpid}" src="${cmp._icon}">
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</c:if>
|
|||
|
|
</div>
|
|||
|
|
</c:forEach>
|
|||
|
|
|
|||
|
|
<c:forEach items="${syblist}" var="csyb">
|
|||
|
|
<div
|
|||
|
|
style="font-size:12px;z-index:9;position:absolute;top:${csyb._cleposy};left:${csyb._cleposx};"
|
|||
|
|
class="sybdiv" id="${csyb.id}"
|
|||
|
|
name="${csyb.id}" ondblclick="sybedit('${csyb.id}')";>
|
|||
|
|
<c:if test="${empty csyb._icon}">
|
|||
|
|
<table bgcolor="#c5c5c5" style="font-size:12px"
|
|||
|
|
title="${csyb.title}"
|
|||
|
|
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
|||
|
|
onmouseup="StopDrag(this);"
|
|||
|
|
onmouseover="this.style.cursor='pointer';"
|
|||
|
|
oncontextmenu="contxtmenusyb();return false;">
|
|||
|
|
<tr>
|
|||
|
|
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
|||
|
|
ID="${cmp.mpid}">
|
|||
|
|
<div id="${csyb.id}${csyb.id}" >
|
|||
|
|
${csyb.cvalue }
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${not empty csyb._icon}">
|
|||
|
|
<div id="${csyb.id}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
|||
|
|
onmouseup="StopDrag(this);"
|
|||
|
|
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenusyb();return false;">
|
|||
|
|
<img src="${csyb._icon}">
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</c:if>
|
|||
|
|
</div>
|
|||
|
|
</c:forEach>
|
|||
|
|
|
|||
|
|
<c:forEach items="${equlist}" var="cmp">
|
|||
|
|
<div
|
|||
|
|
style="background-image: url('${cmp.logo}');font-size:12px;z-index:9;position:absolute;top:${cmp._cleposy};left:${cmp._cleposx};height:100px;background-repeat:no-repeat;"
|
|||
|
|
class="equdiv" id="${cmp.id}"
|
|||
|
|
name="${cmp.equid}" ondblclick="hisview(this);">
|
|||
|
|
<table bgcolor="#c5c5c5" width="100" style="font-size:12px"
|
|||
|
|
title="${cmp.name}"
|
|||
|
|
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
|||
|
|
onmouseup="StopDrag(this);"
|
|||
|
|
onmouseover="this.style.cursor='pointer';"
|
|||
|
|
oncontextmenu="contxtmenuequ();return false;">
|
|||
|
|
<tr align="center" bgcolor="#888888">
|
|||
|
|
<td colspan="2">
|
|||
|
|
<c:out value="${cmp.name}" />
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td colspan="2" bgcolor="#000000" style="color: #00FF00" align="center"
|
|||
|
|
ID="<c:out value="${cmp.name}" />">
|
|||
|
|
<div id="${cmp.id}${cmp.equid}" >
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td colspan="2">
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
</c:forEach> --%>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
|||
|
|
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
|||
|
|
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
|||
|
|
</div>
|
|||
|
|
<script>
|
|||
|
|
var contentdiv=$("#content");
|
|||
|
|
$(function(){
|
|||
|
|
window.onresize = changesize;
|
|||
|
|
$("#workshopid").combobox({
|
|||
|
|
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
|||
|
|
valueField : 'id',
|
|||
|
|
textField : 'name',
|
|||
|
|
method:'get',
|
|||
|
|
panelHeight:'auto',
|
|||
|
|
onSelect: function () {
|
|||
|
|
contentdiv.empty();
|
|||
|
|
|
|||
|
|
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
|||
|
|
contentdiv.append(son);
|
|||
|
|
var workshopid = $("#workshopid").combobox('getValue');
|
|||
|
|
var dates = $("#workshopid").combobox('getData');
|
|||
|
|
|
|||
|
|
for (var i=0;i< dates.length;i++) {
|
|||
|
|
//console.info(dates[i].id)
|
|||
|
|
if (dates[i].id == workshopid) {
|
|||
|
|
var abspath=dates[i].commonFile.abspath;
|
|||
|
|
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
|||
|
|
//abspath.replace("//","/");
|
|||
|
|
//alert(abspath)
|
|||
|
|
$("#img").attr("src","../../../"+abspath);
|
|||
|
|
showTxt();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
|||
|
|
var containerWidth = 0;
|
|||
|
|
var containerHeight = 0;
|
|||
|
|
var selectid=""; //记录右键时,指向的对象
|
|||
|
|
function changesize(){
|
|||
|
|
if (firstOnResizeFire) {
|
|||
|
|
firstOnResizeFire = false;
|
|||
|
|
adjuest();
|
|||
|
|
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
|||
|
|
setTimeout(function() {
|
|||
|
|
firstOnResizeFire = true;
|
|||
|
|
}, 500);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
function adjuest(){
|
|||
|
|
var obj = contentdiv.find("div");
|
|||
|
|
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
|||
|
|
var height =document.body.clientHeight// $("#content").height();
|
|||
|
|
for(var i=0;i<obj.length;i++){
|
|||
|
|
if(obj[i].className=="easyui-draggable"){
|
|||
|
|
|
|||
|
|
var jobj=$("#"+obj[i].id);
|
|||
|
|
//console.info("新对象",jobj.position().left);
|
|||
|
|
var left=width*jobj.position().left/containerWidth;
|
|||
|
|
var top=height*jobj.position().top/containerHeight;
|
|||
|
|
//console.info("新左距离",left);
|
|||
|
|
jobj.css("left",left);
|
|||
|
|
jobj.css("top",top);
|
|||
|
|
//console.info("文本的左距离",jobj.position().left);
|
|||
|
|
//console.info("容器的宽度",width);
|
|||
|
|
//console.info("body的宽度",);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
containerWidth =width;
|
|||
|
|
containerHeight=height;
|
|||
|
|
}
|
|||
|
|
function showTxt(){
|
|||
|
|
var workshopid = $("#workshopid").combobox('getValue');
|
|||
|
|
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
|||
|
|
//console.info(data)
|
|||
|
|
if (data.length>0) {
|
|||
|
|
for(i=0 ;i<data.length;i++){
|
|||
|
|
var item= data[i];
|
|||
|
|
containerWidth = contentdiv.width();
|
|||
|
|
containerHeight = contentdiv.height();
|
|||
|
|
|
|||
|
|
var left=containerWidth*item.posx/item.containerwidth;
|
|||
|
|
var top=containerHeight*item.posy/item.containerheight;
|
|||
|
|
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'">'+
|
|||
|
|
'<table id="title" style="font-size:12px" >'+
|
|||
|
|
'<tr align="center">'+
|
|||
|
|
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
|||
|
|
item.content+
|
|||
|
|
'</span></td>'+
|
|||
|
|
'</tr>'+
|
|||
|
|
'</table>'+
|
|||
|
|
'</div>';
|
|||
|
|
|
|||
|
|
//console.info(son)
|
|||
|
|
contentdiv.append(son);
|
|||
|
|
|
|||
|
|
$('#'+item.id).bind('contextmenu',function(e){
|
|||
|
|
selectid=this.id;
|
|||
|
|
e.preventDefault();
|
|||
|
|
$('#mTxt').menu('show', {
|
|||
|
|
left: e.pageX,
|
|||
|
|
top: e.pageY
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
$('#'+item.id).draggable()
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
function txtMenuHandler(item){
|
|||
|
|
switch(item.name){
|
|||
|
|
case'delete':
|
|||
|
|
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
parent.$.messager.alert('提示','删除成功','info',function(){
|
|||
|
|
$('#'+selectid).remove();
|
|||
|
|
});
|
|||
|
|
}else{
|
|||
|
|
parent.$.messager.alert('提示','删除失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
</body>
|
|||
|
|
</html>
|