123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- function initAlertDrag(url,str){
- var ai = new AlertIframe();
- if($(".drag_win").html()==null || $(".drag_win").html()==""){
- ai.createDragWin(url, str);
- }else{
- removeAlertDrag();
- //ai.createDragWin(url, str);
- }
-
- };
- function removeAlter(params){
- $("#aler").remove();
- $(".shade_plan").remove();
- };
- function removeIconAlter(params){
- $("#aler").remove();
- $("#"+params).removeClass("tl_show");
- };
- function removeAlertDrag(){
- /*$(".drag_win").css("display","none");*/
- $(".drag_win").empty();
- $(".drag_win").css({width:0,height:0});
- /*$("#bdmap").CSS("display","none");*/
- /*document.getElementById("bdmap").style.display="none";*/
- };
- function removeIframeGrid(id){
- $("#"+id).remove();
- };
- AlertIframe = function(){
- var _this = this ;
- var width = 320;
- var height = 186 ;
- var top = 100 ;
- var left = 100 ;
- var title = "系统提示" ;
- var count = "提示信息" ;
-
- var icon_width = 320 ;
- var icon_height = 186 ;
- var icon_bottom = 0 ;
- var icon_right = 0 ;
-
- var temp_width = 320 ;
- var temp_height = 186 ;
- var temp_bottom = 0 ;
- var temp_right = 0 ;
- var temp_src = "/nwyj/page/cockpit/webgis/toolTeam.jsp" ;
-
- var pos = {ifrX:0,ifrY:0,divX:0,divY:0};
-
- /**
- * 创建应急资源钻取数据弹窗
- */
- this.createErInfoGrid = function(src){
- var iframe = document.createElement("iframe");
- iframe.src = src;
- iframe.id = "infoGrid";
- iframe.name = "infoGrid";
- iframe.style.width = "700px";
- iframe.style.height = "570px";
- iframe.frameBorder = 0;
- iframe.scrolling = "no";
- iframe.style.position = "fixed";
- iframe.style.zIndex=999;
- iframe.style.border="none";
- iframe.style.top = "10%";
- iframe.style.left = "162px";
- $("body").append(iframe);
- };
-
- /**
- * 添加资源信息窗
- */
- this.addSummaryIframe = function(){
- var offset = $("#leftceladows").offset();
- var temp = $("#leftceladows").width();
- var iframe = document.createElement("iframe");
- iframe.src = "/nwyj/page/cockpit/webgis/gisMes.jsp";
- iframe.id = "gisMes";
- iframe.name = "gisMes";
- iframe.style.width = "15px";
- iframe.style.height = "15px";
- iframe.frameBorder = 0;
- iframe.scrolling = "no";
- iframe.style.position = "fixed";
- iframe.style.zIndex=999;
- iframe.style.border="none";
- iframe.style.top = offset.top+"px";
- iframe.style.left = (offset.left+temp)+"px";
-
- $("body").append(iframe);
- $("#gisMes").addClass("vis_no");
-
- };
-
- this.getPosi = function(_w,_h){
- /*var bh = $(window).height();
- var bw = $(window).width();*/
- //var bh = document.body.clientHeight;
- //var bw = document.body.clientWidth;
- // var bh = document.body.clientHeight;
- // var bw = document.body.clientWidth;
- var bh = window.screen.height;
- var bw = window.screen.width;
- bh = (bh - _h)/2.0 ;
- bw = (bw - _w)/2.0 ;
- top = bh ;
- left = bw ;
- };
-
- this.getTempMes = function(){
- return {width:temp_width, height:temp_height, top:temp_bottom, left:temp_right, title:title, count:count, src:temp_src};
- };
-
- this.setTempMes = function(_width,_height,_src){
- temp_width = _width;
- temp_height = _height;
- temp_src = _src;
- };
-
- this.getMes = function(){
- return {width:width, height:height, top:top, left:left, title:title, count:count};
- };
-
- this.setMes = function(_width,_height,_top,_left,_title,_count){
- width = _width;
- height = _height;
- top = _top;
- left = _left;
- title = _title;
- count = _count;
- };
-
- this.createAlert = function(){
- _this.getPosi(width,height);
- $("#leftceladows").append("<div class='shade_plan'></div>");
- var iframe = document.createElement("iframe");
- iframe.onload = iframe.onreadystatechange = _this.initIframe;
- iframe.src = "/nwyj/page/cockpit/alert/alert_iframe.html";
- iframe.style.width = width+"px";
- iframe.style.height = height+"px";
- iframe.style.position = "fixed";
- iframe.style.top = top+"px";
- iframe.style.left = left+"px";
- iframe.id = "aler";
- iframe.scrolling = "no";
- iframe.style.border="none";
- iframe.style.zIndex=999;
- iframe.frameBorder = 0;
- $("body").append(iframe);
- };
-
- this.initIframe = function(){
- if (this.src.length > 0) {
- if (!this.readyState || this.readyState == "complete") {
- $(this).contents().find("#alt_title").html(title);
- $(this).contents().find("#alt_count").html(count);
- }
- }
- };
-
-
- this.getIconMes = function(){
- return {width:width, height:height, top:top, left:left, title:title, count:count};
- };
-
- this.setIconMes = function(_width,_height,_bottom,_right,_title,_count){
- icon_width = _width;
- icon_height = _height;
- icon_bottom = _bottom;
- icon_right = _right;
- title = _title;
- count = _count;
- };
- /**
- * 弹出信息框
- * w:弹框宽度px
- * h:弹框高度px
- * b:距离底部距离px
- * r:距离右侧距离px
- * src:页面地址
- */
- this.createIconAlert = function(w,h,b,r,src){
- var iframe = document.createElement("iframe");
- /*iframe.onload = iframe.onreadystatechange = _this.initIconIframe;*/
- iframe.src = src;
- iframe.style.width = w+"px";
- iframe.style.height = h+"px";
- iframe.style.position = "fixed";
- iframe.style.bottom = b+"px";
- iframe.style.right = r+"px";
- iframe.id = "aler";
- iframe.name= "iconFrame";
- iframe.scrolling = "no";
- iframe.style.border="none";
- iframe.frameBorder = 0;
- $("body").append(iframe);
- return true;
- };
-
-
- /**
- * 创建一个Iframe
- */
- this.createIframe = function(temp_width, temp_height, temp_src){
- _this.getPosi(width,height);
- $("#leftceladows").append("<div class='shade_plan'></div>");
-
-
- var iframe = document.createElement("iframe");
- iframe.onload = iframe.onreadystatechange = _this.initIframe;
- iframe.src = temp_src;
- iframe.style.width = temp_width+"px";
- iframe.style.height = temp_height+"px";
- iframe.style.position = "fixed";
- iframe.style.top = top+"px";
- iframe.style.left = left+"px";
- iframe.id = "aler";
- iframe.scrolling = "no";
- iframe.style.border="none";
- iframe.style.zIndex=999;
- iframe.frameBorder = 0;
- $("body").append(iframe);
- };
-
- this.initIconIframe = function(){
- if (this.src.length > 0) {
- if (!this.readyState || this.readyState == "complete") {
- $(this).contents().find("#alt_title").html(title);
- // $(this).contents().find("#alt_count").html(count);
- }
- }
- };
-
- /**
- * 得到地图过滤条件窗口
- */
- this.createGisFilterPlant = function(){
- var iframe = document.createElement("iframe");
- iframe.onload = iframe.onreadystatechange = _this.initIconIframe;
- iframe.src = $.pathname() + "/page/cockpit/alert/alert_filter_plant.html";
- iframe.style.width = icon_width+"px";
- iframe.style.height = icon_height+"px";
- iframe.style.position = "fixed";
- iframe.style.bottom = icon_bottom+"px";
- iframe.style.right = icon_right+"px";
- iframe.id = "aler";
- iframe.scrolling = "no";
- iframe.style.border="none";
- iframe.frameBorder = 0;
- $("body").append(iframe);
- };
-
- this.createDragWin = function(url, titleStr){
-
- var wid = $(".drag_win").attr("width");
- var hei = $(".drag_win").attr("height");
- $(".drag_win").css({width:wid,height:hei});
-
- var ww = $(window).width();
- var wh = $(window).height();
-
- wid = _this.setWHDrag(wid,ww);
- hei = _this.setWHDrag(hei,wh);
-
- _this.getPosi(wid.num,hei.num);
-
- $(".drag_win").css({top:100,left:left});
- $(".drag_win").append('<div id="tit" class="drag_title">' +
- '<table class="tit_tab"><tr><td class="tit_td"> ' + titleStr + '</td>' +
- '<td class="close_td" onclick="removeAlertDrag()">' + '<img src="/nwyj/images/cockpit/close.png" class="close_drag" alt="关闭"/>' + '</td></tr></table>' +
- '</div>' +
- /*'<iframe id="bdmap" width="' + wid.num + 'px" height="' + (hei.num-30) + 'px" scrolling="no" frameborder="0" src="' + url + '"></iframe>');*/
- '<iframe id="bdmap" width="' + wid.num + 'px" height="560px" scrolling="no" frameborder="0" src="' + url + '"></iframe>');
- _this.cl_div();
- _this.al_div();
- };
-
- this.setWHDrag = function(pd,winPd){
-
- var wunit = pd.substring(pd.length-2,pd.length);
- var num = pd.substring(0, pd.length-2) ;
- if(wunit=="px"||wunit=="PX"){
- return {unit:"px",num:num};
- }else{
- wunit = pd.substring(pd.length-1,pd.length);
- if(wunit=="%"){
- num = pd.substring(0, pd.length-1) ;
- num = winPd * (num/100);
- return {unit:"%",num:num};
- }else{
- return {unit:"",num:num};
- }
- }
- };
-
- /*DIV 鼠标拖动样式*/
- this.cl_div = function(){
- $("#tit").on('mousedown',function(){
- pos.divX = event.offsetX;
- pos.divY = event.offsetY;
- $(document).bind('mousemove',function(e){
- _this.div_panl_move(event,this);
- });
- });
- };
- this.al_div = function(){
- $("#tit").on('mouseup',function(){
- $(document).unbind('mousemove');
- });
- };
- this.div_panl_move = function(e,obj){
- var e = window.event || e;
- var x = e.clientX - pos.divX;
- var y = e.clientY - pos.divY;
- $(".drag_win").css({left:x+"px",top:y+"px"});
- };
-
- };
|