first commit
This commit is contained in:
564
WebRoot/jsp/work/scadapic/picView.jsp
Normal file
564
WebRoot/jsp/work/scadapic/picView.jsp
Normal file
@ -0,0 +1,564 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ 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();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
|
||||
|
||||
<%request.setAttribute("Status_Fault",EquipmentCard.Status_Fault);%>
|
||||
<%request.setAttribute("Status_OFF",EquipmentCard.Status_OFF);%>
|
||||
<%request.setAttribute("Status_ON",EquipmentCard.Status_ON);%>
|
||||
<%request.setAttribute("Status_StandBy",EquipmentCard.Status_StandBy);%>
|
||||
<%request.setAttribute("Status_UnMatch",EquipmentCard.Status_UnMatch);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), 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,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" 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();
|
||||
showMPoint();
|
||||
showEM();
|
||||
//showEMInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
//开启定时器刷新
|
||||
startClock();
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
function startClock(){
|
||||
myrefresh();
|
||||
setTimeout('startClock()',5000);
|
||||
}
|
||||
|
||||
function myrefresh()
|
||||
{
|
||||
//contentdiv.empty();
|
||||
showTxt();
|
||||
showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
|
||||
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.indexOf("easyui-draggable")>=0){
|
||||
|
||||
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的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//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) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//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+'" type="${Flag_Txt}">'+
|
||||
'<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;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
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="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
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 w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}" equipid='+item.equipid+'>'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
''+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEMInfo(str){
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardInfo.do", {id:str}, function(data) {
|
||||
//console.info(data)
|
||||
var sons;
|
||||
if (data !=null) {
|
||||
sons= '<div id ="equipInfo" style="border:1px solid yellow;background-color:black;position:absolute;width: 180px;height:200px;top:0px;left:0px">'+
|
||||
'<table id="info" style="font-size:12px" >'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">设备名称:'+data.equipmentname+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">状态:'+getEquStatus(data.equipmentstatus)+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">排产情况:</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">'+
|
||||
getInfoFromArrangement(data.equipmentArrangements)+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'<div id ="arrangeInfo" >'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
//console.info(sons)
|
||||
//if(!$("#equipInfo")){
|
||||
$("#equipInfo").remove();
|
||||
//}
|
||||
contentdiv.append(sons);
|
||||
//showArrangeGrid(data.id,"2017-10-13");
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
function getEquStatus(statuscode){
|
||||
switch(statuscode){
|
||||
case '${Status_Fault}':
|
||||
return '故障';
|
||||
break;
|
||||
case '${Status_OFF}':
|
||||
return '停机';
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
return '运行中';
|
||||
break;
|
||||
case '${Status_StandBy}':
|
||||
return '待机';
|
||||
break;
|
||||
case '${Status_UnMathch}':
|
||||
return '未匹配测量点';
|
||||
break;
|
||||
}
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
var workorderno="";
|
||||
$.each(arrangement, function(index, item){
|
||||
//console.log(item);
|
||||
if(str !=""){
|
||||
str+="<br />";
|
||||
}
|
||||
if(workorderno!=item._workorderno){
|
||||
workorderno=item._workorderno;
|
||||
str=str+"工单:"+workorderno+"<br />";
|
||||
}
|
||||
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
752
WebRoot/jsp/work/scadapic/picView111.jsp
Normal file
752
WebRoot/jsp/work/scadapic/picView111.jsp
Normal file
@ -0,0 +1,752 @@
|
||||
<%@ 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>
|
||||
237
WebRoot/jsp/work/scadapic/picaddequ.jsp
Normal file
237
WebRoot/jsp/work/scadapic/picaddequ.jsp
Normal file
@ -0,0 +1,237 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave(){
|
||||
var selid="";
|
||||
var obj=document.getElementsByTagName("input");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].type == "checkbox" && obj[i].checked && obj[i].name=="cids"){
|
||||
selid+=obj[i].value+",";
|
||||
}
|
||||
}
|
||||
//alert(selid);
|
||||
window.location="scadapicaction.do?method=addequsave&type=0&clientWidth=${clientWidth}&picid=${picid}&selid="+selid;
|
||||
}
|
||||
|
||||
function dofresh(){
|
||||
ListForm.submit();
|
||||
}
|
||||
function doback(){
|
||||
window.location="scadapicaction.do?method=picdesign&clientWidth=${clientWidth}&type=${type}&picid=${picid}&bizid=${bizid}";
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<form id="ListForm" action="scadapicaction.do?method=addequ&clientWidth=${clientWidth}&type=${type}"
|
||||
method="post">
|
||||
<input type="hidden" name="sort" value="${pageinfo.sort}">
|
||||
<input type="hidden" name="dirt" value="${pageinfo.dirt}">
|
||||
<input type="hidden" name="bizid" value="${bizid}">
|
||||
<input type="hidden" name="picid" value="${picid}">
|
||||
<input type="hidden" name="pageNum" value="${pageinfo.pageNum}">
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dosave();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/save.gif" style="vertical-align: middle">
|
||||
保存 </span>
|
||||
<span onclick="dosave();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="150" style="vertical-align: middle" align="center">
|
||||
<input type="text" name="code" class="inputtext" value="${param.code}">
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dofresh();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/search.gif" style="vertical-align: middle">
|
||||
检索 </span>
|
||||
<span onclick="dofresh();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="doback();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/undo.gif" style="vertical-align: middle">
|
||||
返回 </span>
|
||||
<span onclick="doback();" class="btnright"> </span>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="geographyAreaField" onchange="dofresh();">
|
||||
<option value="">
|
||||
全部安装地点
|
||||
</option>
|
||||
<c:forEach items="${geographyAreaArray}" var="gaaObj">
|
||||
<c:choose>
|
||||
<c:when test="${gaaObj.id==param.geographyAreaField}">
|
||||
<option value="${gaaObj.id}" selected>
|
||||
<c:out value="${gaaObj.name}"></c:out>
|
||||
</option>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<option value="${gaaObj.id}">
|
||||
<c:out value="${gaaObj.name}"></c:out>
|
||||
</option>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="currentManageFlagsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部管理状态
|
||||
</option>
|
||||
<c:forEach items="${currentManageFlagArray}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.currentManageFlagsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="equipmentLevelsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部设备等级
|
||||
</option>
|
||||
<c:forEach items="${equipmentLevelArray}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.equipmentLevelsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="fcsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部资产分类
|
||||
</option>
|
||||
<c:forEach items="${fclist}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.fcsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="tablenameline">
|
||||
<tr>
|
||||
<td>
|
||||
设备卡片
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="listtable" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30">
|
||||
<input type="checkbox" name="checkall"
|
||||
onClick="selectAll('cids',this.checked);" />
|
||||
</th>
|
||||
<th>
|
||||
编号
|
||||
</th>
|
||||
<th>
|
||||
名称
|
||||
</th>
|
||||
<th width="15%">
|
||||
所在工段
|
||||
</th>
|
||||
<th width="10%">
|
||||
类型
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:set var="rowcount" value="${0}" />
|
||||
<c:forEach var="current" items="${list}">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="checkbox" name="cids"
|
||||
value='<c:out value="${current.id}"/>'
|
||||
onclick="selectsingle('cids','checkall',this.checked)" />
|
||||
</td>
|
||||
<td>
|
||||
${current.equipmentCardID}
|
||||
</td>
|
||||
<td>
|
||||
${current.equipmentName}
|
||||
</td>
|
||||
<td>
|
||||
${current._areaName}
|
||||
</td>
|
||||
<td>
|
||||
${current._equipmentClassName}
|
||||
</td>
|
||||
</tr>
|
||||
<c:set var="rowcount" value="${rowcount+1}" />
|
||||
</c:forEach>
|
||||
<c:if test="${rowcount<12}">
|
||||
<c:forEach var="i" begin="${rowcount+1}" end="12">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
</table>
|
||||
<br>
|
||||
<table style="font-size: 12px" class="foottable" >
|
||||
<tr>
|
||||
<td>
|
||||
${pageinfo.pageInfo }
|
||||
</td>
|
||||
<td align="right">
|
||||
<c:out value="${pageinfo.pageNav }" escapeXml="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
254
WebRoot/jsp/work/scadapic/picaddmp.jsp
Normal file
254
WebRoot/jsp/work/scadapic/picaddmp.jsp
Normal file
@ -0,0 +1,254 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave(){
|
||||
var selid="";
|
||||
var obj=document.getElementsByTagName("input");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].type == "checkbox" && obj[i].checked && obj[i].name=="cids"){
|
||||
selid+=obj[i].value+",";
|
||||
}
|
||||
}
|
||||
//alert(selid);
|
||||
window.location=encodeURI(encodeURI("scadapicaction.do?method=addmpsave&type=0&clientWidth=${clientWidth}&picid=${picid}&selid="+selid));
|
||||
}
|
||||
|
||||
function dofresh(){
|
||||
ListForm.submit();
|
||||
}
|
||||
|
||||
function doback(){
|
||||
window.location="scadapicaction.do?method=picdesign&clientWidth=${clientWidth}&type=${type}&picid=${picid}&bizid=${bizid}";
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<form id="ListForm" action="scadapicaction.do?method=addmp&clientWidth=${clientWidth}&type=${type}"
|
||||
method="post">
|
||||
<input type="hidden" name="sort" value="${pageinfo.sort}">
|
||||
<input type="hidden" name="dirt" value="${pageinfo.dirt}">
|
||||
<input type="hidden" name="bizid" value="${bizid}">
|
||||
<input type="hidden" name="picid" value="${picid}">
|
||||
<input type="hidden" name="pageNum" value="${pageinfo.pageNum}">
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dosave();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/save.gif" style="vertical-align: middle">
|
||||
保存 </span>
|
||||
<span onclick="dosave();" class="btnright"> </span>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="dosave();">--%>
|
||||
<%-- <img alt="" src="IMG/button/save.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 保存--%>
|
||||
<%-- </td>--%>
|
||||
<td width="120" style="vertical-align: middle" align="center">
|
||||
<select name="colname">
|
||||
<option value="scadacode" <c:if test="${colname=='scadacode' }">selected</c:if>>SCADA代码</option>
|
||||
<option value="name" <c:if test="${colname=='name' }">selected</c:if>>名称</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="150" style="vertical-align: middle" align="center">
|
||||
<input type="text" name="searchvalue" class="inputtext" value="${searchvalue}">
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dofresh();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/search.gif" style="vertical-align: middle">
|
||||
检索 </span>
|
||||
<span onclick="dofresh();" class="btnright"> </span>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="dofresh();">--%>
|
||||
<%-- <img alt="" src="IMG/button/search.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 检索--%>
|
||||
<%-- </td> --%>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="history.back();">--%>
|
||||
<%-- <img alt="" src="IMG/button/undo.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 返回--%>
|
||||
<%-- </td>--%>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="doback();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/undo.gif" style="vertical-align: middle">
|
||||
返回 </span>
|
||||
<span onclick="doback();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="100">
|
||||
<select name="areascope" id="areascope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${param.areascope=='' }">selected</c:if>>
|
||||
全部区域
|
||||
</option>
|
||||
<c:forEach items="${arealist}" var="obj">
|
||||
<option value="${obj.area}"
|
||||
<c:if test="${param.areascope == obj.area }">selected</c:if>>
|
||||
${obj.area}
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="100">
|
||||
<select name="sourcescope" id="sourcescope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${param.sourcescope=='' }">selected</c:if>>
|
||||
全部数据来源
|
||||
</option>
|
||||
<option value="SCADA"
|
||||
<c:if test="${param.sourcescope=='SCADA' }">selected</c:if>>
|
||||
自控系统
|
||||
</option>
|
||||
<option value="MENUAL"
|
||||
<c:if test="${param.sourcescope=='MENUAL' }">selected</c:if>>
|
||||
手工输入
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="60">
|
||||
<select name="typescope" id="typescope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${typescope=='' }">selected</c:if>>
|
||||
全部信号输入
|
||||
</option>
|
||||
<option value="AI"
|
||||
<c:if test="${typescope=='AI' }">selected</c:if>>
|
||||
模拟量输入(AI)
|
||||
</option>
|
||||
<option value="DI"
|
||||
<c:if test="${typescope=='DI' }">selected</c:if>>
|
||||
数字量输入(DI)
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
<table class="tablenameline">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="listtable" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30">
|
||||
<input type="checkbox" name="checkall" onClick="selectAll('cids',this.checked);"/>
|
||||
</th>
|
||||
<th width="25%" onclick="sort('name');">
|
||||
名称
|
||||
</th>
|
||||
<th width="15%" onclick="sort('scadacode');">
|
||||
变量名
|
||||
</th>
|
||||
<th width="10%" onclick="sort('type');">
|
||||
类型
|
||||
</th>
|
||||
<th width="10%" onclick="sort('unit');">
|
||||
单位
|
||||
</th>
|
||||
<th>
|
||||
所属设备
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:set var="rowcount" value="${0}" />
|
||||
<c:forEach var="current" items="${mplist}">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="checkbox" name="cids"
|
||||
value='<c:out value="${current.id}"/>'
|
||||
onclick="selectsingle('cids','checkall',this.checked)" />
|
||||
</td>
|
||||
<td>
|
||||
${current.name}
|
||||
</td>
|
||||
<td>
|
||||
${current.scadacode}
|
||||
</td>
|
||||
<td>
|
||||
${current.type}
|
||||
</td>
|
||||
<td>
|
||||
${current.unit}
|
||||
</td>
|
||||
<td>
|
||||
${current.equid}
|
||||
</td>
|
||||
</tr>
|
||||
<c:set var="rowcount" value="${rowcount+1}" />
|
||||
</c:forEach>
|
||||
<c:if test="${rowcount<12}">
|
||||
<c:forEach var="i" begin="${rowcount+1}" end="12">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
</table>
|
||||
<br>
|
||||
<table style="font-size: 12px" class="foottable" >
|
||||
<tr>
|
||||
<td>
|
||||
${pageinfo.pageInfo }
|
||||
</td>
|
||||
<td align="right">
|
||||
<c:out value="${pageinfo.pageNav }" escapeXml="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
102
WebRoot/jsp/work/scadapic/picaddsyb.jsp
Normal file
102
WebRoot/jsp/work/scadapic/picaddsyb.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave(){
|
||||
//alert('a');
|
||||
document.SybOnPicForm.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="56" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="dosave();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存
|
||||
</td>
|
||||
<td width="56" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="history.back();">
|
||||
<img alt="" src="IMG/button/undo.gif"
|
||||
style="vertical-align: middle">
|
||||
返回
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<table class="tablenameline">
|
||||
<tr>
|
||||
<td width="5%">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<form id="SybOnPicForm" action="sybonpicaction.do?method=dosave&type=0&clientWidth=${clientWidth}" name="SybOnPicForm"
|
||||
method="post">
|
||||
<input type="hidden" name="picid" value="${sop.picid}">
|
||||
<input type="hidden" name="id" value="${sop.id}">
|
||||
<table class="inputtable" cellspacing="2" cellspacing="2">
|
||||
<tr>
|
||||
<td>
|
||||
名称
|
||||
</td>
|
||||
<td>
|
||||
<input name="title" value="${sop.title }" class="inputtext">
|
||||
</td>
|
||||
<td>
|
||||
精度
|
||||
</td>
|
||||
<td>
|
||||
<input name="accuracy" value="${sop.accuracy }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
表达式
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<input name="express" value="${sop.express }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
posx
|
||||
</td>
|
||||
<td>
|
||||
<input name="posx" value="${sop.posx }" class="inputtext">
|
||||
</td>
|
||||
<td>
|
||||
posy
|
||||
</td>
|
||||
<td>
|
||||
<input name="posy" value="${sop.posy }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
519
WebRoot/jsp/work/scadapic/picdesign.jsp
Normal file
519
WebRoot/jsp/work/scadapic/picdesign.jsp
Normal file
@ -0,0 +1,519 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ 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();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), 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,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</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 width="80">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addmp();" >测量点</a>
|
||||
</td>
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addequ();">设备</a>
|
||||
</td>
|
||||
<!-- <td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addsyb();">标识</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addtext();">文本</a>
|
||||
</td>
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setdata();">保存布局</a>
|
||||
|
||||
</td>
|
||||
<%-- <c:if test="${cu.empid!='emp01'}">
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="returndata();">恢复布局</a>
|
||||
</td>
|
||||
</c:if> --%>
|
||||
<!-- <td width="120">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setpicdata();">设为默认图</a>
|
||||
</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>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
</div>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'edit',iconCls:'ext-icon-cog_edit'">编辑</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" 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%;cursor:default;"></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();
|
||||
showMPoint();
|
||||
showEM();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
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.indexOf("easyui-draggable")>=0){
|
||||
|
||||
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的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//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) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//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+'" type="${Flag_Txt}">'+
|
||||
'<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;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
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="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
case'edit':
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '编辑测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/editMPoint.do?id='+selectid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case'help':
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '测量点信息',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/showMPoint.do?id='+selectid,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
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 w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var equipmentname="未查询到设备信息";
|
||||
if(item.equipmentCard!=null){
|
||||
equipmentname=item.equipmentCard.equipmentname;
|
||||
}
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
$('#'+item.id).resizable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.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>
|
||||
651
WebRoot/jsp/work/scadapic/picdesignmainpic.jsp
Normal file
651
WebRoot/jsp/work/scadapic/picdesignmainpic.jsp
Normal file
@ -0,0 +1,651 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function searchSelect(o){
|
||||
window.location="scadapicaction.do?method=picdesign&picid="+o+"&bizid=${bizid}";
|
||||
}
|
||||
|
||||
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=="mpdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updatemponpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
if(obj[i].className=="equdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updateequonpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
if(obj[i].className=="sybdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updatesybonpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 opensubpic(picid){--%>
|
||||
<%-- window.showModalDialog('scadapicaction.do?method=picdesignsubpic&bizid=${bizid}&picid='+picid,'window','help:off;status:on;dialogWidth:1024px;dialogHeight:768px;dialogTop:0px;dialogLeft:0px')--%>
|
||||
<%-- }--%>
|
||||
|
||||
function addmp(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addmp&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
function addequ(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addequ&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
|
||||
function addsyb(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addsyb&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
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");
|
||||
}
|
||||
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].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=obj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
obj=obj.parentElement;
|
||||
}
|
||||
}
|
||||
if(obj.className=="mpdiv" || obj.className=="equdiv" || obj.className=="sybdiv"){
|
||||
obj.style.zIndex = 10;
|
||||
}
|
||||
}
|
||||
|
||||
function StartDrag(obj) {
|
||||
settop(event.srcElement);
|
||||
obj.setCapture();
|
||||
move = true;
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
|
||||
function Drag(obj) {
|
||||
if (move) {
|
||||
var oldwin =event.srcElement;
|
||||
while(oldwin.parentElement){
|
||||
if(oldwin.parentElement.className=="mpdiv" || oldwin.parentElement.className=="equdiv" || oldwin.parentElement.className=="sybdiv"){
|
||||
oldwin=oldwin.parentElement;
|
||||
break;
|
||||
}else{
|
||||
oldwin=oldwin.parentElement;
|
||||
}
|
||||
}
|
||||
if(oldwin.className=="mpdiv" || oldwin.className=="equdiv" || oldwin.className=="sybdiv"){
|
||||
oldwin.style.left = event.clientX - ox + parseInt(oldwin.style.left);
|
||||
if(parseInt(oldwin.style.left)<0){
|
||||
oldwin.style.left=0;
|
||||
}
|
||||
oldwin.style.top = event.clientY - oy + parseInt(oldwin.style.top);
|
||||
if(parseInt(oldwin.style.top)<0){
|
||||
oldwin.style.top=0;
|
||||
}
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function StopDrag(obj) {
|
||||
obj.releaseCapture();
|
||||
move = false;
|
||||
}
|
||||
|
||||
function $(Id) {
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
function delmp(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deletemponpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
function delequ(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deleteequonpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
function delsyb(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deletesybonpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function syncall(){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "sybonpicaction.do?method=syncall", true);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
}
|
||||
|
||||
function chgmp(){
|
||||
oPopup.hide();
|
||||
openx('chg');
|
||||
}
|
||||
function mpedit(){
|
||||
window.open(encodeURI(encodeURI("measurepointaction.do?method=doedit&id="+gdobj.name)));
|
||||
}
|
||||
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.mpedit();'>测量点设置</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 48,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><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><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
|
||||
function sybedit(o){
|
||||
window.open("sybonpicaction.do?method=doedit&id="+o);
|
||||
}
|
||||
</script>
|
||||
|
||||
<body >
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0" width="1000"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addmp();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
测量点
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addequ();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
设备
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addsyb();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
标识
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="syncall();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
同步
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="setdata();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存布局
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="getdata();">
|
||||
<img alt="" src="IMG/button/undo.gif"
|
||||
style="vertical-align: middle">
|
||||
获取数据
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="mpcopy();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
复制
|
||||
</td>
|
||||
<td>
|
||||
<select name='frompicid' id="frompicid" >
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right">
|
||||
<select name='picid' id="picid" onchange="searchSelect(this.value)">
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<img src="${cp.picurl}" width="1000" height="620" border="0" ISMAP USEMAP="#${cp.id }">
|
||||
<MAP NAME="${cp.id }">
|
||||
<c:out value="${cp.areas}" escapeXml="false"></c:out>
|
||||
</MAP>
|
||||
<div
|
||||
|
||||
id="<c:out value="${cp.picurl}" />">
|
||||
<c:forEach items="${mplist}" var="cmp">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};"
|
||||
class="mpdiv" id="${cmp.id}"
|
||||
name="${cmp.mpid}" ondblclick="hisview(this);">
|
||||
<c:if test="${empty cmp._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" 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 align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${cmp.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.name}" />">
|
||||
<c:out value="${cmp.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${cmp.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty cmp._icon}">
|
||||
<div id="${cmp.mpid}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenump();return false;">
|
||||
<img 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.posy};left:${csyb.posx};"
|
||||
class="sybdiv" id="${csyb.id}"
|
||||
name="${csyb.id}" ondblclick="sybedit('${csyb.id}')";>
|
||||
<c:if test="${empty csyb._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" 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 align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${csyb.title}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${csyb.title}" />">
|
||||
<c:out value="${csyb.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${csyb.unit}" />
|
||||
</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.posy};left:${cmp.posx};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 bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.name}" />">
|
||||
|
||||
</td>
|
||||
<td width="30%">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
||||
441
WebRoot/jsp/work/scadapic/picdesignsubpic.jsp
Normal file
441
WebRoot/jsp/work/scadapic/picdesignsubpic.jsp
Normal file
@ -0,0 +1,441 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache,must-revalidate">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function searchSelect(o){
|
||||
//alert(unitid.value);
|
||||
window.location="UnitPointAction.do?method=detail&picid="+o+"&bizid=${bizid}";
|
||||
}
|
||||
|
||||
var gmpi=0;
|
||||
var mpxmlhttp;
|
||||
|
||||
function updateall(){
|
||||
gmpi=0;
|
||||
getdata();
|
||||
//getequdata();
|
||||
}
|
||||
|
||||
function getdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=gmpi;i<obj.length;i++){
|
||||
gmpi=gmpi+1;
|
||||
if(obj[i].className=="mpdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatevalue&id="+obj[i].name)),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextmp(cobj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(obj[i].className=="sybdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatesybvalue&id="+obj[i].name)),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextsyb(cobj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(obj[i].className=="equdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
var dobj = obj[i];
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updateequvalue&equid="+obj[i].name.Trim())),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextequ(cobj,dobj);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function nextmp(cobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
cobj.innerHTML=res;
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nextsyb(cobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
//alert(res);
|
||||
cobj.innerHTML=res;
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nextequ(cobj,dobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
res = res.split("$");
|
||||
cobj.innerHTML=res[0];
|
||||
if(res[1]){
|
||||
|
||||
cobj.parentElement.nextSibling.firstChild.innerText=res[1];
|
||||
dobj.firstChild.style.backgroundColor="#FFFF00"
|
||||
}else{
|
||||
cobj.parentElement.nextSibling.firstChild.innerText="";
|
||||
dobj.firstChild.style.backgroundColor="#c5c5c5";
|
||||
}
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hisview(o){
|
||||
window.open(encodeURI(encodeURI("UnitPointAction.do?method=hisview&mpid="+o)),"_blank");
|
||||
}
|
||||
|
||||
function goUpdateRecord(equipmentCardID){
|
||||
equipmentCardForm.elements['equipmentCardID'].value=equipmentCardID;
|
||||
|
||||
equipmentCardForm.submit();
|
||||
}
|
||||
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].style.zIndex>9){
|
||||
document.all[i].style.zIndex = 9;
|
||||
}
|
||||
}
|
||||
while(obj.parentElement){
|
||||
if(obj.parentElement.className=="mpdiv"){
|
||||
obj=obj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
obj=obj.parentElement;
|
||||
}
|
||||
}
|
||||
if(obj.className=="mpdiv"){
|
||||
obj.style.zIndex = 10;
|
||||
}
|
||||
}
|
||||
function StartDrag(obj) {
|
||||
settop(event.srcElement);
|
||||
obj.setCapture();
|
||||
move = true;
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
|
||||
function Drag(obj) {
|
||||
if (move) {
|
||||
var oldwin =event.srcElement;
|
||||
while(oldwin.parentElement){
|
||||
if(oldwin.parentElement.className=="mpdiv" || oldwin.parentElement.className=="equdiv"){
|
||||
oldwin=oldwin.parentElement;
|
||||
break;
|
||||
}else{
|
||||
oldwin=oldwin.parentElement;
|
||||
}
|
||||
}
|
||||
if(oldwin.className=="mpdiv" || oldwin.className=="equdiv"){
|
||||
oldwin.style.left = event.clientX - ox + parseInt(oldwin.style.left);
|
||||
if(parseInt(oldwin.style.left)<0){
|
||||
oldwin.style.left=0;
|
||||
}
|
||||
oldwin.style.top = event.clientY - oy + parseInt(oldwin.style.top);
|
||||
if(parseInt(oldwin.style.top)<0){
|
||||
oldwin.style.top=0;
|
||||
}
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function StopDrag(obj) {
|
||||
obj.releaseCapture();
|
||||
move = false;
|
||||
}
|
||||
|
||||
function $(Id) {
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
function refresh(o){
|
||||
setInterval("updateall()",o);
|
||||
}
|
||||
|
||||
setInterval("updateall()",30000);
|
||||
|
||||
function mpvlist(){
|
||||
window.location="measurepointaction.do?method=datainputprepare&bizid=${bizid}";
|
||||
}
|
||||
|
||||
|
||||
function addequalarm(){
|
||||
window.location="alarmaction.do?method=doequnew&bizid=${bizid}&equid="+gdobj.name;
|
||||
}
|
||||
function addequalstatus(){
|
||||
window.location="equstatusaction.do?method=donew&bizid=${bizid}&equid="+gdobj.name;
|
||||
}
|
||||
|
||||
var oPopup = window.createPopup();
|
||||
var gdobj;
|
||||
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;'><tbody>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.addequalarm();'>添加故障信息</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.addequalstatus();'>更改设备状态</td></tr></tbaody><table>";
|
||||
oPopup.show(event.x, event.y, 90, 48,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function mpedit(){
|
||||
window.open("measurepointaction.do?method=doedit&id="+gdobj.name);
|
||||
}
|
||||
function contxtmenump(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'><tbody>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.mpedit();'>测量点设置</td></tr></tbaody><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body onload="updateall();">
|
||||
<img src="${cp.picurl}" width="1020" height="688" border="0">
|
||||
|
||||
<div
|
||||
|
||||
id="<c:out value="${cp.picurl}" />">
|
||||
<br>
|
||||
<c:forEach items="${mplist}" var="cmp">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};"
|
||||
class="mpdiv" id="${cmp.id}" name="${cmp.mpid}"
|
||||
>
|
||||
<c:if test="${empty cmp._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size: 12px;"
|
||||
title="${cmp.name}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" >
|
||||
<tr align="center" bgcolor="#888888" >
|
||||
<td colspan="2" name="${cmp.mpid}">
|
||||
${cmp.name }
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.mpid}" />" ondblclick="hisview('${cmp.mpid }');">
|
||||
${cmp.cvalue }
|
||||
</td>
|
||||
<td >
|
||||
|
||||
<c:out value="${cmp.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty cmp._icon}">
|
||||
<div id="${cmp.mpid}" >
|
||||
<img ondblclick="hisview('${cmp.mpid }');" name="${cmp.mpid}" src="${cmp._icon}" oncontextmenu="contxtmenump('${cmp.mpid}');return false;">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${syblist}" var="csyb">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${csyb.posy};left:${csyb.posx};"
|
||||
class="sybdiv"
|
||||
name="${csyb.id}">
|
||||
<c:if test="${empty csyb._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size:12px"
|
||||
title="${csyb.title}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${csyb.title}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${csyb.id}" />">
|
||||
<c:out value="${csyb.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${csyb.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty csyb._icon}">
|
||||
<div id="${csyb.id}" onmouseover="this.style.cursor='pointer';">
|
||||
<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.posy};left:${cmp.posx};height:100px;background-repeat:no-repeat;"
|
||||
class="equdiv" id="${cmp.id}" name="${cmp.equid}"
|
||||
>
|
||||
<table <c:if test="${cmp._status!='unuseable'}">bgcolor="#c5c5c5"</c:if><c:if test="${cmp._status=='unuseable'}">bgcolor="#ffff00"</c:if> width="100" style="font-size: 12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
>
|
||||
<tr align="center" bgcolor="#888888" >
|
||||
<td colspan="2" ondblclick="goUpdateRecord('${cmp.equid}');" oncontextmenu="contxtmenuequ('${cmp.equid}');return false;">
|
||||
${cmp.name }
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="#000000" style="color: #00FF00"
|
||||
align="center" ID="<c:out value="${cmp.equid}" />">
|
||||
|
||||
<br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<c:if test="${cmp._status=='unuseable'}">
|
||||
${cmp._memo }
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
<html:form action="equipmentCard.do?method=equipmentCardOperation"
|
||||
target="_blank">
|
||||
|
||||
<html:hidden property="equipmentCardID" />
|
||||
<html:hidden property="choice" value="goUpdateRecord" />
|
||||
</html:form>
|
||||
|
||||
<br>
|
||||
<table cellpadding="0" CELLSPACING="0" width="1000"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addmp();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
测量点
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addequ();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
设备
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addsyb();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
标识
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="syncall();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
同步
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="setdata();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存布局
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="mpcopy();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
复制
|
||||
</td>
|
||||
<td>
|
||||
<select name='frompicid' id="frompicid" >
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
54
WebRoot/jsp/work/scadapic/processVideoDetail.jsp
Normal file
54
WebRoot/jsp/work/scadapic/processVideoDetail.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<!doctype html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/node_modules/jquery/dist/jquery.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
/**
|
||||
if (-1 == WebVideoCtrl.I_CheckPluginInstall()) {
|
||||
var isDownload = confirm("您还未安装过插件,是否下载WebComponents.exe进行安装!");
|
||||
if(isDownload){
|
||||
location.href = 'http://' + location.host + '/UploadFile/PE_APP/plugins/WebComponents.exe';
|
||||
}
|
||||
return;
|
||||
}
|
||||
*/
|
||||
var processSectionId = parent.document.querySelector('#tab3').dataset.processsectionid;
|
||||
getCamerasByProcessSectionId(processSectionId);
|
||||
//getCamerasByProcessSectionId('d9016deabd2749be8b381159f29fc0dc');
|
||||
});
|
||||
function getCamerasByProcessSectionId(processSectionId) {
|
||||
$.post(ext.contextPath +"/work/camera/getCamerasByProcessSectionId.do", {processSectionId: processSectionId}, function(data) {
|
||||
console.log('摄像头数据:' + data);
|
||||
var res = JSON.parse(data);
|
||||
for(var i = 0, len = res.length; i < len; i++) {
|
||||
var videoIframe = document.createElement('iframe');
|
||||
videoIframe.id = 'videoIframe-' + res[i].id;
|
||||
videoIframe.style.cssText = 'width:510px;height:400px;border:0;margin:10px;position:absolute;top:0;left:' + i * 510 + 'px;z-index:9999;';
|
||||
switch(res[i].type){
|
||||
case 'dahua':
|
||||
videoIframe.src = ext.contextPath +"/work/scadaPic/showLiveSurveillanceVideo_Dahua.do?id=" + res[i].id;
|
||||
break;
|
||||
default:
|
||||
videoIframe.src = ext.contextPath +"/work/scadaPic/showLiveSurveillanceVideo.do?id=" + res[i].id;
|
||||
}
|
||||
|
||||
document.querySelector('#camerasFrame').appendChild(videoIframe);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
57
WebRoot/jsp/work/scadapic/processVideoView.jsp
Normal file
57
WebRoot/jsp/work/scadapic/processVideoView.jsp
Normal file
@ -0,0 +1,57 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<!doctype html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/camera/camera.css" rel='stylesheet' />
|
||||
<style type="text/css">
|
||||
.ptz .btn2 {
|
||||
margin: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
padding: 2px 0;
|
||||
height: auto;
|
||||
}
|
||||
.ptz .btn2:hover{
|
||||
background: #4d90fe;
|
||||
color: #fff;
|
||||
}
|
||||
.tt{
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<script type="text/javascript" src="<%=contextPath%>/node_modules/jquery/dist/jquery.min.js" charset="utf-8"></script>
|
||||
<!-- camera -->
|
||||
<%-- <script src="<%=request.getContextPath()%>/node_modules/jquery/dist/jquery.min.js"></script> --%>
|
||||
<script src="<%=request.getContextPath()%>/plugins/camera/webVideoCtrl.js"></script>
|
||||
<script src="<%=request.getContextPath()%>/plugins/camera/camera.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
changeWndNum(1);
|
||||
clickLogin();
|
||||
setTimeout("clickStartRealPlay()",1000)
|
||||
//clickStartRealPlay();
|
||||
});
|
||||
var stopRealPlay= function(){
|
||||
clickStopRealPlay();
|
||||
//setTimeout("",1000)
|
||||
}
|
||||
</script>
|
||||
<body onUnLoad="stopRealPlay();clickLogout();" class="vedio">
|
||||
<div id="divPlugin" class="plugin"></div>
|
||||
<input id="loginip" type="hidden" value="${url}" />
|
||||
<input id="port" type="hidden" value="${port}" />
|
||||
<input id="username" type="hidden" value="${camera.username}" />
|
||||
<input id="password" type="hidden" value="${camera.password}" />
|
||||
<input id="deviceport" type="hidden" value="8000" />
|
||||
<input id="ip" type="hidden" value="${url}" />
|
||||
<input id="channels" type="hidden" value="${camera.channel}" />
|
||||
<input id="streamtype" type="hidden" value="${streamtype}" />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
548
WebRoot/jsp/work/scadapic/processVideoView_Dahua.jsp
Normal file
548
WebRoot/jsp/work/scadapic/processVideoView_Dahua.jsp
Normal file
@ -0,0 +1,548 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=6;IE=7; IE=8; IE=EmulateIE7" />
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
</head>
|
||||
<body onUnLoad="StopPlay();LogoutDevice();">
|
||||
<!-- <div >
|
||||
<button id="Login" href="javascript:;"Onclick = "LoginDevice()">Login</button>
|
||||
<button id="Play" href="javascript:;"Onclick = "RealPlay()" style = "display:none;">RealPlay</button>
|
||||
<button id="Stop" href="javascript:;"Onclick = "StopPlay()" style = "display:none;">Stop</button>
|
||||
<button id="OpenIVS" href="javascript:;"Onclick = "OpenIVS()" style = "display:none;">OpenIVS</button>
|
||||
<button id="CloseIVS" href="javascript:;"Onclick = "CloseIVS()" style = "display:none;">CloseIVS</button>
|
||||
<button id="FullScreen" href="javascript:;"Onclick = "FullScreen()" style = "display:none;">FullScreen</button>
|
||||
<button id="LocalPlay" href="javascript:;"Onclick = "LocalPlay()" style = "display:none;">LocalPlay</button>
|
||||
<button id="SnapPicture" href="javascript:;"Onclick = "SnapPicture()" style = "display:none;">SnapPicture</button>
|
||||
<button id="GetAllChannelInfo" href="javascript:;"Onclick = "GetAllChannelInfo()" style = "display:none;">GetAllChannelInfo</button>
|
||||
<button id="Logout" href="javascript:;"Onclick = "LogoutDevice()" style = "display:none;">Logout</button>
|
||||
<button id="control" href="javascript:;" Onclick="control()" style="display:none;">control</button>
|
||||
</div> -->
|
||||
<div id="f_ocx" style="top:60px; left:0; height:350px;">
|
||||
</div>
|
||||
<!-- <div >
|
||||
<div>
|
||||
<button id="idQuery" href="javascript:;"Onclick = "QueryRecord()" style = "display:none;">QueryRecord</button>
|
||||
<button id="QueryFaceImageRecord" href="javascript:;"Onclick = "QueryFaceImageRecord()" style = "display:none;">QueryFaceImageRecord</button>
|
||||
<button id="QueryRecordInfoByTimeEx" href="javascript:;"Onclick = "QueryRecordInfoByTimeEx()" style = "display:none;">QueryRecordInfoByTime</button>
|
||||
<button id="DownloadFaceImageRecord" href="javascript:;"Onclick = "DownloadRecordByFile()" style = "display:none;">DownloadRecordByFile</button>
|
||||
<button id="download" href="javascript:;"Onclick = "DownloadByTime()" style = "display:none;">DownloadByTime</button>
|
||||
</div>
|
||||
<button id="PlayBack" href="javascript:;"Onclick = "PlayBack()" style = "display:none;">Playback</button>
|
||||
<button id="PlayRec" href="javascript:;"Onclick = "PlayRec()" style = "display:none;">PlayRec</button>
|
||||
<button id="PauseRec" href="javascript:;"Onclick = "PauseRec()" style = "display:none;">PauseRec</button>
|
||||
<button id="FastPlay" href="javascript:;"Onclick = "FastPlay()" style = "display:none;">FastPlay</button>
|
||||
<button id="SlowPlay" href="javascript:;"Onclick = "SlowPlay()" style = "display:none;">SlowPlay</button>
|
||||
<button id="SlowPlay" href="javascript:;" Onclick="control()" style="display:none;">control</button>
|
||||
|
||||
</div >
|
||||
<div id="TransEvent" style = "display:none;">
|
||||
<label >TransEvent</label><input type="text" style="width:900px" id="trEvent">
|
||||
</div>
|
||||
<div id="ShowPlayTime" style = "display:none;">
|
||||
<label >now time</label><input type="text" id="playtime">
|
||||
</div>
|
||||
<div id="DwonLoadPos" style = "display:none;">
|
||||
<label >pos</label><input type="text" style="width:900px" id="downPos">
|
||||
</div>
|
||||
<div style="display:none;" id="RecInfo">
|
||||
<div id="RecInfoList" style = "overflow:auto;width:600px;height:200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="DwonLoadByTimeInfo" style = "display:none;">
|
||||
<label >DwonLoadByTimeInfo</label><input type="text" style="width:900px" id="DwonLoadInfo">
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
$(function(){
|
||||
LoginDevice();
|
||||
setTimeout("RealPlay()",1000)
|
||||
})
|
||||
var Sys = {};
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var s;
|
||||
(s = ua.match(/(msie\s|trident.*rv:)([\d.]+)/)) ? Sys.ie = s[2] :
|
||||
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
|
||||
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
|
||||
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
|
||||
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
||||
|
||||
var hasPlugin = checkPlugins();
|
||||
|
||||
var g_ocx; //控件对象,初始化完毕后,可以调用《二次开发使用 WEB32网页调用接口说明.doc》文档中的接口
|
||||
var g_PlayTime;
|
||||
var g_curSpeed = 4; //默认的正常速度
|
||||
var htmlStChn1 = '';
|
||||
var recInfosByFile = [];
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP1:插件初始化/////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//加载插件到网页中去。
|
||||
loadPageOcx();
|
||||
|
||||
/**
|
||||
* 检测浏览器是否存在视频插件
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function checkPlugins() {
|
||||
var PLUGINS_NAME = 'WebActiveEXE.Plugin.1';
|
||||
var result;
|
||||
if (Sys.ie) {
|
||||
try {
|
||||
result = new ActiveXObject(PLUGINS_NAME);
|
||||
delete result;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
navigator.plugins.refresh(false);
|
||||
result = navigator.mimeTypes["application/media-plugin-version-3.1.0.2"];
|
||||
return !!(result && result.enabledPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
function loadPageOcx() {
|
||||
var mainOcxHtml = '';
|
||||
if (Sys.ie) {
|
||||
mainOcxHtml = '<object id="ocx" width="100%" height="100%" classid="CLSID:7F9063B6-E081-49DB-9FEC-D72422F2727F"></object>';
|
||||
} else {
|
||||
mainOcxHtml = '<object id="ocx" width="100%" height="100%" type="application/media-plugin-version-3.1.0.2" VideoWindTextColor="9c9c9c" VideoWindBarColor="414141"></object>';
|
||||
}
|
||||
document.getElementById('f_ocx').innerHTML = mainOcxHtml;
|
||||
//document.getElementById('Login').style.display = '';
|
||||
initPageOcx();
|
||||
}
|
||||
|
||||
/**
|
||||
* [initPageOcx 初始化g_ocx,绑定插件事件;有些信息(录像信息等)会主动调用注册的回调接口]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function initPageOcx() {
|
||||
g_ocx = document.getElementById('ocx');
|
||||
//控件加载成功后注册需要关注的监听事件
|
||||
//详见《二次开发使用 WEB32网页调用接口说明》章节二:事件
|
||||
|
||||
//TransEvent: 注册这个事件接收控件内部状态
|
||||
//这个非常重要,是按时间查找录像查询的关键;调用本例中QueryRecordInfoByTimeEx()会触发回调
|
||||
g_ocx.AddEventListener('TransEvent', TransEvent);
|
||||
|
||||
//SetNetPlayFileInfo: 注册这个事件接收查询到的录像信息
|
||||
//这个非常重要,是录像查询的关键;调用本例中QueryRecord()会触发回调
|
||||
g_ocx.AddEventListener('SetNetPlayFileInfo', ShowRecInfo);
|
||||
g_ocx.AddEventListener('NetPlayTimeInform', ShowPlayTime);
|
||||
|
||||
//InsertNetRecordFileInfo: 注册这个事件接收查询到的录像信息
|
||||
//这个非常重要,是按时间查找录像查询的关键;调用本例中QueryRecordInfoByTimeEx()会触发回调
|
||||
g_ocx.AddEventListener('InsertNetRecordFileInfo', InsertNetRecordFileInfo);
|
||||
|
||||
//在这里可以隐藏工具栏上的按钮
|
||||
hideToolbarBtns();
|
||||
}
|
||||
|
||||
/**
|
||||
* [hideToolbarBtns 隐藏工具栏按钮]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function hideToolbarBtns() {
|
||||
//按钮隐藏可以自由选择怎么设置,遵从此协议格式即可
|
||||
//按钮名称有如下几种:{"Fisheye", "ZoomIn", "Record", "CloseVideo", "Snapshot", "Audio"}
|
||||
var str = '{"Protocol":"VideoFuncProtocol","Params":{"Audio":false, "Snapshot": false, "Record": false, "Fisheye":false, "ZoomIn":false}}';
|
||||
g_ocx.ProtocolPluginWithWebCall(str);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP2:登录设备///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function LoginDevice() {
|
||||
var url='${camera.url}';
|
||||
var arr=url.split(':');
|
||||
var ip =arr[0];
|
||||
var port=37777;
|
||||
if(arr.length>1){
|
||||
port=arr[1];
|
||||
}
|
||||
var bRet = g_ocx.LoginDeviceEx(ip.toString(), parseInt(port), '${camera.username}', '${camera.password}', 0);
|
||||
//登录后,默认四窗口显示。若需要自定义其他窗口数,可以调用g_ocx.SetWinBindedChannel
|
||||
g_ocx.SetWinBindedChannel(1, 0, 0, 0); //这样调用可以切换为单窗口模式,参数意义详见《二次开发使用 WEB32网页调用接口说明.doc》
|
||||
if (bRet == 0) {
|
||||
/* document.getElementById('LocalPlay').style.display = '';
|
||||
document.getElementById('Stop').style.display = '';
|
||||
document.getElementById('FullScreen').style.display = '';
|
||||
document.getElementById('Logout').style.display = '';
|
||||
document.getElementById('idQuery').style.display = '';
|
||||
document.getElementById('Play').style.display = '';
|
||||
document.getElementById('OpenIVS').style.display = '';
|
||||
document.getElementById('CloseIVS').style.display = '';
|
||||
document.getElementById('QueryFaceImageRecord').style.display = '';
|
||||
document.getElementById('QueryRecordInfoByTimeEx').style.display = '';
|
||||
document.getElementById('DownloadFaceImageRecord').style.display = '';
|
||||
document.getElementById('TransEvent').style.display = '';
|
||||
document.getElementById('control').style.display = ''; */
|
||||
//document.getElementById('SnapPicture').style.display = '';
|
||||
//document.getElementById('GetAllChannelInfo').style.display = '';
|
||||
|
||||
//登录成功后可以获取设备通道信息
|
||||
//GetAllChannelInfo();
|
||||
//QueryConnectState();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [GetAllChannelInfo 获取各通道名信息]
|
||||
*/
|
||||
function GetAllChannelInfo() {
|
||||
var data = g_ocx.GetAllChannelInfo();
|
||||
}
|
||||
/**
|
||||
* [QueryConnectState 查询对应通道的IPC是否在线]
|
||||
*/
|
||||
function QueryConnectState() {
|
||||
/*此协议字段说明:
|
||||
Protocol 表示和控件交互的协议名 目前控件支持的交互协议具体见文档,这里的QueryDevCfgInfo表示需要查询设备的配置信息
|
||||
Params 字段表示查询的配置参数:
|
||||
Command 表示向设备查询的配置名称 cameraConnectState 表示前端连接状态
|
||||
Channel 表示查询的通道号
|
||||
*/
|
||||
var strRet = g_ocx.ProtocolPluginWithWebCall('{"Protocol":"QueryDevCfgInfo", "Params":{"Command":"CameraConnectState","Channel":0}}');
|
||||
}
|
||||
|
||||
/**
|
||||
* [LogoutDevice 登出]
|
||||
*/
|
||||
function LogoutDevice() {
|
||||
g_ocx.LogoutDevice();
|
||||
document.getElementById('Login').style.display = '';
|
||||
document.getElementById('PlayBack').style.display = 'none';
|
||||
document.getElementById('LocalPlay').style.display = 'none';
|
||||
document.getElementById('Stop').style.display = 'none';
|
||||
document.getElementById('FullScreen').style.display = 'none';
|
||||
document.getElementById('Play').style.display = 'none';
|
||||
document.getElementById('OpenIVS').style.display = 'none';
|
||||
document.getElementById('CloseIVS').style.display = 'none';
|
||||
document.getElementById('Logout').style.display = 'none';
|
||||
document.getElementById('PlayRec').style.display = 'none';
|
||||
document.getElementById('PauseRec').style.display = 'none';
|
||||
document.getElementById('FastPlay').style.display = 'none';
|
||||
document.getElementById('SlowPlay').style.display = 'none';
|
||||
document.getElementById('ShowPlayTime').style.display = 'none';
|
||||
document.getElementById('TransEvent').style.display = 'none';
|
||||
document.getElementById('DwonLoadPos').style.display = 'none';
|
||||
document.getElementById('RecInfo').style.display = 'none';
|
||||
document.getElementById('SnapPicture').style.display = 'none';
|
||||
document.getElementById('GetAllChannelInfo').style.display = 'none';
|
||||
document.getElementById('idQuery').style.display = 'none';
|
||||
document.getElementById('QueryFaceImageRecord').style.display = 'none';
|
||||
document.getElementById('QueryRecordInfoByTimeEx').style.display = 'none';
|
||||
document.getElementById('DownloadFaceImageRecord').style.display = 'none';
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP3:实时监视///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function RealPlay() {
|
||||
//首先切换到监视模式
|
||||
// g_ocx.SetModuleMode(1); //监视模式
|
||||
//打开通道视频
|
||||
var channel = '${camera.channel}';
|
||||
g_ocx.ConnectRealVideo(parseInt(channel), 1);
|
||||
// control();
|
||||
}
|
||||
function control()
|
||||
{
|
||||
alert(1);
|
||||
|
||||
g_ocx.ControlPtzEx(nchid, 1, 1, 8, 1, 0);
|
||||
alter(2);
|
||||
|
||||
|
||||
}
|
||||
function StopPlay() { //关闭通道视频
|
||||
g_ocx.DisConnectRealVideo(0);
|
||||
}
|
||||
|
||||
function OpenIVS() {//打开智能
|
||||
g_ocx.SetIVSEnable(true);
|
||||
}
|
||||
|
||||
function CloseIVS() {//关闭智能
|
||||
g_ocx.SetIVSEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* [LocalPlay 播放电脑上保存的录像文件]
|
||||
*/
|
||||
function LocalPlay() {
|
||||
g_ocx.QuickOperation(0);
|
||||
}
|
||||
|
||||
function SnapPicture() {
|
||||
g_ocx.SnapPicEx(2, "c:\\test", "123.jpg");
|
||||
}
|
||||
|
||||
function FullScreen() {
|
||||
g_ocx.OnFullScreenClk();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP4:网络回放(直接播放设备上的录像)/////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* [QueryRecord 回放之前先按照这个步骤调用,并查询录像信息;]
|
||||
*/
|
||||
function QueryRecord() {
|
||||
var year = new Date().getFullYear();
|
||||
var month = new Date().getMonth() + 1;
|
||||
var date = new Date().getDate();
|
||||
|
||||
g_ocx.SetModuleMode(4); //回放模式
|
||||
// g_ocx.SetWinBindedChannel(4, 0, 0, 3);
|
||||
|
||||
var chnlArray = '{'+'"channels"'+ ':[0,2,3,4]}';
|
||||
//参数1:窗口分割数;参数2:窗口号; 参数3:通道号数组; 参数4:对应通道3解析的字符串
|
||||
g_ocx.SetWinBindedChannelEx(4, 0, chnlArray, 'channels');
|
||||
|
||||
g_ocx.SwitchMonth(year, month, date);
|
||||
g_ocx.SwitchDay(year, month, date);
|
||||
htmlStChn1 = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* [TransEvent 控件状态事件]
|
||||
* @param {[type]} jsonStr [状态事件信息字符串]
|
||||
*/
|
||||
function TransEvent(jsonStr) {
|
||||
//jsonStr格式:'{"EventName" : "xxx", "EventParam" : { ... }}'
|
||||
//控件内部的一些状态都会通过该回调上报给js,js根据jsonStr中不同的"EventName"字段判断具体事件
|
||||
//如:"EventName"=="QueryItemInfo"时,调用本例中QueryRecordInfoByTimeEx()会触发,表示录像查询时返回的总的录像记录条数信息
|
||||
// { "EventName" : "QueryItemInfo",
|
||||
// "EventParam" : {
|
||||
// "ItemTotal" : 220, //总的录像记录条数
|
||||
// "LastItem" : true } } //true时表示查询结束,false表示查询正在进行中
|
||||
// 录像信息比较多时,会分多次接收该事件,直到 "LastItem" 为true
|
||||
//
|
||||
//"EventName"=="NetPlayState"时,回放模式下切换选中窗口会触发,表示当前窗口的回放状态
|
||||
// {"EventName":"NetPlaySate",
|
||||
// "EventParam":{
|
||||
// "MultiScreeninfo":{"Enable":false,"ShowMode":0}, //4K分屏信息:Enable是否使能,ShowMode显示模式
|
||||
// "channel":2, //通道号
|
||||
// "direction":"normal", //回放方向:normal 正放;backwards倒放
|
||||
// "fisheyeinfo":{"Enable",0}, // 鱼眼信息:Enable是否使能
|
||||
// "isSwitchwin":true, //该值始终为true
|
||||
// "open":false, //是否正在回放
|
||||
// "speed":4, //回放速度
|
||||
// "state":"stop", //回放状况:play播放,pause暂停,stop关闭,speed快进,preFrame前帧,backFrame后帧,backwards倒放
|
||||
// "winID":0}} //当前窗口号
|
||||
//
|
||||
//"EventName"=="ReturnWindInfo"时,监视模式下切换选中窗口会触发,表示当前窗口的监视状态
|
||||
document.getElementById('trEvent').value = jsonStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* [InsertNetRecordFileInfo 接收新的录像信息:由于录像信息比较多,这里会分多次接收]
|
||||
* @param {[type]} nChannel [录像的通道号]
|
||||
* @param {[type]} nEnd [该通道是否查询完毕]
|
||||
* @param {[type]} strRecordInfo [录像信息字符串]
|
||||
*/
|
||||
function InsertNetRecordFileInfo(nChannel, nEnd, strRecordInfo) {
|
||||
//console.log('InsertNetRecordFileInfo')
|
||||
//strRecordInfo格式:2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00:2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00
|
||||
//2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00
|
||||
//录像时间-录像类型-文件大小-文件索引-码流类型-...
|
||||
var htmlRecordInfo = '';
|
||||
var recInfo = [];
|
||||
if (strRecordInfo != '') {
|
||||
recInfo = strRecordInfo.split(':');
|
||||
var num = recInfo.length;
|
||||
for (var i = 0; i < num; i++) {
|
||||
if (recInfo[i] == '') {
|
||||
continue;
|
||||
}
|
||||
htmlRecordInfo += '<li><a id="StChn' + (i) + '">' + 'channel: ' + nChannel + ' info: ' + recInfo[i] + '</a></li>';
|
||||
}
|
||||
|
||||
document.getElementById('RecInfo').style.display = '';
|
||||
document.getElementById('DwonLoadPos').style.display = '';
|
||||
document.getElementById('RecInfoList').innerHTML = htmlRecordInfo;
|
||||
saveRecordFileInfo(recInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [saveRecordFileInfo 保存并处理录像信息]
|
||||
* @param {[type]} recInfo [录像信息字符串]注:这里的字符串格式是收到的录像信息格式,与下载接口所需要的字符串格式不同。详见本函数中的说明
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function saveRecordFileInfo(recInfo) {
|
||||
var index = 0;
|
||||
for (var i = 0; i < recInfo.length; i++) {
|
||||
var tmpInfo = recInfo[i];
|
||||
if (tmpInfo == '') continue;
|
||||
var recArry = tmpInfo.split('-');
|
||||
//原始的文件结构信息(下载文件结构不同):
|
||||
//2014102216001120141022160011- 04 - 279 - 53 - 00 -01
|
||||
//2013041109102020130411100000-type1-size2-nIndex3-stream4-nRecChannel5-nDriveNo6-nStartCluster7
|
||||
//下载的时候需要传给控件的结构信息:
|
||||
//开始时间结束时间-type-channel-stream-文件大小2- 磁盘3-起始簇号4
|
||||
var infoAttach = recArry[0] + '-' + recArry[1] + '-' + recArry[5] + '-' + recArry[4] + (recArry[6] == undefined ? '' : '-' + recArry[2] + '-' + recArry[6] + '-' + recArry[7]);
|
||||
if (contains(recInfosByFile, infoAttach)) {
|
||||
continue;
|
||||
}
|
||||
recInfosByFile[index] = infoAttach;
|
||||
index++;
|
||||
}
|
||||
//console.log(recInfosByFile)
|
||||
}
|
||||
|
||||
//播放控制
|
||||
function PlayBack() {
|
||||
g_ocx.PlayBackByTime(0, '01:00:00');
|
||||
}
|
||||
function PlayRec() {
|
||||
g_ocx.PlayBack();
|
||||
}
|
||||
function PauseRec() {
|
||||
g_ocx.PausePlayBack();
|
||||
}
|
||||
function FastPlay() {
|
||||
if (g_curSpeed >= 8) { //达到最大速度以后再快放就回到正常速度,客户可以按照自己的意愿来处理此时是否灰显快放按钮
|
||||
g_curSpeed = 4;
|
||||
} else {
|
||||
g_curSpeed++;
|
||||
}
|
||||
ocx.SpeedPlayBack(g_curSpeed);
|
||||
}
|
||||
function SlowPlay() {
|
||||
if (g_curSpeed <= 0) { //达到最小速度以后再慢放就回到正常速度,客户可以按照自己的意愿来处理此时是否灰显快放按钮
|
||||
g_curSpeed = 4;
|
||||
} else {
|
||||
g_curSpeed--;
|
||||
}
|
||||
ocx.SpeedPlayBack(g_curSpeed);
|
||||
}
|
||||
|
||||
//可以得到当前的播放时间, 见g_ocx.AddEventListener('NetPlayTimeInform', ShowPlayTime);
|
||||
function ShowPlayTime(time) {
|
||||
//时间的格式00020018| |是通道分隔符
|
||||
var ar = time.split('|');
|
||||
if (ar[0] == "01010032")
|
||||
{
|
||||
ocx.StopPlayBack();
|
||||
}
|
||||
g_PlayTime = time;
|
||||
document.getElementById('playtime').value = g_PlayTime;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP5:录像下载(直接播放设备上的录像)/////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//查询:按时间查询
|
||||
function QueryRecordInfoByTimeEx() {
|
||||
recInfosByFile = [];
|
||||
//channel:通道号,-1表示查询所有通道
|
||||
//streamType查询码流类型,0主辅码流,1主码流,2辅码流
|
||||
//recType:
|
||||
//RECORD_QUERY = 0, //所有录像文件
|
||||
//ALARM_QUERY = 1, //外部报警
|
||||
//MOTION_QUERY = 2, //动态检测报警
|
||||
//CARD_SEARCH = 4, //卡号查询
|
||||
//CARD_COM_SEARCH = 5, //卡号查询(串口查询)
|
||||
//RECORD_POSITION = 6,
|
||||
//PICTURE_QUERY = 9, //图片查询
|
||||
//CARD_NET_SEARCH = 10, //卡号查询(网络查询)
|
||||
//AUDIO_FILE_SEARCH = 18 //音频文件查询(车载)
|
||||
//13=人脸图片, 14=人脸录像
|
||||
//maxNumber:每页返回的最大信息条数,接口调用后注册回调InsertNetRecordFileInfo会返回第一页数据;
|
||||
//调用ocx.QueryGroupRecordInfo(2)接口进行翻页(2:要切到的页码),InsertNetRecordFileInfo会返回第2页数据
|
||||
|
||||
//通过AddEventListener()注册的事件监听函数TransEvent(strValue)将总的页数信息传给调用者(["EventName"] = "QueryItemInfo")
|
||||
//通过AddEventListener()注册的事件监听函数InsertNetRecordFileInfo(nChannel, bEnd, str)将录像文件信息传给调用者,
|
||||
// 没有满足条件的录像则不触发该监听函数(可通过TransEvent: ["EventName"] = "QueryItemInfo"判断是否有录像)
|
||||
//TransEvent回调见 function TransEvent
|
||||
//InsertNetRecordFileInfo回调见 function InsertNetRecordFileInfo
|
||||
var queryInfo = '{"channel":-1, "streamType":0,"startTime":"2017-6-13 00:00:00","endTime":"2017-6-23 23:59:59","maxNumber":100,"recType":0}'
|
||||
var bRet = ocx.QueryRecordInfoByTimeEx(queryInfo);
|
||||
}
|
||||
function QueryFaceImageRecord() {
|
||||
recInfosByFile = [];
|
||||
// recType: 13=人脸图片, 14=人脸录像
|
||||
var queryInfo = '{"channel":0, "streamType":0,"startTime":"2015-1-10 00:00:00","endTime":"2016-1-15 23:59:59","maxNumber":100,"recType":13}'
|
||||
var bRet = ocx.QueryRecordInfoByTimeEx(queryInfo);
|
||||
}
|
||||
|
||||
//下载:按文件下载 和 按时间下载两种方式
|
||||
function DownloadRecordByFile() {
|
||||
// recInfosByFile
|
||||
if(recInfosByFile.length == 0) {
|
||||
alert('请先点击“QueryRecordInfoByTime”按钮查询录像。');
|
||||
return;
|
||||
}
|
||||
var params = '{"fileList":"' + recInfosByFile.join(':') + '"}';
|
||||
var bRet = ocx.DownloadRecordByFileEx(params, "c:\\test\\", "dav")
|
||||
}
|
||||
function DownloadByTime() {
|
||||
//支持JS自定义保存的录像文件名
|
||||
var str = '{"Protocol":"DownloadByTimeWithFileName","Params":{"ChannelID":1, "BeginTime":"2017-06-13 00:10:00", "EndTime":"2017-06-13 00:18:00", "Path":"C:\/\/RecordFile", "SaveName":"大华二次开发_DHFILE","Format":"dav"}}';
|
||||
g_ocx.ProtocolPluginWithWebCall(str);
|
||||
//按时间保存录像文件,不支持自定义文件名
|
||||
//g_ocx.DownloadRecordByTime(0, '2014-11-04 01:05:00', '2014-11-04 01:18:00', 'C:\\RecordDownload', 'dav');
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP6:公共接口///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function contains(arr, obj) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] == obj) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function Sleep(n) {
|
||||
var start = new Date().getTime();
|
||||
while (true) {
|
||||
if (new Date().getTime() - start > n) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ShowRecInfo(nCh, strRecodInfo) {
|
||||
document.getElementById('PlayBack').style.display = '';
|
||||
document.getElementById('PlayRec').style.display = '';
|
||||
document.getElementById('PauseRec').style.display = '';
|
||||
document.getElementById('FastPlay').style.display = '';
|
||||
document.getElementById('SlowPlay').style.display = '';
|
||||
document.getElementById('download').style.display = '';
|
||||
document.getElementById('RecInfo').style.display = '';
|
||||
document.getElementById('ShowPlayTime').style.display = '';
|
||||
document.getElementById('DwonLoadPos').style.display = '';
|
||||
g_PlayTime = "";
|
||||
var readtime = strRecodInfo.split(':');
|
||||
var num = readtime.length;
|
||||
for (var i = 0; i < num; i++) {
|
||||
if (readtime[i] == '')
|
||||
continue;
|
||||
htmlStChn1 += '<li><a id="StChn' + (i) + '">' + 'channel: ' + nCh + ' info: ' + readtime[i] + '</a></li>';
|
||||
}
|
||||
document.getElementById('RecInfoList').innerHTML = htmlStChn1;
|
||||
}
|
||||
</script>
|
||||
2095
WebRoot/jsp/work/scadapic/processView.jsp
Normal file
2095
WebRoot/jsp/work/scadapic/processView.jsp
Normal file
File diff suppressed because it is too large
Load Diff
849
WebRoot/jsp/work/scadapic/processdesign.jsp
Normal file
849
WebRoot/jsp/work/scadapic/processdesign.jsp
Normal file
@ -0,0 +1,849 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<% request.setAttribute("Flag_PS", ScadaPic_Txt.Flag_PS);%>
|
||||
|
||||
|
||||
<%request.setAttribute("Status_Fault",EquipmentCard.Status_Fault);%>
|
||||
<%request.setAttribute("Status_OFF",EquipmentCard.Status_OFF);%>
|
||||
<%request.setAttribute("Status_ON",EquipmentCard.Status_ON);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//删除文本
|
||||
function deletetxt(obj){
|
||||
var selectid = obj.parentNode.id;
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
showAlert('s','删除成功','mainAlertdiv');
|
||||
$('#'+selectid).remove();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
//删除工艺段
|
||||
function deleteps(obj){
|
||||
var selectid = obj.parentNode.parentNode.id;
|
||||
$.post(ext.contextPath + "/work/scadaPic/deletePS.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
showAlert('s','删除成功','mainAlertdiv');
|
||||
$('#'+selectid).remove();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
stopBubbleDefaultEvent();//阻止触发父元素点击事件
|
||||
}
|
||||
|
||||
//删除测量点
|
||||
//删除设备
|
||||
function deleteem(obj){
|
||||
var selectid = obj.parentNode.id;
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
showAlert('s','删除成功','mainAlertdiv');
|
||||
$('#'+selectid).remove();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
//删除测量点
|
||||
function deletemp(obj){
|
||||
var selectid = obj.parentNode.id;
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
showAlert('s','删除成功','mainAlertdiv');
|
||||
$('#'+selectid).remove();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var contentdiv=$("#content");
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("bootstrap-draggable")>=0){
|
||||
console.info(contentdiv.width());
|
||||
/* $.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), 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,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
//top.$.messager.alert('提示','更新失败','info');
|
||||
showAlert('d','更新失败','mainAlertdiv');
|
||||
}
|
||||
},'json'); */
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:contentdiv.width(),containerHeight:contentdiv.height(),
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
//top.$.messager.alert('提示','更新失败','info');
|
||||
showAlert('d','保存失败','mainAlertdiv');
|
||||
}else{
|
||||
showAlert('s','保存成功','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
var processSectionId = "";
|
||||
var addmp = function() {
|
||||
var companyId =unitId;
|
||||
var width= $("#content").width();
|
||||
var height= $("#content").height();
|
||||
var workshopid = processSectionId;
|
||||
$.post(ext.contextPath + '/work/scadaPic/addMPoint.do', {containerwidth:width,containerheight:height,pid:workshopid} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
|
||||
});
|
||||
};
|
||||
var addequ = function() {
|
||||
var width= $("#content").width();
|
||||
var height= $("#content").height();
|
||||
var workshopid = processSectionId;
|
||||
var companyId =unitId;
|
||||
$.post(ext.contextPath + '/work/scadaPic/addEM.do', {containerwidth:width,containerheight:height,pid:workshopid,companyId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
|
||||
});
|
||||
};
|
||||
var addps = function() {
|
||||
var width= $("#content").width();
|
||||
var height= $("#content").height();
|
||||
var workshopid = processSectionId;
|
||||
var companyId =unitId;
|
||||
//alert(companyId);
|
||||
$.post(ext.contextPath + '/work/scadaPic/addPS.do', {containerwidth:width,containerheight:height,pid:workshopid,companyId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
});
|
||||
};
|
||||
var editps = function(obj) {
|
||||
var width= $("#content").width();
|
||||
var height= $("#content").height();
|
||||
var workshopid = processSectionId;
|
||||
var companyId =unitId;
|
||||
//alert(companyId);
|
||||
$.post(ext.contextPath + '/work/scadaPic/editPS.do', {id:obj,containerwidth:width,containerheight:height,pid:workshopid,companyId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
});
|
||||
};
|
||||
function addtext(){
|
||||
var width= $("#content").width();
|
||||
var height= $("#content").height();
|
||||
|
||||
var workshopid = processSectionId;
|
||||
var companyId =unitId;
|
||||
$.post(ext.contextPath + '/work/scadaPic/addTxt.do', {containerwidth:width,containerheight:height,pid:workshopid,companyId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
});
|
||||
}
|
||||
var contentdiv=$("#content");
|
||||
var companyId= '';
|
||||
$(function() {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#companyId").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#company").text("公司: " + data[0].text);
|
||||
companyId = data[0].id;
|
||||
refreshSelect();
|
||||
//initFun();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#companyId").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
companyId = data[0].id;
|
||||
refreshSelect();
|
||||
//initFun();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#companyId").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
companyId= data.id;
|
||||
refreshSelect();
|
||||
//initFun();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
//window.onresize = changesize;
|
||||
/* $.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
console.log("data:"+data.length);
|
||||
var companyId= '';
|
||||
if(data.length == 1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
$("#search_code").css("display", "none");
|
||||
$("#company").text(data[0].text);
|
||||
companyId=data[0].id;
|
||||
$("#companyId").val(companyId);
|
||||
$.post(ext.contextPath + "/work/scadaPic/getlist4Combo.do", {companyId:unitId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
|
||||
processSectionId="";
|
||||
//dosearch();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
|
||||
},'json');
|
||||
}else{
|
||||
$("#company").css("display", "none");
|
||||
var selelct=$("#search_code").select2({
|
||||
data : data ,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct.val('').trigger("change");
|
||||
refreshSelect();
|
||||
selelct.on("change",function(e){
|
||||
companyId= $(this).val();
|
||||
$("#companyId").val(companyId);
|
||||
refreshSelect();
|
||||
$.post(ext.contextPath + "/work/scadaPic/getlist4Combo.do", {companyId:unitId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
processSectionId="";
|
||||
dosearch();
|
||||
//alert(processSectionId);
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
*/
|
||||
|
||||
});
|
||||
var refreshSelect = function() {
|
||||
/* var selelct_ =$("#processSection").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
$("#processSection").empty();
|
||||
// $("#table").bootstrapTable('refresh', {data:null});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) */
|
||||
$.post(ext.contextPath + "/work/scadaPic/getlist4Combo.do", {companyId:unitId}, function(data) {
|
||||
processSectionId="";
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
};
|
||||
function dosearch(){
|
||||
/* companyId = $("#search_code").select2().val();
|
||||
alert(companyId) */
|
||||
companyId = unitId;
|
||||
var contentdiv=$("#content");
|
||||
$.post(ext.contextPath + "/work/scadaPic/getlist4Combo.do", {companyId:unitId}, function(data) {
|
||||
processSectionId = $("#processSection option:checked").val();
|
||||
var res= JSON.parse(data);
|
||||
//console.info(processSectionId);
|
||||
//console.info(res.length);
|
||||
if(res.length==0){
|
||||
processSectionId='';
|
||||
$("#img").attr("src","");
|
||||
showMPoint();
|
||||
showEM();
|
||||
showPS();
|
||||
showTxt();
|
||||
}else{
|
||||
for (var i=0;i< res.length;i++) {
|
||||
//processSectionId = res[i].id;
|
||||
if (res[i].id == processSectionId) {
|
||||
$("#img").attr("src",ext.serverPath + res[i].picpath);
|
||||
showMPoint();
|
||||
showEM();
|
||||
showPS();
|
||||
showTxt();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function showPS(){
|
||||
var workshopid = processSectionId;
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getPSList.do", {companyId:unitId,pid:workshopid}, function(data) {
|
||||
|
||||
clearItem("${Flag_PS}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
// console.log(item);
|
||||
containerWidth = $("#content").width();
|
||||
containerHeight = $("#content").height();
|
||||
|
||||
var picurl = ext.contextPath+item.picurl;
|
||||
var value='';
|
||||
//console.info('222'+item.processSectionName);
|
||||
if(item.processSection!=null){
|
||||
value=item.processSection.name;
|
||||
}
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div contentEditable="true" class="bootstrap-draggable " style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_PS}" processSectionId='+item.processSectionid+'>'+
|
||||
// '<span style="font-weight:bold">'+value+'</span>'+
|
||||
//'<img src="'+picurl+'" width="100%"></img>'+
|
||||
'<div style="float:left;width:100%;height:15px;"><a type="button" onclick="deleteps(this)" title="删除"><i class="fa fa-close"></i></a></div>'+
|
||||
'<div style="float:left;width:100%;height:15px;color:yellow;"><span >'+item.processSection.name+'</span></div>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
$("#content").append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).draggable();
|
||||
|
||||
//$('#'+item.id).resizable({ alsoResize: '.other' });
|
||||
$('#'+item.id).click(function(){
|
||||
//alert(this.id);
|
||||
editps(this.id);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEM(){
|
||||
var workshopid = processSectionId;
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data);
|
||||
clearItem("${Flag_EM}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = $("#content").width();
|
||||
containerHeight = $("#content").height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div contentEditable="true" class="bootstrap-draggable bootstrap-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}" equipid='+item.equipid+'>'+
|
||||
'<span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
''+
|
||||
'</span>'+
|
||||
'<a type="button" onclick="deleteem(this)" title="删除"><i class="fa fa-close"></i></a>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
$("#content").append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).resizable();
|
||||
$('#'+item.id).draggable();
|
||||
|
||||
//$('#'+item.id).resizable({ alsoResize: '.other' });
|
||||
/* $('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEMInfo(str){
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardInfo.do", {id:str}, function(data) {
|
||||
//console.info(data)
|
||||
var sons;
|
||||
if (data !=null) {
|
||||
sons= '<div id ="equipInfo" style="border:1px solid yellow;background-color:black;position:absolute;width: 180px;height:200px;top:0px;left:0px">'+
|
||||
'<table id="info" style="font-size:12px" >'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">设备名称:'+data.equipmentname+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">状态:'+getEquStatus(data.equipmentstatus)+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">排产情况:</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">'+
|
||||
getInfoFromArrangement(data.equipmentArrangements)+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'<div id ="arrangeInfo" >'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
//console.info(sons)
|
||||
//if(!$("#equipInfo")){
|
||||
$("#equipInfo").remove();
|
||||
//}
|
||||
contentdiv.append(sons);
|
||||
//showArrangeGrid(data.id,"2017-10-13");
|
||||
},'json');
|
||||
|
||||
};
|
||||
function getEquStatus(statuscode){
|
||||
switch(statuscode){
|
||||
case '${Status_Fault}':
|
||||
return '故障';
|
||||
break;
|
||||
case '${Status_OFF}':
|
||||
return '停机';
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
return '运行中';
|
||||
break;
|
||||
}
|
||||
}
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
var workorderno="";
|
||||
$.each(arrangement, function(index, item){
|
||||
//console.log(item);
|
||||
if(str !=""){
|
||||
str+="<br />";
|
||||
}
|
||||
if(workorderno!=item._workorderno){
|
||||
workorderno=item._workorderno;
|
||||
str=str+"工单:"+workorderno+"<br />";
|
||||
}
|
||||
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = processSectionId;
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
clearItem("${Flag_Txt}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = $("#content").width();
|
||||
containerHeight = $("#content").height();
|
||||
console.log("宽:"+containerWidth)
|
||||
console.log("高:"+containerHeight)
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div contentEditable="true" class="bootstrap-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_Txt}">'+
|
||||
'<span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span>'+
|
||||
'<a type="button" onclick="deletetxt(this)" title="删除"><i class="fa fa-close"></i></a>'+
|
||||
'</div>';
|
||||
var contentdiv=$("#content");
|
||||
console.info(contentdiv);
|
||||
console.info("-----------------------");
|
||||
console.info(contentdiv.html());
|
||||
console.info("111111111111111111");
|
||||
console.info("showTxt:"+son);
|
||||
|
||||
//document.getElementById("content").appendChild(son);
|
||||
$("#content").append(son);
|
||||
console.info(contentdiv.html());
|
||||
$('#'+item.id).draggable();
|
||||
|
||||
//$('#'+item.id).resizable({ alsoResize: '.other' });
|
||||
/* $('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = processSectionId;
|
||||
var companyId =unitId;
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {companyId:unitId,pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = $("#content").width();
|
||||
containerHeight = $("#content").height();
|
||||
//console.log((containerWidth))
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son="";
|
||||
//console.log((item.mPoint))
|
||||
if(item.expressionflag!=null && item.expressionflag &&item.expressionflag!=""){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div contentEditable="true" class="bootstrap-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'<a type="button" onclick="deletemp(this)" title="删除"><i class="fa fa-close"></i></a>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div contentEditable="true" class="bootstrap-draggable" style="cursor:pointer;background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span><span style="color:#00ff00;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span>'+
|
||||
'<a type="button" onclick="deletemp(this)" title="删除"><i class="fa fa-close"></i></a>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son);
|
||||
$("#content").append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("bootstrap-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
alert();
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = $("#content").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.indexOf("bootstrap-draggable")>=0){
|
||||
|
||||
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的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("bootstrap-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()"
|
||||
class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i
|
||||
class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="expSubDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="psSubDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addps();"><i class="fa fa-plus"></i> 工艺段</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addmp();"><i class="fa fa-plus"></i> 测量点</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addequ();"><i class="fa fa-plus"></i> 设备</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addtext();"><i class="fa fa-plus"></i> 文本</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="setdata();"><i class="fa fa-save"></i> 保存布局</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group form-inline">
|
||||
<!-- <div class="form-group form-inline">
|
||||
<div class="form-group ">
|
||||
<input id="companyId" name="companyId" type="hidden" />
|
||||
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<ul id="companyselect" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
Menu toggle button
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div>/input-group
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group form-inline" style="padding:0;"></div> -->
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group pull-right" style="margin-top:8px;">
|
||||
<label class="form-label">底图</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-xs-12" style="text-align: center;padding:0px" id="content">
|
||||
|
||||
<img alt="" src="" width="100%" id="img">
|
||||
|
||||
</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>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
</html>
|
||||
171
WebRoot/jsp/work/scadapic/prodManagement.jsp
Normal file
171
WebRoot/jsp/work/scadapic/prodManagement.jsp
Normal file
@ -0,0 +1,171 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ 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">
|
||||
var grid;
|
||||
var contentdiv=$("#contentDiv");
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
$(function() {
|
||||
$("#taskordercode").textbox('textbox').bind("click", function () {
|
||||
selectTaskOrder();
|
||||
});
|
||||
showButtons();
|
||||
});
|
||||
var showButtons = function() {
|
||||
$.post(ext.contextPath + "/work/scadaPic/getProdManagementViews4Combo.do", {}, function(data) {
|
||||
|
||||
if (data.length>0) {
|
||||
var widthtimes= 100/data.length-1;
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var a = document.createElement("a");
|
||||
a.href='javascript:void(0);';
|
||||
a.id=data[i].id;
|
||||
var cd =document.getElementById('contentDiv');
|
||||
//console.info(son)
|
||||
cd.appendChild(a);
|
||||
|
||||
$('#'+data[i].id).linkbutton({
|
||||
iconCls: 'icon-add',
|
||||
text:data[i].name,
|
||||
plain:true
|
||||
});
|
||||
/* $('#'+data[i].id).css('margin-left','50px');
|
||||
$('#'+data[i].id).css('margin-right','50px'); */
|
||||
$('#'+data[i].id).css('float','left');
|
||||
$('#'+data[i].id).css('width',widthtimes+'%');
|
||||
|
||||
$('#'+data[i].id).bind('click', function(){
|
||||
showView(this.id);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
var showView = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '可视化',
|
||||
width: 1000,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/showProdManagementItem_PIC.do?id='+id,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var showdetailsFun = function() {
|
||||
var taskOrderId =$("#taskorderid").val();
|
||||
var processId = $("#processId").combobox('getValue');
|
||||
$("#iframeStock").attr("src",ext.contextPath+"/work/scadaPic/showProdManagementItem.do?taskorderid="+taskOrderId+"&processid="+processId+"&type=xbk");
|
||||
$("#iframeSuspended").attr("src",ext.contextPath+"/work/scadaPic/showProdManagementItem.do?taskorderid="+taskOrderId+"&processid="+processId+"&type=kl");
|
||||
};
|
||||
function selectTaskOrder(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择任务单',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/taskorder/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
|
||||
if(res!=null){
|
||||
$("#taskordercode").textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
||||
$("#taskorderid").val(res.id);
|
||||
$("#processId").combobox({
|
||||
url : ext.contextPath + '/plan/dailyplan/getProcessIds4ComboByTaskOrderId.do?taskOrderId='+res.id,
|
||||
valueField : 'processid',
|
||||
textField : 'processid',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#processId").combobox('getData').length>0){
|
||||
$("#processId").combobox('select',$("#processId").combobox('getData')[0].processid);
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
showdetailsFun();
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;heigh:500px;" data-options="region:'north'" >
|
||||
<table style="width:100%">
|
||||
<caption style="padding:10px 10px;font-size:20px;align:center;">制品管理</caption>
|
||||
</table>
|
||||
<table >
|
||||
<tr style="align:center;">
|
||||
<td style="width:60px;align:center;">任务单号</td>
|
||||
<td><input id="taskordercode" name="taskordercode" class="easyui-textbox" style="width: 250px;" data-options="validType:'isBlank',prompt:'单击选择'" value=""/>
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="" /></td>
|
||||
|
||||
<th style="width:60px;">流程ID</th>
|
||||
<td >
|
||||
<input id="processId" name="processId" class="easyui-combobox" editable="false" style="width:250px" data-options="required:true,validType:'isBlank'"/>
|
||||
</td>
|
||||
<td >
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="showdetailsFun();">搜索</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center',border:false">
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true,border:false">
|
||||
|
||||
<div title="线边库存">
|
||||
<iframe id="iframeStock" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="品质扣料">
|
||||
<iframe id="iframeSuspended" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="contentDiv" style="height:30px;" data-options="region:'south'">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
510
WebRoot/jsp/work/scadapic/prodManagementDesign.jsp
Normal file
510
WebRoot/jsp/work/scadapic/prodManagementDesign.jsp
Normal file
@ -0,0 +1,510 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ 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();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), 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,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 addPic(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var workshopname = $("#workshopid").combobox('getText');
|
||||
//alert(workshopid+workshopname)
|
||||
if(workshopid==null || workshopid==""){
|
||||
parent.$.messager.alert('提示','请先选择工序','info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加底图',
|
||||
url : ext.contextPath + '/work/scadaPic/showProdManagementDesign_Pic.do?pid='+workshopid+'&pname='+workshopname,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog("destroy");
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
</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 width="80">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addmp();" >测量点</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addequ();">设备</a>
|
||||
</td>
|
||||
<!-- <td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addtext();">文本</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addPic();">底图</a>
|
||||
</td>
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setdata();">保存布局</a>
|
||||
|
||||
</td>
|
||||
<%-- <c:if test="${cu.empid!='emp01'}">
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="returndata();">恢复布局</a>
|
||||
</td>
|
||||
</c:if> --%>
|
||||
<!-- <td width="120">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setpicdata();">设为默认图</a>
|
||||
</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>
|
||||
<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>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" 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/scadaPic/getProdManagementViews4Combo.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) {
|
||||
if(dates[i].commonFile!=null ){
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
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.indexOf("easyui-draggable")>=0){
|
||||
|
||||
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的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//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) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//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+'" type="${Flag_Txt}">'+
|
||||
'<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;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
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="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
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 w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.equipmentCard.equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
$('#'+item.id).resizable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.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>
|
||||
54
WebRoot/jsp/work/scadapic/prodManagementDesign_Pic.jsp
Normal file
54
WebRoot/jsp/work/scadapic/prodManagementDesign_Pic.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
/* function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/workshop/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
} */
|
||||
|
||||
$(function() {
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${param.pid}').loadfile();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${param.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工序名称</th>
|
||||
<td colspan="3"><span >${param.pname }</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${param.pid}').showUpload();">监测图片上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
69
WebRoot/jsp/work/scadapic/prodManagementViewItem.jsp
Normal file
69
WebRoot/jsp/work/scadapic/prodManagementViewItem.jsp
Normal file
@ -0,0 +1,69 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow_xml.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
|
||||
|
||||
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
var viewFun = function(ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace('${param.type}',ppid);
|
||||
};
|
||||
$(function() {
|
||||
viewFun('${param.processid}');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="border:false" style="overflow-x:scroll;">
|
||||
<!-- <div data-options="region:'west'" style="width:250px;" >
|
||||
<table data-options="fit:true,border:false" style="margin:auto">
|
||||
<caption style="padding:10px 10px;font-size:16dp;">换架</caption>
|
||||
<tr >
|
||||
<td>RFID编码</td>
|
||||
<td style="text-align:center">
|
||||
<input id="shiftno" name="shiftno" class="easyui-textbox" style="width:170px" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>玻璃片数</td>
|
||||
<td>
|
||||
<input id="amount" name="amount" class="easyui-textbox" style="width:170px" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:middle; text-align:center;">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="saveRecord();">保存</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
548
WebRoot/jsp/work/scadapic/prodManagementViewPIC.jsp
Normal file
548
WebRoot/jsp/work/scadapic/prodManagementViewPIC.jsp
Normal file
@ -0,0 +1,548 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ 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();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), 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,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" 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/scadaPic/getProdManagementViews4Combo.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) {
|
||||
if(dates[i].commonFile!=null ){
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onLoadSuccess: function () {
|
||||
$("#workshopid").combobox('select','${param.id}');
|
||||
}
|
||||
|
||||
});
|
||||
//开启定时器刷新
|
||||
startClock();
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
function startClock(){
|
||||
myrefresh();
|
||||
setTimeout('startClock()',5000);
|
||||
}
|
||||
|
||||
function myrefresh()
|
||||
{
|
||||
//contentdiv.empty();
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
|
||||
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.indexOf("easyui-draggable")>=0){
|
||||
|
||||
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的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//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) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//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+'" type="${Flag_Txt}">'+
|
||||
'<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;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
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="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid,type:'${param.id}'}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
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 w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}" equipid='+item.equipid+'>'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
''+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEMInfo(str){
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardInfo.do", {id:str}, function(data) {
|
||||
//console.info(data)
|
||||
var sons;
|
||||
if (data !=null) {
|
||||
sons= '<div id ="equipInfo" style="border:1px solid yellow;position:absolute;width: 180px;height:200px;top:0px;left:0px">'+
|
||||
'<table id="info" style="font-size:12px" >'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">设备名称:</span></td>'+
|
||||
'<td ><span style="color:white;">'+
|
||||
data.equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">状态:</span></td>'+
|
||||
'<td ><span style="color:white;">'+
|
||||
data.currentmanageflag+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">排产情况:</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">'+
|
||||
getInfoFromArrangement(data.equipmentArrangements)+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'<div id ="arrangeInfo" >'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
//console.info(sons)
|
||||
//if(!$("#equipInfo")){
|
||||
$("#equipInfo").remove();
|
||||
//}
|
||||
contentdiv.append(sons);
|
||||
//showArrangeGrid(data.id,"2017-10-13");
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
var workorderno="";
|
||||
$.each(arrangement, function(index, item){
|
||||
//console.log(item);
|
||||
if(str !=""){
|
||||
str+="<br />";
|
||||
}
|
||||
if(workorderno!=item._workorderno){
|
||||
workorderno=item._workorderno;
|
||||
str=str+"工单编号:"+workorderno+"<br />";
|
||||
}
|
||||
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
469
WebRoot/jsp/work/scadapic/scadaPicAdd.jsp
Normal file
469
WebRoot/jsp/work/scadapic/scadaPicAdd.jsp
Normal file
@ -0,0 +1,469 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@page import="com.sipai.entity.work.ScadaPic"%>
|
||||
<% request.setAttribute("Type_scadapic_detail", ScadaPic.Type_scadapic_detail);%>
|
||||
<% request.setAttribute("Type_scadapic_brief", ScadaPic.Type_scadapic_brief);%>
|
||||
<% request.setAttribute("Type_scadapic_ps", ScadaPic.Type_scadapic_ps);%>
|
||||
<% request.setAttribute("Type_scadapic_detail_name", ScadaPic.Type_scadapic_detail_name);%>
|
||||
<% request.setAttribute("Type_scadapic_brief_name", ScadaPic.Type_scadapic_brief_name);%>
|
||||
<% request.setAttribute("Type_scadapic_ps_name", ScadaPic.Type_scadapic_ps_name);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var masterId=$('#id').val();
|
||||
var tbName='TB_SCADAPIC_FILE'; //数据表
|
||||
var nameSpace='ScadaPicFile';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showDownload:true,
|
||||
showRemove:false,
|
||||
showCaption: true,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
allowedFileExtensions : ['jpg', 'png'],//接收的文件后缀
|
||||
previewFileType:['image'],
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
otherActionButtons:'<a type="button" onclick="downloadfile(this)" class="kv-file-down btn btn-sm btn-default" {dataKey} title="下载附件"><i class="fa fa-cloud-download"></i></a>',
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDownload:''
|
||||
},
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 "></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
function downloadfile(obj){
|
||||
var key = $(obj).data('key');
|
||||
window.open(ext.contextPath + '/base/downloadFile.do?key='+key+'&tbName='+tbName);
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#scadapicfile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("scadapicfile");
|
||||
}else{
|
||||
$('#scadapicfile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
getFileList();
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
grade: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '重要等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化底图类型选择框
|
||||
var refreshTypeSelect = function() {
|
||||
var select = $("#type").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('').trigger("change");
|
||||
select.on("change",function(e){
|
||||
var text = $("#type").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
if($(this).val()=='${Type_scadapic_ps}'){
|
||||
//alert();
|
||||
$("#psdiv").show();
|
||||
|
||||
}else{
|
||||
$("#processsectionid").val('');
|
||||
$("#psdiv").hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
//初始化工艺段选择框
|
||||
var refreshSelect = function() {
|
||||
/* var selelct_ = $("#processsectionid").select2({
|
||||
data: null,
|
||||
placeholder:'请先选择厂区',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
}); */
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
};
|
||||
|
||||
$(function(){
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
$("#bizid").hide();
|
||||
$("#input_bizid").text(data[0].text);
|
||||
//companyId = data[0].id;
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
//companyId = data[0].id;
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#hidden_bizid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
//companyId= data.id;
|
||||
//$("#hidden_bizid").val(data.id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
/* //选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
var companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
if(data!=null && data.length>0){
|
||||
selelct_.val(data[0].id).trigger("change");
|
||||
}
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect();
|
||||
var selelct =$("#bizid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
var companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json'); */
|
||||
refreshTypeSelect();
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加底图</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" class="form-control" id ="id" name ="id" value="${id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*公司</label>
|
||||
<div class="col-sm-7">
|
||||
<!-- <select class="form-control select2" id="bizid" name ="bizid" style="width: 270px;">
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid"> -->
|
||||
|
||||
<input id="hidden_bizid" name="bizid" type="hidden" />
|
||||
<span id="input_bizid" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
<ul id="bizid" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*类型</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="type" name ="type" style="width: 270px;">
|
||||
<option value="${Type_scadapic_detail}" >${Type_scadapic_detail_name}</option>
|
||||
<option value="${Type_scadapic_brief}" >${Type_scadapic_brief_name}</option>
|
||||
<option value="${Type_scadapic_ps}" >${Type_scadapic_ps_name}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="psdiv">
|
||||
<label class="col-sm-3 control-label">*工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="processsectionid" name ="processsectionid" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="text" name ="text" placeholder="标题" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<!-- <input id="f_upload" type="file" class="file" /> -->
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传附件</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="scadapicfile" id="scadapicfile" multiple class="file-loading" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
462
WebRoot/jsp/work/scadapic/scadaPicEdit.jsp
Normal file
462
WebRoot/jsp/work/scadapic/scadaPicEdit.jsp
Normal file
@ -0,0 +1,462 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@page import="com.sipai.entity.work.ScadaPic"%>
|
||||
<% request.setAttribute("Type_scadapic_detail", ScadaPic.Type_scadapic_detail);%>
|
||||
<% request.setAttribute("Type_scadapic_brief", ScadaPic.Type_scadapic_brief);%>
|
||||
<% request.setAttribute("Type_scadapic_ps", ScadaPic.Type_scadapic_ps);%>
|
||||
<% request.setAttribute("Type_scadapic_detail_name", ScadaPic.Type_scadapic_detail_name);%>
|
||||
<% request.setAttribute("Type_scadapic_brief_name", ScadaPic.Type_scadapic_brief_name);%>
|
||||
<% request.setAttribute("Type_scadapic_ps_name", ScadaPic.Type_scadapic_ps_name);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var masterId=$('#id').val();
|
||||
var tbName='TB_SCADAPIC_FILE'; //数据表
|
||||
var nameSpace='ScadaPicFile';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showDownload:true,
|
||||
showRemove:false,
|
||||
showCaption: true,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
allowedFileExtensions : ['jpg', 'png'],//接收的文件后缀
|
||||
previewFileType:['image'],
|
||||
otherActionButtons:'<a type="button" onclick="downloadfile(this)" class="kv-file-down btn btn-sm btn-default" {dataKey} title="下载附件"><i class="fa fa-cloud-download"></i></a>',
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDownload:''
|
||||
},
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 "></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
function downloadfile(obj){
|
||||
var key = $(obj).data('key');
|
||||
window.open(ext.contextPath + '/base/downloadFile.do?key='+key+'&tbName='+tbName);
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#scadapicfile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("scadapicfile");
|
||||
}else{
|
||||
$('#scadapicfile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
getFileList();
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
grade: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '重要等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化底图类型选择框
|
||||
var refreshTypeSelect = function() {
|
||||
var select = $("#type").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${ScadaPic.type}').trigger("change");
|
||||
select.on("change",function(e){
|
||||
var text = $("#type").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
if($(this).val()=='${Type_scadapic_ps}'){
|
||||
//alert();
|
||||
$("#psdiv").show();
|
||||
|
||||
}else{
|
||||
$("#processsectionid").val('');
|
||||
$("#psdiv").hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
//初始化工艺段
|
||||
var refreshSelect = function(companyId) {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
|
||||
};
|
||||
|
||||
$(function(){
|
||||
refreshTypeSelect();
|
||||
if($("#type").val()=='${Type_scadapic_ps}'){
|
||||
//alert();
|
||||
$("#psdiv").show();
|
||||
|
||||
}else{
|
||||
$("#processsectionid").val('');
|
||||
$("#psdiv").hide();
|
||||
}
|
||||
/* //选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
var companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect('${ScadaPic.bizid}');
|
||||
var selelct =$("#bizid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${ScadaPic.bizid}').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
var companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json'); */
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
$("#bizid").hide();
|
||||
$("#input_bizid").text(data[0].text);
|
||||
//companyId = data[0].id;
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#hidden_bizid").val('${ScadaPic.bizid}');
|
||||
$("#cname_input").val('${companyName}');
|
||||
//companyId = data[0].id;
|
||||
//$("#hidden_bizid").val(data[0].id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#hidden_bizid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
//companyId= data.id;
|
||||
//$("#hidden_bizid").val(data.id);
|
||||
//initFun();
|
||||
refreshSelect();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑底图</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" class="form-control" id ="id" name ="id" value="${ScadaPic.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*公司</label>
|
||||
<div class="col-sm-7">
|
||||
<!-- <select class="form-control select2" id="bizid" name ="bizid" style="width: 270px;">
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid"> -->
|
||||
|
||||
<input id="hidden_bizid" name="bizid" type="hidden" />
|
||||
<span id="input_bizid" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
<ul id="bizid" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*类型</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="type" name ="type" style="width: 270px;">
|
||||
<option value="${Type_scadapic_detail}" >${Type_scadapic_detail_name}</option>
|
||||
<option value="${Type_scadapic_brief}" >${Type_scadapic_brief_name}</option>
|
||||
<option value="${Type_scadapic_ps}" >${Type_scadapic_ps_name}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="psdiv">
|
||||
<label class="col-sm-3 control-label">*工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="processsectionid" name ="processsectionid" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="text" name ="text" placeholder="标题" value="${ScadaPic.text}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<!-- <input id="f_upload" type="file" class="file" /> -->
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传附件</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="scadapicfile" id="scadapicfile" multiple class="file-loading" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
484
WebRoot/jsp/work/scadapic/scadaPicList.jsp
Normal file
484
WebRoot/jsp/work/scadapic/scadaPicList.jsp
Normal file
@ -0,0 +1,484 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.work.ScadaPic"%>
|
||||
<% request.setAttribute("Type_scadapic_detail", ScadaPic.Type_scadapic_detail);%>
|
||||
<% request.setAttribute("Type_scadapic_brief", ScadaPic.Type_scadapic_brief);%>
|
||||
<% request.setAttribute("Type_scadapic_ps", ScadaPic.Type_scadapic_ps);%>
|
||||
<% request.setAttribute("Type_scadapic_detail_name", ScadaPic.Type_scadapic_detail_name);%>
|
||||
<% request.setAttribute("Type_scadapic_brief_name", ScadaPic.Type_scadapic_brief_name);%>
|
||||
<% request.setAttribute("Type_scadapic_ps_name", ScadaPic.Type_scadapic_ps_name);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showMaintenanceList = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subMaintenanceModal');
|
||||
});
|
||||
};
|
||||
var showHandleDetailList = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
|
||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
|
||||
$("#subEquipmentDiv").html(data);
|
||||
openModal('subEquipmentModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/work/scadaPic/add.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/work/scadaPic/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/work/scadaPic/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
initFun();
|
||||
};
|
||||
var refreshSelect = function() {
|
||||
/* var selelct_ =$("#processSection").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
$("#processSection").empty();
|
||||
// $("#table").bootstrapTable('refresh', {data:null});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) */
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", { companyId: companyId }, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}, 'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/scadaPic/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
}
|
||||
},
|
||||
sortName: 'type', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'bizid', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processectionname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value){
|
||||
if(value ==''){
|
||||
return '-';
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'text', // 返回json数据中的name
|
||||
title: '标题', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value){
|
||||
if(value=='${Type_scadapic_detail}'){
|
||||
return '${Type_scadapic_detail_name}'
|
||||
}else if(value=='${Type_scadapic_brief}'){
|
||||
return '${Type_scadapic_brief_name}'
|
||||
}else if(value=='${Type_scadapic_ps}'){
|
||||
return '${Type_scadapic_ps_name}'
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'picpath', // 返回json数据中的name
|
||||
title: '图片路径', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
buts+= '<security:authorize buttonUrl="work/scadaPic/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="work/scadaPic/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div >
|
||||
<div id="companySelectTree">
|
||||
|
||||
</div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group form-inline">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/scadaPic/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="标题">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script> --%>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
</script>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
</html>
|
||||
385
WebRoot/jsp/work/scadapic/scadaPicView.jsp
Normal file
385
WebRoot/jsp/work/scadapic/scadaPicView.jsp
Normal file
@ -0,0 +1,385 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@page import="com.sipai.entity.work.ScadaPic"%>
|
||||
<% request.setAttribute("Type_scadapic_detail", ScadaPic.Type_scadapic_detail);%>
|
||||
<% request.setAttribute("Type_scadapic_brief", ScadaPic.Type_scadapic_brief);%>
|
||||
<% request.setAttribute("Type_scadapic_ps", ScadaPic.Type_scadapic_ps);%>
|
||||
<% request.setAttribute("Type_scadapic_detail_name", ScadaPic.Type_scadapic_detail_name);%>
|
||||
<% request.setAttribute("Type_scadapic_brief_name", ScadaPic.Type_scadapic_brief_name);%>
|
||||
<% request.setAttribute("Type_scadapic_ps_name", ScadaPic.Type_scadapic_ps_name);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var masterId=$('#id').val();
|
||||
var tbName='TB_SCADAPIC_FILE'; //数据表
|
||||
var nameSpace='ScadaPicFile';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showDownload:true,
|
||||
showRemove:false,
|
||||
showCaption: true,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
allowedFileExtensions : ['jpg', 'png'],//接收的文件后缀
|
||||
previewFileType:['image'],
|
||||
otherActionButtons:'<a type="button" onclick="downloadfile(this)" class="kv-file-down btn btn-sm btn-default" {dataKey} title="下载附件"><i class="fa fa-cloud-download"></i></a>',
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',//不显示缩略图上传按钮
|
||||
actionDelete:'',//不显示删除按钮
|
||||
//actionZoom:''//不显示放大按钮
|
||||
},
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 "></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
function downloadfile(obj){
|
||||
var key = $(obj).data('key');
|
||||
window.open(ext.contextPath + '/base/downloadFile.do?key='+key+'&tbName='+tbName);
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#scadapicfile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("scadapicfile");
|
||||
}else{
|
||||
$('#scadapicfile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
getFileList();
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
grade: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '重要等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化底图类型选择框
|
||||
var refreshTypeSelect = function() {
|
||||
var select = $("#type").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${ScadaPic.type}').trigger("change");
|
||||
select.on("change",function(e){
|
||||
var text = $("#type").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
if($(this).val()=='${Type_scadapic_ps}'){
|
||||
//alert();
|
||||
$("#psdiv").show();
|
||||
|
||||
}else{
|
||||
$("#processsectionid").val('');
|
||||
$("#psdiv").hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
//初始化工艺段
|
||||
var refreshSelect = function(companyId) {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
|
||||
};
|
||||
|
||||
$(function(){
|
||||
refreshTypeSelect();
|
||||
if($("#type").val()=='${Type_scadapic_ps}'){
|
||||
//alert();
|
||||
$("#psdiv").show();
|
||||
|
||||
}else{
|
||||
$("#processsectionid").val('');
|
||||
$("#psdiv").hide();
|
||||
}
|
||||
//选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
var companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${ScadaPic.processsectionid}').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect('${ScadaPic.bizid}');
|
||||
var selelct =$("#bizid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${ScadaPic.bizid}').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
var companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
var text = $("#processsectionid").find("option:selected").text();
|
||||
$("#text").val(text);
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑底图</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" >
|
||||
<input type="hidden" class="form-control" id ="id" name ="id" value="${ScadaPic.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*所属厂区</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="bizid" name ="bizid" style="width: 270px;" disabled>
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*类型</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="type" name ="type" style="width: 270px;" disabled>
|
||||
<option value="${Type_scadapic_detail}" >${Type_scadapic_detail_name}</option>
|
||||
<option value="${Type_scadapic_brief}" >${Type_scadapic_brief_name}</option>
|
||||
<option value="${Type_scadapic_ps}" >${Type_scadapic_ps_name}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="psdiv">
|
||||
<label class="col-sm-3 control-label">*工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="processsectionid" name ="processsectionid" style="width: 270px;" disabled>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="text" name ="text" placeholder="标题" value="${ScadaPic.text}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<input id="f_upload" type="file" class="file" />
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传附件</button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="scadapicfile" id="scadapicfile" multiple class="file-loading" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
127
WebRoot/jsp/work/scadapic/scadaPic_EMAdd.jsp
Normal file
127
WebRoot/jsp/work/scadapic/scadaPic_EMAdd.jsp
Normal file
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
var selectEM = function(companyId) {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId,equipmentId:$("#equipid").val()} , function(data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveEM.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
showEM()
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加设备</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input id="equipid" name="equipid" type="hidden" value="" />
|
||||
<input type="text" class="form-control" id="equipname" name ="equipname" onclick="selectEM('${param.companyId}')" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posx</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posx" name ="posx" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posy</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posy" name ="posy" value="0" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">宽度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="width" name ="width" value="200" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">高度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="height" name ="height" value="100" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="box box-primary" id="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">表达式
|
||||
</h3>
|
||||
tools box
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="addFun();" title="添加">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="deletesFun();" title="删除">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
/. tools
|
||||
</div>
|
||||
/.box-header
|
||||
<div class="box-body pad" style="">
|
||||
<table id="table_express" class="table" style="overflow:auto;width:100%" ></table>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
260
WebRoot/jsp/work/scadapic/scadaPic_MPointAdd.jsp
Normal file
260
WebRoot/jsp/work/scadapic/scadaPic_MPointAdd.jsp
Normal file
@ -0,0 +1,260 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
var mpid= $("#mpid").val();
|
||||
$.post(ext.contextPath + '/work/scadaPic/addMPointExpression.do', {mpid:mpid} , function(data) {
|
||||
$("#expSubDiv").html(data);
|
||||
openModal('expSubModal');
|
||||
//ComponentsDateTimePickers.init();
|
||||
|
||||
});
|
||||
};
|
||||
var selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
|
||||
$("#box").hide();
|
||||
showExpression();
|
||||
})
|
||||
$('#expressionflag').on("change",function(data){
|
||||
if($('#expressionflag').val()=='1'){
|
||||
if($("#mpid").val()==''){
|
||||
showAlert('d','请选择测量点');
|
||||
}else{
|
||||
$("#box").show();
|
||||
$("#table_express").bootstrapTable('refresh');
|
||||
}
|
||||
}else{
|
||||
$("#box").hide();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
var MpPics;
|
||||
function showExpression(){
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
//$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
$table=$("#table_express").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
/* singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false, */
|
||||
idField : 'id',
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
mpid: $("#mpid").val(),
|
||||
}
|
||||
},
|
||||
//queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true },
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}},
|
||||
|
||||
] ],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mpoint");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table_express").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择要删除的表达式','alertDiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此表达式?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deleteMPointExpression.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_express").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveMPoint.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
|
||||
showMPoint()
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加测量点</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="hidden" class="form-control" style="cursor: pointer"id="mpcode" >
|
||||
<input type="text" class="form-control" id="mpid" name ="mpid" onclick="selectMPint()" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文本内容</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" name ="txt" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字体大小</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="fsize" name ="title" value="12px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posx</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posx" name ="posx" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posy</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posy" name ="posy" value="0" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">精确位数</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="accuracy" name ="accuracy" value="2" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">启用表达式</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2 " id="expressionflag" name ="expressionflag" style="width: 220px;">
|
||||
<option value="" selected">否</option>
|
||||
<option value="1" >是</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary" id="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">表达式
|
||||
</h3>
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="addFun();" title="添加">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="deletesFun();" title="删除">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body pad" style="">
|
||||
<table id="table_express" class="table" style="overflow:auto;width:100%" ></table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
230
WebRoot/jsp/work/scadapic/scadaPic_MPointEdit.jsp
Normal file
230
WebRoot/jsp/work/scadapic/scadaPic_MPointEdit.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/scadaPic/updateMPoint.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var grid;
|
||||
var MpPics;
|
||||
$(function() {
|
||||
$("#mpid").textbox('textbox').bind("click", function () {
|
||||
selectMPint();
|
||||
});
|
||||
$('#expressionflag').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#tool').panel('open');
|
||||
$('#expressionflag').switchbutton("setValue",1);//选中是value为1
|
||||
showExpression()
|
||||
}else{
|
||||
$('#tool').panel('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tool').panel({
|
||||
width:"100%",
|
||||
height:"250",
|
||||
title: '表达式',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){addFun();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){deletesFun();}
|
||||
}]
|
||||
|
||||
});
|
||||
$('#tool').panel('close');
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}}
|
||||
] ],
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
if("${scadaPic_MPoint.expressionflag}"=='1'){
|
||||
$('#expressionflag').switchbutton("check");
|
||||
}
|
||||
|
||||
});
|
||||
function showExpression(){
|
||||
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
|
||||
}
|
||||
function selectMPint(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择测量点',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#mpid").textbox('setValue',res.id);
|
||||
$("#txt").textbox('setValue',res.parmname);
|
||||
}
|
||||
showExpression();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var addFun = function() {
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
if(mpid==null || mpid==""){
|
||||
top.$.messager.alert('提示', '请先选择测量点!','info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'add',
|
||||
title : '新增表达式',
|
||||
width:500,
|
||||
height:200,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPointExpression.do?mpid='+mpid,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item.id;
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '未查询到需要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除多条记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deleteMPointExpression.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${scadaPic_MPoint.id}"/>
|
||||
<input name="containerwidth" type="hidden" value="${scadaPic_MPoint.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${scadaPic_MPoint.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${scadaPic_MPoint.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测量点编号</th>
|
||||
<td><input id="mpid" name="mpid" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${scadaPic_MPoint.mpid}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td><input id ="txt" name="txt" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${scadaPic_MPoint.txt}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
<input id="fsize" name="fsize" class="easyui-textbox" value="${scadaPic_MPoint.fsize}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
<input id="posx" name="posx" class="easyui-textbox" value="${scadaPic_MPoint.posx}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
<input id="posy" name="posy" class="easyui-textbox" value="${scadaPic_MPoint.posy}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>精确位数</th>
|
||||
<td>
|
||||
<input id="accuracy" name="accuracy" class="easyui-textbox" value="${scadaPic_MPoint.accuracy}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用表达式</th>
|
||||
<td>
|
||||
<input id="expressionflag" name ="expressionflag"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<div id="tool" class="easyui-panel" style="height:200px;width:100%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
122
WebRoot/jsp/work/scadapic/scadaPic_MPointView.jsp
Normal file
122
WebRoot/jsp/work/scadapic/scadaPic_MPointView.jsp
Normal file
@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var MpPics;
|
||||
$(function() {
|
||||
$('#expressionflag').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#tool').panel('open');
|
||||
$('#expressionflag').switchbutton("setValue",1);//选中是value为1
|
||||
showExpression()
|
||||
}else{
|
||||
$('#tool').panel('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tool').panel('close');
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
$('#tool').panel({
|
||||
width:"100%",
|
||||
height:"250",
|
||||
title: '表达式',
|
||||
|
||||
});
|
||||
var mpid ="${scadaPic_MPoint.mpid}";
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}}
|
||||
] ],
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
if("${scadaPic_MPoint.expressionflag}"=='1'){
|
||||
$('#expressionflag').switchbutton("check");
|
||||
}
|
||||
|
||||
});
|
||||
function showExpression(){
|
||||
|
||||
var mpid ="${scadaPic_MPoint.mpid}";
|
||||
$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="mpid" type="hidden" value="${scadaPic_MPoint.mpid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测量点编号</th>
|
||||
<td>${scadaPic_MPoint.mpid}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td>${scadaPic_MPoint.txt}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.fsize}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.posx}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.posy}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>精确位数</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.accuracy}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用表达式</th>
|
||||
<td>
|
||||
<input id="expressionflag" name ="expressionflag"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked disabled/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<div id="tool" class="easyui-panel" style="height:200px;width:100%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
126
WebRoot/jsp/work/scadapic/scadaPic_MPoint_ExpressionAdd.jsp
Normal file
126
WebRoot/jsp/work/scadapic/scadaPic_MPoint_ExpressionAdd.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
function dosaveexp() {
|
||||
$("#expressSubForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#expressSubForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveMPointExpression.do", $("#expressSubForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('expSubModal')
|
||||
$("#table_express").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var json =JSON.parse(getMpPic());
|
||||
console.log(json)
|
||||
/* var select =$("#expressionway").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/info/getListForSelect.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
}); */
|
||||
for(var i=0;i<json.length;i++){
|
||||
var path = json[i].path;
|
||||
//$("#expressionway").append("<option style='display:block;background:url(../"+path.substring(1,path.length)+");' value='"+json[i].id+"'>"+"<img src='../../"+json[i].path+"' style='width:20px;height:20px;' ></img>"+"</option>");
|
||||
$("#express").append(" <label class='mt-radio'><input type='radio' name='expressionway' id='expressionway' value='"+json[i].id+"'/><span></span></label>"+" <img src='../../"+json[i].path+"' style='width:20px;height:20px;' ></img>");
|
||||
}
|
||||
/* $("#expressionway").combobox({
|
||||
data : json,
|
||||
valueField : 'id',
|
||||
textField : 'id',
|
||||
panelHeight:'auto',
|
||||
formatter:function (row){
|
||||
var pic='<img src=../../'+row.path+' style="width:20px;height:20px;" ></img>';
|
||||
//console.log(row)
|
||||
return pic;
|
||||
}
|
||||
}); */
|
||||
});
|
||||
$("#expressSubForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
expression: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '表达式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
expressionway: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '显示样式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="expSubModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加表达式</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="expressSubForm">
|
||||
<input name="mpid" type="hidden" value="${param.mpid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">表达式</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="expression" name ="expression" placeholder="(例:2-5,>4,<6,7)" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">显示样式</label>
|
||||
<div class="col-sm-7" id="express">
|
||||
<!-- <select class="form-control " id="expressionway" name ="expressionway" style="width: 220px;">
|
||||
|
||||
</select> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosaveexp()" id="btn_save_express">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
147
WebRoot/jsp/work/scadapic/scadaPic_PSAdd.jsp
Normal file
147
WebRoot/jsp/work/scadapic/scadaPic_PSAdd.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
var companyId = $("#companyId").val();
|
||||
$(function() {
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
$("#processsectionid").empty();
|
||||
// $("#table").bootstrapTable('refresh', {data:null});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:$("#companyId").val()}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.id;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
/* selelct_.on("change",function(e){
|
||||
$("#processSection").val($("#processSection").select2("data")[0].id);
|
||||
}); */
|
||||
},'json');
|
||||
});
|
||||
var selectPS = function(pid) {
|
||||
$.post(ext.contextPath + '/user/processSection/showlistForSelect.do', {pid:pid} , function(data) {
|
||||
$("#psSubDiv").html(data);
|
||||
openModal('psSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/savePS.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
showPS();
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加工艺段</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">工艺名称</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2 " id="processsectionid" name ="processsectionid" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posx</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posx" name ="posx" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posy</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posy" name ="posy" value="0" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">宽度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="width" name ="width" value="65" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">高度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="height" name ="height" value="65" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-3 control-label">图片</label>
|
||||
<div class="col-sm-7" id="pic">
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
148
WebRoot/jsp/work/scadapic/scadaPic_PSEdit.jsp
Normal file
148
WebRoot/jsp/work/scadapic/scadaPic_PSEdit.jsp
Normal file
@ -0,0 +1,148 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
var companyId = $("#companyId").val();
|
||||
$(function() {
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
$("#processsectionid").empty();
|
||||
// $("#table").bootstrapTable('refresh', {data:null});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:$("#companyId").val()}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.id;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('${ps.processsectionid}').trigger("change");
|
||||
/* selelct_.on("change",function(e){
|
||||
$("#processSection").val($("#processSection").select2("data")[0].id);
|
||||
}); */
|
||||
},'json');
|
||||
});
|
||||
var selectPS = function(pid) {
|
||||
$.post(ext.contextPath + '/user/processSection/showlistForSelect.do', {pid:pid} , function(data) {
|
||||
$("#psSubDiv").html(data);
|
||||
openModal('psSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/updatePS.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
showPS();
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','更新失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑工艺段</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||||
<input name="id" id="id" type="hidden" value="${ps.id}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">工艺名称</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2 " id="processsectionid" name ="processsectionid" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posx</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posx" name ="posx" value="${ps.posx }">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posy</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posy" name ="posy" value="${ps.posy }" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">宽度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="width" name ="width" value="${ps.width }" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">高度</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="height" name ="height" value="${ps.height }" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-3 control-label">图片</label>
|
||||
<div class="col-sm-7" id="pic">
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
92
WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
92
WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
@ -0,0 +1,92 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveTxt.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
showTxt();
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
content: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '文本内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加文本</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*文本内容</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="content1" name ="content" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字体大小</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="fsize" name ="fsize" value="12px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posx</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posx" name ="posx" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">posy</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="posy" name ="posy" value="0" >
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
64
WebRoot/jsp/work/scadapic/workShopInfos4main.jsp
Normal file
64
WebRoot/jsp/work/scadapic/workShopInfos4main.jsp
Normal file
@ -0,0 +1,64 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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();
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
var fillDataFun = function(id,name) {
|
||||
var divstr='<div data-options="border:true" style="padding:5px 0 5px 0;margin:10px;border:2px solid #95b8e7;border-radius:6px;">'+
|
||||
'<div style="height:20px;font-weight:bold;">'+name+'</div>'+
|
||||
'<table id="'+id+'_info" style="height:200px;" data-options="border:true"></table>'+
|
||||
'<div id="'+id+'_equ" style="height:20px;margin:5px">设备统计:</div>'+
|
||||
'</div>'
|
||||
//console.log(divstr)
|
||||
$('#contentDiv').append(divstr)
|
||||
$.post(ext.contextPath + '/work/scadaPic/getWorkShopInfo.do', {workShopId:id}, function(data) {
|
||||
var workInfo=JSON.parse(data);
|
||||
//console.log($('#'+id+'_equ'))
|
||||
$('#'+id+'_info').datagrid({
|
||||
title : '',
|
||||
data :workInfo.res,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
//{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '产品名称', field : 'productname', sortable : false, halign:'center'},
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : false, halign:'center'},
|
||||
{width : '100', title : '当天计划产量', field : 'preamount', sortable : false, halign:'center'},
|
||||
{width : '100', title : '当天实际产量', field: 'productno', sortable : false, halign:'center'},
|
||||
{width : '100', title : '实际良率', field : ' _actyield', sortable : false, halign:'center'}
|
||||
] ],
|
||||
/* toolbar : '#toolbar', */
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
$('#'+id+'_equ').html("设备情况:设备总数"+workInfo.equinfo.sum+"台,正在运行"+workInfo.equinfo.run_num+"台,故障"+workInfo.equinfo.fault_num+"台");
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/work/workshop/getlist4Combo.do', {}, function(data) {
|
||||
var workshop=JSON.parse(data);
|
||||
for(var i=0; i<workshop.length;i++){
|
||||
fillDataFun(workshop[i].id,workshop[i].name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="contentDiv" data-options="region:'center',fit:true,border:false" style="padding:5px;overflow :yes">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user