123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- var grid = null ;
- /**
- * @param QUIlayoutpage类为Qui布局相关的所有的方法
- * @author jiangyongfei zhumingyue
- * @constructor null
- * @exception null
- * @version 1.0
- * @Date 2015-09-24
- */
- (function(){
- QUIlayoutpage();
- Gislayerpage();
- });
- QUIlayoutpage=function()
- {
- /**
- * 实例化
- */
- gislayerpages = new Gislayerpage();
-
- /**
- * 响应事件类型自动提交参数
- */
- var settingMoreOpt = {
- view: {
- dblClickExpand: false
- },
- check: {
- enable: true,
- autoCheckTrigger: true
- },
- callback: {
- //响应右键
- onRightClick: OnRightClick,
- onCheck: onCheckID
- }
- };
- /**
- * 树形复选框内容
- */
- var zNodes = [
- //{ id:1, parentId:0, name:"气象灾害", open: true, icon:"/nwyj/images/cockpit/morelayer.ico", nocheck: false,menuType:"fathermenu"},
- { id:11,parentId:1, name:"日常气象图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- { id:12,parentId:1, name:"台风图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- { id:13,parentId:1, name:"暴雨图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- { id:14,parentId:1, name:"冰灾图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:15,parentId:1, name:"地震图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- { id:16,parentId:1, name:"山火图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:2, parentId:0, name:"应急预警与响应", open: false, icon:"/nwyj/images/cockpit/morelayer.ico", nocheck: false,menuType:"fathermenu"},
- { id:21,parentId:2, name:"应急预警与响应图层",icon:"/nwyj/images/cockpit/morelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- // { id:3, parentId:0, name:"线路跳闸与变电站停运", open: false, icon:"/nwyj/images/cockpit/morelayer.ico", nocheck: false,menuType:"fathermenu"},
- // { id:31,parentId:3, name:"线路跳闸与变电站停运图层",icon:"/nwyj/images/cockpit/morelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:4, parentId:0, name:"应急资源", open: false, icon:"/nwyj/images/cockpit/morelayer.ico", nocheck: false,menuType:"fathermenu"},
- { id:41,parentId:4, name:"应急资源图层",icon:"/nwyj/images/cockpit/morelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:5, parentId:0, name:"线路覆冰", open: false, icon:"/nwyj/images/cockpit/morelayer.ico", nocheck: false,menuType:"fathermenu"},
- //{ id:51,parentId:5, name:"线路覆冰图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:6, parentId:0, name:"设备损失", open: false, icon:"/nwyj/images/cockpit/morelayer.ico",chkDisabled: false, nocheck: false,menuType:"fathermenu"},
- { id:61,parentId:6, name:"设备损失图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- //{ id:7, parentId:0, name:"用户停电", open: false, icon:"/nwyj/images/cockpit/morelayer.ico",chkDisabled: false, nocheck: false,menuType:"fathermenu"},
- { id:71,parentId:7, name:"用户停电图层",icon:"/nwyj/images/cockpit/onelayer.ico", chkDisabled: false,menuType:"sonmenu",checked:false},
- ];
- /**
- * @param QUI布局,分为左中右的三部分弹窗效果,传入参数分别为控件名称,true/false,true/false
- * @version 1.0
- * @Date 2015-09-26
- */
- //this.QUIlayout=function(Uicontrolname,leftflag,rightflag)
- //{
- //var layout=$(Uicontrolname).layout({ leftWidth: 250,rightWidth:300});
- //layout.setLeftCollapse(leftflag);
- //layout.setRightCollapse(rightflag);
- //};
- /**
- * @param QUI树形复选框,传入参数为控件名称
- * @version 1.0
- * @Date 2015-09-26
- */
- this.QUItreecheckbox=function(Uicontrolname)
- {
- $.fn.zTree.init($(Uicontrolname),settingMoreOpt, zNodes);
- };
- /**
- * @param QUI中的右键菜单,传入参数为控件名称
- * @version 1.0
- * @Date 2015-09-26
- */
- this.QUItreerightmeun=function(Uicontrolname)
- {
- zTree = $.fn.zTree.getZTreeObj(Uicontrolname);
- //鼠标移入右键菜单效果
- $("#rMenu >div").hover(function(){
- $(this).addClass("b-m-ifocus");
- },function(){
- $(this).removeClass("b-m-ifocus");
- });
- };
- /**
- * @param QUI中的右键菜单按钮内容
- * @version 1.0
- * @Date 2015-09-26
- */
- this.ShowRightMeun=function(type, x, y)
- {
- $("#rMenu ul").show();
- // if(type == "fathermenu") {//父节点全选和全不选
- // $("#fullopt").show();
- // $("#nofullopt").show();
- // $("#openfind").show();
- // $("#openlegend").show();
- // $("#opendatatable").show();
- // $("#openspecial").show();
- // $("#zoomtolayer").show();
- //
- // $("#zoomtolayer").hide();
- // $("#openspecial").hide();
- // $("#opendatatable").hide();
- // $("#openlegend").hide();
- // $("#openfind").hide();
- // }else
- if(type == "sonmenu") {//子节点不保留选择和删除
- // $("#fullopt").show();
- // $("#nofullopt").show();
- $("#openfind").show();
- $("#openlegend").show();
- $("#opendatatable").show();
- // $("#openspecial").show();
- $("#zoomtolayer").show();
- // $("#fullopt").show();
- // $("#nofullopt").show();
- }
- $("#rMenu").css({"top":y+"px", "left":x+"px", "visibility":"visible"});
- //点击菜单外时隐藏菜单
- $("body").bind("mousedown", onBodyMouseDown);
- };
- /**
- * @param 鼠标点击右键面板中的菜单之后隐藏右键面板
- * @version 1.0
- * @Date 2015-09-26
- */
- this.hideRMenu = function()
- {
- if ($("#rMenu")) $("#rMenu").css({"visibility": "hidden"});
- $("body").unbind("mousedown", onBodyMouseDown);
- };
- /**
- * @param 鼠标点击空白处后隐藏右键面板
- * @version 1.0
- * @Date 2015-09-26
- */
- function onBodyMouseDown(event)
- {
- if (!(event.target.id == "rMenu" || $(event.target).parents("#rMenu").length > 0))
- {
- $("#rMenu").css({"visibility" : "hidden"});
- }
- };
- /**
- * @param 右键菜单中的全选功能
- * @version 1.0
- * @Date 2015-09-26
- */
- this.Rfullopt = function(checked)
- {
- //获取选中的行
- var nodes = zTree.getSelectedNodes();
- if (nodes && nodes.length>0)
- {
- zTree.checkNode(nodes[0], checked, true);
- }
- };
-
- /**
- * 定义图层ID与选项卡之间的映射
- */
- var pageTitles = { 11:'日常气象图层', 12:'台风图层', 13:'暴雨图层', 14:'冰灾图层',
- 15:'地震图层', 16:'山火图层', 21:'应急预警,应急响应',
- 41:'应急资源', 61:'设备损失图层', 71:'用户停电图层'} ;
-
- // var pageTitles = { 11:'日常气象图层', 12:'台风图层', 13:'暴雨图层', 14:'冰灾图层',
- // 15:'地震图层', 16:'山火图层', 21:'应急预警,应急响应',31:'线路跳闸,变电站停运,负荷损失',
- // 41:'应急资源', 51:'数量统计,详细信息', 61:'设备损失图层', 71:'用户停电图层'} ;
-
- // var gridUrl = { "21a":"ew.jsp","21b":"er.jsp","31a":'lt.jsp',"31b":"so.jsp","31c":"lost.jsp"} ;
-
- var gridUrl = { "21a":"ew.jsp"+window.location.search,"21b":"er.jsp"+window.location.search} ;
-
- var tab = null ;
- /**
- * 定义图层ID与数据表图层名称之间的映射
- *
- */
- var layerNames = {11:'日常气象',12:'台风',13:'暴雨',14:'冰灾',15:'地震',
- 16:'山火',21:'应急预警与响应',41:'应急资源',61:'设备损失',71:'用户停电'} ;
-
- // var layerNames = {11:'日常气象',12:'台风',13:'暴雨',14:'冰灾',15:'地震',
- // 16:'山火',21:'应急预警与响应',31:'线路跳闸与变电站停运',
- // 41:'应急资源',51:'线路覆冰',61:'设备损失',71:'用户停电'} ;
- /**
- * @param 通过ID改变数据表中的选项卡
- * @version 1.0
- * @Date 2015-09-26
- */
- this.tableInit=function()
- {
- tab = new TabView( {
- containerId :'tab_menu',
- pageid :'page',
- cid :'tab1',
- position :"top"
- });
- tab.add( {
- id :'0',
- title :'应急预警',
- url :'ew.jsp'+window.location.search,
- isClosed :false
- });
- tab.add( {
- id :'1',
- title :'应急响应',
- url :'er.jsp'+window.location.search,
- isClosed :false
- });
- tab.activate('0') ;
- };
- /**
- * @param 通过ID改变数据表
- * @version 1.0
- * @Date 2015-09-26
- */
- this.getPageTitle=function(id)
- {
- for(var key in pageTitles)
- {
- if(id==key){
- if (pageTitles[key].indexOf(',') > -1) {
- var pageTitle0 = pageTitles[key].split(',')[0];
- var pageTitle1 = pageTitles[key].split(',')[1];
- tab.update({id:'0',title:pageTitle0,url:gridUrl[id+"a"] }) ;
- tab.close('1') ;
- tab.add({
- id :'1',
- title :pageTitle1,
- url :gridUrl[id+"b"],
- isClosed :false
- });
- }
- else
- {
- var pageTitle = pageTitles[key] ;
- tab.update({id:'0',title:pageTitle,url:gridUrl[id]}) ;
- tab.close('1') ;
- }
-
- }
- }
- tab.activate('0');
- };
- /**
- * 根据ID改变框架右侧数据表格的图层标题
- */
- this.getRightTitles=function(id)
- {
- for(var key in layerNames)
- {
- if(id==key)
- {
- //选中centerUI中样式表中的低第二个元素进行修改
- $("#centerUI").find(".l-layout-header-inner").eq(1).text(layerNames[key]);
- $(".tabContainer").css("left","0px");
- $(".tabButtonLeft").remove();
- $(".tabButtonRight").remove();
- };
- };
- };
- /**
- * @param 关闭应急资源的绘图面板
- * @version 1.0
- * @Date 2015-10-12
- */
- this.closeERdrowTool = function()
- {
- $("#floatPanel-6").floatPanelClose();
- };
- /**
- * 单击打开应急资源投入查询面板
- */
- this.resourceInvestment = function()
- {
- $("#toolWin").floatPanelClose();
- $("#ewerWin").floatPanelClose();
- $("#ltsoWin").floatPanelClose();
- $("#erWin").floatPanelOpen();
- $("#teamWin").floatPanelClose();
- };
- /**
- * 单击打开设备列表图标事件
- */
- this.listFun = function()
- {
- $("#toolWin").floatPanelClose();
- $("#ewerWin").floatPanelClose();
- $("#ltsoWin").floatPanelClose();
- $("#erWin").floatPanelClose();
- $("#teamWin").floatPanelOpen();
- };
- /**
- * 单击打开绘图工具栏图标事件
- */
- this.toolFun = function()
- {
- $("#teamWin").floatPanelClose();
- $("#ewerWin").floatPanelClose();
- $("#ltsoWin").floatPanelClose();
- $("#erWin").floatPanelClose();
- $("#toolWin").floatPanelOpen();
- };
- /**
- * @param 弹出右键面板的同时获取右键菜单的ID
- * @version 1.0
- * @Date 2015-09-26
- */
- function OnRightClick(event, treeId, treeNode)
- {
- if(treeNode && !treeNode.noR)
- {
- zTree.selectNode(treeNode);
- showRMenu(treeNode.menuType, event.clientX, event.clientY);
- //右键得到点击的ID
- RightMenuId = treeNode.id;
- Rightflag=treeNode.checked;
- }
- };
-
- /**
- * @param 鼠标点击复选框传点击参数
- * @version 1.0
- * @Date 2015-09-26
- */
- function onCheckID(event, treeId, treeNode)
- {
- appendMenuid("onCheck", treeNode.id, treeNode.checked);
- };
- //类结束
- };
- /**
- * @author jiangyongfei
- * @param Gislayerpage类为针对GIS图层操作的方法
- * @constructor null
- * @exception null
- * @version 1.0
- * @Date 2015-09-26
- */
- Gislayerpage=function()
- {
-
- //类结束
- };
|