1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297 |
- /**
- * 显示的视图专题
- */
- var layoutNumber=null;
- var cockpit=null;
- var de=new Base64();
- var dataSourceState=1;
- /**
- * 解析的参数
- */
- var urlJson=new Util().resolveUrl();
- /**
- * 工具类
- */
- var util=new Util();
- /**
- *
- */
- var number=null;
- var style="style1";
- var styleId=null;
- $(function(){
- //IE浏览器默认全屏
- defaultFullScreen();
- //进入页面获取通知单号
- $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getResentWarnningNumberInfo",{compId:urlJson["dept_id"]},function(result){
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined ||result.rows[1]["RELEASE_RELIEVE_DATE"]!=undefined){
- number=result.rows[0]["RELEASE_RELIEVE_DATE"]> result.rows[1]["RELEASE_RELIEVE_DATE"]?result.rows[0]["EARLY_WARNING_ID"]:result.rows[1]["EARLY_WARNING_ID"];
- }
- init();
- showView();
- },"json");
- });
- /**
- * 默认全屏操作
- */
- function defaultFullScreen(){
- util.isFullScreen(function(){util.fullScreen();},function(){});
- }
- /**
- * 初始化操作
- */
- function init(){
- cockpit=new Cockpit();
- //创建右侧视图容器
- $("#i_index_rcontent").find(".c_index_contenthw").each(function(){
- cockpit.createMainView($(this));
- });
- /**
- * 加载默认
- */
- loadDefalutStyle();
- //生成样式列表
- /* cockpit.createStyleList("",pageStle);*/
- //生成左侧头部工具栏
- //util.isRole(urlJson["role_id"],de.decode(role["admin"]))||util.isRole(urlJson["role_id"],de.decode(role["sale"]));
- cockpit.createTextBar($("#i_index_left_head"),cockpit.getTextBarParam(util.isRole(urlJson["role_id"], de.decode(role["admin"]))||util.isRole(urlJson["role_id"], de.decode(role["sale"]))));
- //为左侧工具栏绑定事件
- cockpit.bindClickOnTextBar($("#i_index_left_head").find(".c_index_left_head_content"),cockpit.getTextBarParam(util.isRole(urlJson["role_id"], de.decode(role["admin"]))||util.isRole(urlJson["role_id"], de.decode(role["sale"]))));
- //生成左侧视图布局列表
- //cockpit.createList($("#i_index_left_content"));
- //左侧工具栏展开与关闭参数
- var barList=[{firstName:"设置",secondtName:"关闭",firstIcon:"c_index_open_list c_index_24_24",secondIcon:"",fn:fn_open_list},
- {firstName:"放大",secondtName:"缩小",firstIcon:"c_index_fangda c_index_24_24",secondIcon:"c_index_suoxiao",fn:fn_open_large},
- {firstName:"刷新",secondtName:"刷新",firstIcon:"c_index_rend c_index_24_24",secondIcon:"",fn:fn_open_rend}
- /* {firstName:"打印",secondtName:"打印",firstIcon:"c_index_fangda c_index_18_18",secondIcon:"c_index_suoxiao",fn:function(contentId){alert("打印");printDom(contentId);}}*/
- ];
- //生成左侧工具条与设为常用的方法栏
- cockpit.createBarList(barList);
- //展开和关闭左侧
- openAndCloseLeftAside();
- $(document).on("click",function(){
- if($(".c_index_selectList").size()==0)return;
- $(".c_index_selectList").animate({height:"0px"},"1000",function(){
- $(".c_index_selectList").remove();
- });
-
- });
- //判断是否为IE浏览器,如果不是不加载GIS
- if ((navigator.userAgent.indexOf('MSIE') >= 0)
- && (navigator.userAgent.indexOf('Opera') < 0)){
- $("#gis").attr({src:"/nwyj/page/cockpit/webgis/gis.html"+window.location.search});
- }else{
- //信息提示,不是IE浏览器,不支持GIS展示。
- $("#i_index_main_content").empty();
- $("#i_index_main_content").append("<div style='top: 50%;left: 50%; margin-left: -100px;margin-top: 15px;height: 30px; width: 250px;color: #00FFE4; position: absolute; font-size: 16px'>不是IE浏览器,不支持GIS展示</div>");
- }
-
- }
- /**
- * 加载默认风格
- */
- function loadDefalutStyle(){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getDefaultStyle",{userId:urlJson["user_id"]},function(result){
- if(result.rows.length>0){
- style=result.rows[0]["STYLE"];
- styleId=result.rows[0]["FD_OBJECTID"];
- }
- /**
- * 加载默认专题
- */
- loadDefalut();
-
- },"json");
- }
- /**
- * 加载默认布局
- */
- function loadDefalut(){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getDefaultLayoutInfo",{screenId:'2',userId:urlJson["user_id"]},function(result){
- if(result.total>0){
- layoutNumber=result.data;
- loadPages(result.rows[0].rows);
- }
- cockpit.createList($("#i_index_left_content"));
- },"json");
- }
- /**
- * 加载默认布局
- */
- function Cockpit(){}
- /**
- * 生成样式列表
- * @param $dom 存放样式列表的容器
- * @param jsonParam 样式列表的数据
- */
- Cockpit.prototype.createStyleList=function($dom,jsonParam){
- if(jsonParam == undefined)throw new Error("createStyleList参数数据不存在");
- if($dom==null || typeof $dom==undefined ||$dom=="")
- $("body").append("<div id='i_index_styleContent' class='c_index_styleContent'></div>");
- var htmlStr="<div><ul>";
- for(var item in jsonParam){
- htmlStr+="<li data="+item+">"+jsonParam[item].name+"</li>";
- }
- htmlStr+="</ul></div>";
- $("#i_index_left_head").append(htmlStr);
-
- };
- /**
- * 生成左侧的工具条[{text1:"编辑",text2:"取消编辑",icon1:"".icon2:"",fn1:"",fn:"";}];
- * @param $dom 追加节点的父类容器
- * @param arrParam 追加节点的参数
- */
- Cockpit.prototype.createTextBar=function($dom,arrParam){
- if(arrParam==undefined || arrParam.length==0)
- throw new Error("左侧标题数组为空");
- var htmlStr="<div class='c_index_left_head_content'><div id='bi_index_changeLayout' title='切换视图' class='bc_index_changeLayout c_index_changestyle'></div><ul class='c_index_left_head_ul'>";
- for(var index=0,len=arrParam.length;index<len;index++){
- htmlStr+="<li class='c_index_left_head_li' ><div class='"+arrParam[index]["icon1"]+"' title='"+arrParam[index]["text1"]+"'></div></li>";
- }
- htmlStr+="</ul><div id='i_index_left_head_list' class='c_index_left_head_list'></div></div>";
- $dom.append(htmlStr);
- $("#bi_index_changeLayout").data("state","0").on("click",function(){
- changeLayoutView($(this).data("state"));
- //$(this).data("state",(parseInt($(this).data("state"))+1)%3);
- $(this).data("state",(parseInt($(this).data("state"))+1)%2);
- });
-
- };
- /**
- * 切换布局状态
- */
- function changeLayoutView(state){
- /* if(state==0){
- showGis();
- }else if(state==1){
- showViewAndGis();
- }else if(state==2){
- showView();
-
- }*/
- // window.open("/nwyj/page/cockpit/webgis/webgis.html"+window.location.search, "gis地图", "", "");
- // window.open("/nwyj/page/cockpit/baidu_map/webgis.html"+window.location.search, "百度地图", "", "");
- if(myBrowser().brow == "IE"){
- window.open("/nwyj/page/cockpit/webgis/webgis.html"+window.location.search, "gis地图", "", "");
- }else{
- window.open("/nwyj/page/cockpit/baidu_map/webgis.html"+window.location.search, "百度地图", "", "");
- };
- }
- /**
- * 显示GIS
- */
- function showGis(){
- $("#i_index_content3").css({left:"0px",right:"0px",width:"100%",height:"100%"});
- $("#i_index_content1").css({width:"0%",height:"0%"});
- $("#i_index_content2").css({width:"0%",height:"0%"});
- $("#i_index_content4").css({width:"0%",height:"0%"});
- $("#i_index_content5").css({width:"0%",height:"0%"});
- }
- /**
- * 显示视图
- */
- function showView(){
- $("#i_index_content3").css({left:"0",right:"0",width:"0%",height:"0%"});
- $("#i_index_content1").css({width:"50%",height:"50%"});
- $("#i_index_content2").css({width:"50%",height:"50%"});
- $("#i_index_content4").css({width:"50%",height:"50%"});
- $("#i_index_content5").css({width:"50%",height:"50%"});
- }
- /**
- * 显示GIS和视图
- */
- function showViewAndGis(){
- $("#i_index_content3").css({left:"25%",right:"25%",width:"50%",height:"100%"});
- $("#i_index_content1").css({width:"25%",height:"50%"});
- $("#i_index_content2").css({width:"25%",height:"50%"});
- $("#i_index_content4").css({width:"25%",height:"50%"});
- $("#i_index_content5").css({width:"25%",height:"50%"});
- }
- /**
- * 绑定左侧头部的文字事件
- * 全屏,退出全屏,修改,解除修改,增加保存
- * @param $dom
- * @param arrParam
- */
- Cockpit.prototype.bindClickOnTextBar=function($dom,arrParam){
- $dom.find("li").each(function(index,item){
- $(this).data("state","1");
- $(this).on("click",function(){
- if($(this).data("state")==1){
- $(this).data("state","2");
- arrParam[index].fn1();
- $(this).find("div").addClass(arrParam[index]["icon2"]);
- }else{
- $(this).data("state","1");
- arrParam[index].fn2();
- $(this).find("div").removeClass(arrParam[index]["icon2"]);
-
- }
- });
- });
- };
- /**
- * 获取左侧工具条的参数
- * @returns {Array}
- */
- Cockpit.prototype.getTextBarParam=function(flag){
- if(!flag){
- return [
- {text1:"全屏",text2:"退出全屏",icon1:"c_index_16_16 c_index_screen",icon2:"c_index_exitscreen",fn1:function(){util.fullScreenOpration();},fn2:function(){util.fullScreenOpration();}},
- {text1:"风格列表",text2:"风格列表",icon1:"c_index_16_16 c_index_style",icon2:"c_index_style1",fn1:function(){openStyleList(pageStyle);},fn2:closeListStyle},
- {text1:"人工数据源",text2:"系统数据源",icon1:"c_index_60_30 c_index_system",icon2:"c_index_people",
- fn1:function(){dataSourceState=0;changeDataSource();},
- fn2:function(){dataSourceState=1;changeDataSource();}}
- ];
- }else{
- return [
- {text1:"编辑",text2:"取消编辑",icon1:"c_index_16_16 c_index_edit",icon2:"c_index_cancle_edit",fn1:bindIndexEdit,fn2:function(){cockpit.createList($("#i_index_left_content"));}},
- {text1:"全屏",text2:"退出全屏",icon1:"c_index_16_16 c_index_screen",icon2:"c_index_exitscreen",fn1:function(){util.fullScreenOpration();},fn2:function(){util.fullScreenOpration();}},
- {text1:"增加",text2:"保存",icon1:"c_index_16_16 c_index_add",icon2:"c_index_index_save",fn1:function(){ showView();indexAddView();},fn2:function(){indexSaveView();}},
- {text1:"风格列表",text2:"风格列表",icon1:"c_index_16_16 c_index_style",icon2:"c_index_style1",fn1:function(){openStyleList(pageStyle);},fn2:closeListStyle},
- {text1:"人工数据源",text2:"系统数据源",icon1:"c_index_60_30 c_index_system",icon2:"c_index_people",
- fn1:function(){dataSourceState=0;changeDataSource();},
- fn2:function(){dataSourceState=1;changeDataSource();}}
- ];
- }
-
- };
- /**
- * 关闭风格列表
- */
- function closeListStyle(){
- var $dom = $("#i_index_left_head").find(".c_index_styleList");
- if($dom.size()>0)$dom.remove();
- }
- /**
- * 展开风格列表方法
- */
- function openStyleList(jsonParam){
- var $dom = $("#i_index_left_head_list").find(".c_index_styleList");
- if($dom.size()>0)$dom.remove();
- $dom=null;
- var htmlStr="<div class='c_index_styleList'><h2 class='c_index_styleList_head'>选择风格类型:</h2><ul>";
- for(var item in jsonParam){
- htmlStr+="<li data='"+item+"'><div title='"+jsonParam[item]["name"]+"' class='c_index_styleItem "+jsonParam[item]["iconClass"]+"'></div></li>";
- }
- $("#i_index_left_head_list").append(htmlStr);
- $("#i_index_left_head_list").find(".c_index_styleList").find("li").each(function(){
- $(this).on("click",function(){
- var _style=$(this).attr("data");
- style=_style;
- changeAllViewStle(_style);
- if(styleId!=null){
- editUserSelfStyle(styleId,_style);
- }else{
- saveUserSelfStyle(urlJson["user_id"],_style);
- }
- return false;
- }).on("mouseenter",function(){
- var $this=$(this).find("div");
- $(this).find("div").addClass("c_moveIn_li").animate({"background-size":"25px",opacity:0.5},"300",function(){
- $this.animate({"background-size":"30px",opacity:1},"300");
- });
- return false;
- }).on("mouseleave",function(){
- $(this).find("div").removeClass("c_moveIn_li");
- return false;
- });
-
- });
- };
- /**
- * 保存用户自定义样式列表
- */
- function saveUserSelfStyle(userId,style){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/saveDefaultStyle",{userId:userId,style:style},function(result){
- },"json");
- }
- /**
- * 修改用户自定义样式列表
- */
- function editUserSelfStyle(styleId,style){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/editDefaultStyle",{styleId:styleId,style:style},function(result){
- },"json");
- }
- /**
- * 加载通知单
- */
- function loadTongZhiDanData(){
- var startTime=param+"-01-01 00:00:00";
- var endTime=parseInt(param)+1+"-01-01 23:59:59";
- $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getWarnningNumberInfo",{startTime:startTime,endTime:endTime,compId:urlJson["dept_id"]},function(result){
-
- },"json");
- }
- /**
- * 选择系统数据源
- */
- function changePeoDataSource(){
- var $dom = $("#i_index_left_head_list").find(".c_index_numberContent");
- if($dom.size()>0)$dom.remove();
- var htmlStr="<div class='c_index_numberContent'><ul>";
- htmlStr+="<li><div class='c_index_numberContent_left c_index_year'>起始日期:</div><div class='c_index_numberContent_center'><input type='text' id='i_start_date' class='date dt c_date' dateFmt='yyyy-MM-dd' truetype='date' value='"+getDate(1).startTime+"'/></div>";
- htmlStr+="<li><div class='c_index_numberContent_left c_index_year'>截止日期:</div><div class='c_index_numberContent_center'><input type='text' id='i_end_date' class='date dt c_date' dateFmt='yyyy-MM-dd' truetype='date' value='"+getDate(1).endTime+"'/></div>";
- htmlStr+="<li><div class='c_index_numberContent_left'>预警单号:</div><div class='c_index_numberContent_center'><div type='input' id='i_index_select_yujingtongzhidan' class='c_index_tongzhidan'/><div id='bi_index_yujingtongzhidan' class='icon_select2 c_index_select'></div></div><div class='c_index_numberContent_right'><div id='bi_index_yujingdanhao_okay' class='c_index_display icon_index_okay c_button_div'></div></div>";
- htmlStr+="<li><div class='c_index_numberContent_left'>响应单号:</div><div class='c_index_numberContent_center '><div type='input' id='i_index_select_xiangyingtongzhidan' class='c_index_tongzhidan'/><div id='bi_index_xiangyingtongzhidan' class='icon_select2 c_index_select'></div></div><div class='c_index_numberContent_right'><div id='bi_index_xiangyingdanhao_okay' class='c_index_display icon_index_okay c_button_div'></div></div>";
- htmlStr+="</ul></div>";
- $("#i_index_left_head_list").append(htmlStr);
- $("#i_start_date").render();
- $("#i_end_date").render();
- $("#i_index_left_content").css({top:"150px"});
- loadResentWarnningNumber();
- $("#bi_index_xiangyingtongzhidan").on("click",function(){
- destorySelectList($(this));
- createXiangYingDan();
- return false;
- });
- $("#bi_index_yujingtongzhidan").on("click",function(){
- destorySelectList($(this));
- createYuJingDan();
- return false;
- });
-
- $("#bi_index_yujingdanhao_okay").on("click",function(){
- number=$("#i_index_select_yujingtongzhidan").text();
- changeAllViewData(number);
- });
- $("#bi_index_xiangyingdanhao_okay").on("click",function(){
- number=$("#i_index_select_xiangyingtongzhidan").text();
- changeAllViewData(number);
- });
-
- $("#bi_index_yujingdanhao_okay").click();
- $("#bi_index_xiangyingdanhao_okay").click();
- }
- /**
- * 销毁响应单号的选择列表
- */
- function destorySelectList($dom){
- $("body").not($dom).find(".c_index_selectList").each(function(){
- var _this=$(this);
- _this.animate({height:"0px"},"1000",function(){
- _this.remove();
- });
- });
-
- }
- /**
- * 加载响应通知单列表
- */
- function createXiangYingDan($dom){
- var start=$("#i_start_date").val();
- var end=$("#i_end_date").val();
- //if(end<start) top.Dialog.alert("截止时间大于起始时间,请您从新选择时间段",function(){});
- //alert(Date.parse(start));
- if(Date.parse(end)<Date.parse(start)) top.Dialog.alert("截止时间小于起始时间,请您从新选择时间段",function(){});
- $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getWarnningNumberInfo",{type:1,startTime:start+" 00:00:00",endTime:end+" 23:59:59",compId:urlJson["dept_id"]},function(result){
- if(result.rows.length==0)top.Dialog.alert("此时间段内尚未发布响应",function(){});
- createSelectList($("#i_index_select_xiangyingtongzhidan"),result.rows,"EARLY_WARNING_ID");
- $("#i_index_select_xiangyingtongzhidan").find("li").on("click",function(){
- $("#i_index_select_xiangyingtongzhidan").text($(this).text()).attr("title",$(this).text());
- $("#i_index_select_xiangyingtongzhidan").find(".c_index_selectList").remove();
- });
- },"json");
- };
- /**
- * 加载预警通知单列表
- */
- function createYuJingDan(){
- var start=$("#i_start_date").val();
- var end=$("#i_end_date").val();
- $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getWarnningNumberInfo",{type:0,startTime:start+" 00:00:00",endTime:end+" 23:59:59",compId:urlJson["dept_id"]},function(result){
- if(result.rows.length==0) top.Dialog.alert("此时间段内尚未发布预警",function(){});
- createSelectList($("#i_index_select_yujingtongzhidan"),result.rows,"EARLY_WARNING_ID");
- $("#i_index_select_yujingtongzhidan").find("li").on("click",function(){
- $("#i_index_select_yujingtongzhidan").text($(this).text()).attr("title",$(this).text());
- $("#i_index_select_yujingtongzhidan").find(".c_index_selectList").remove();
- });
- },"json");
- }
- /**
- * 初始化加载响应列表和预警列表的数据
- */
- function loadResentWarnningNumber(){
- $.ajax({
- url:url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getResentWarnningNumberInfo",
- data:{compId:urlJson["dept_id"]},
- type : 'post',
- dataType:"json",
- async:false,
- success:function(result){
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined ||result.rows[1]["RELEASE_RELIEVE_DATE"]!=undefined){
- number=result.rows[0]["RELEASE_RELIEVE_DATE"]> result.rows[1]["RELEASE_RELIEVE_DATE"]?result.rows[0]["EARLY_WARNING_ID"]:result.rows[1]["EARLY_WARNING_ID"];
- }
-
- if(result.rows[0]["EARLY_WARNING_ID"]==undefined){
- if($("#i_index_select_xiangyingtongzhidan").size()>0){
- $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
- }
- }else{
- if($("#i_index_select_xiangyingtongzhidan").size()>0){
- $("#i_index_select_xiangyingtongzhidan").text(result.rows[0]["EARLY_WARNING_ID"]).attr({title:result.rows[0]["EARLY_WARNING_ID"]});
- }
- }
- if(result.rows[1]["EARLY_WARNING_ID"]==undefined){
- if($("#i_index_select_yujingtongzhidan").size()>0){
- $("#i_index_select_yujingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
- }
- }else{
- if($("#i_index_select_yujingtongzhidan").size()>0){
- $("#i_index_select_yujingtongzhidan").text(result.rows[1]["EARLY_WARNING_ID"]).attr({title:result.rows[1]["EARLY_WARNING_ID"]});
- }
- }
- },error:function(e){
-
- }
- });
-
-
-
- /*
- $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getResentWarnningNumberInfo",{compId:urlJson["dept_id"]},function(result){
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined ||result.rows[1]["RELEASE_RELIEVE_DATE"]!=undefined){
- number=result.rows[0]["RELEASE_RELIEVE_DATE"]> result.rows[1]["RELEASE_RELIEVE_DATE"]?result.rows[0]["EARLY_WARNING_ID"]:result.rows[1]["EARLY_WARNING_ID"];
- }
-
- if(result.rows[0]["EARLY_WARNING_ID"]==undefined){
- if($("#i_index_select_xiangyingtongzhidan").size()>0){
- $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
- }
- }else{
- if($("#i_index_select_xiangyingtongzhidan").size()>0){
- $("#i_index_select_xiangyingtongzhidan").text(result.rows[0]["EARLY_WARNING_ID"]).attr({title:result.rows[0]["EARLY_WARNING_ID"]});
- }
- }
- if(result.rows[1]["EARLY_WARNING_ID"]==undefined){
- if($("#i_index_select_yujingtongzhidan").size()>0){
- $("#i_index_select_yujingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
- }
- }else{
- if($("#i_index_select_yujingtongzhidan").size()>0){
- $("#i_index_select_yujingtongzhidan").text(result.rows[1]["EARLY_WARNING_ID"]).attr({title:result.rows[1]["EARLY_WARNING_ID"]});
- }
- }
- },"json"); */
- }
- /**
- * 生成日期列表
- */
- function createDateList($dom){
- var year=getYear();
- var arrTemp=[];
- for(var index=0,len=parseInt(year)-startYear+1;index<len;index++){
- arrTemp.push({year:startYear+index});
- }
-
- createSelectList($dom,arrTemp,"year");
- $dom.find("li").on("click",function(){
- $dom.text($(this).text());
- $dom.find(".c_index_selectList").remove();
- ;
- });
- }
- /**
- * @param $dom 插入节点的富容器
- * @param arrParam 插入节点的数据
- * @param label 插入数据指定的标签
- */
- function createSelectList($dom,arrParam,label){
- var $domtemp=$dom.find(".c_index_selectList");
- if($domtemp.size()>0)
- $domtemp.remove();
- $domtemp=null;
- var htmlStr="<div class='c_index_selectList'><ul>";
- for(var index=0,len=arrParam.length;index<len;index++){
- htmlStr+="<li title='"+arrParam[index][label]+"'>"+arrParam[index][label]+"</li>";
- }
- htmlStr+="</ul></div>";
- $htmlStr=$(htmlStr);
- $dom.append($htmlStr);
- $dom.find(".c_index_selectList").find("li").each(function(){
- $(this).on("mouseenter",function(){
- $(this).addClass("c_number_color");
- }).on("mouseleave",function(){
- $(this).removeClass("c_number_color");
- });
- });
- }
- /**
- * 弹窗动画
- */
- /**
- * 绑定确定按钮点击事件
- */
- function bindEventOnOkayButton(){
- $(".icon_index_okay").on("mouseenter",function(){
- $(this).addClass("icon_index_okay2");
- }).on("mouseleave",function(){
- $(this).removeClass("icon_index_okay2");
- });
- $(".icon_index_cancle").on("mouseenter",function(){
- $(this).addClass("icon_index_cancle2");
- }).on("mouseleave",function(){
- $(this).removeClass("icon_index_cancle2");
- });
- }
- /**
- * 选择人工数据源
- */
- function changeSysDataSource(){
- var $dom = $(".c_index_left_maincontent").find(".c_index_numberContent");
- if($dom.size()>0)$dom.remove();
- $("#i_index_left_content").css({top:"40px"});
- $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
- if($(this).get(0).contentWindow.changeSysData!=undefined){
- $(this).get(0).contentWindow.changeSysData(number);
- }
- });
-
-
-
- }
- /**
- * 切换所有视图的风格
- */
- function changeAllViewStle(key){
- $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
- if($(this).get(0).contentWindow.rendPage!=undefined){
- $(this).get(0).contentWindow.rendPage(key);
- }
- });
- }
- /**
- *切换所有的数据
- */
- function changeAllViewData(number){
- if(dataSourceState==0){
- $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
- if($(this).get(0).contentWindow.rendPageData!=undefined){
- $(this).get(0).contentWindow.rendPageData(number);
- }
- });
- }else{
- changeSysDataSource();
- }
- };
- function changeDataSource(){
- if(dataSourceState==0){
- changePeoDataSource();
- $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
- if($(this).get(0).contentWindow.rendPageData!=undefined){
- $(this).get(0).contentWindow.rendPageData(number);
- }
- });
- }else{
- changeSysDataSource();
- }
- }
- /**
- * 展开和关闭侧栏
- */
- function openAndCloseLeftAside(){
- $("#i_index_left_switch").data("state",1);
- /**
- * 绑定鼠标点击事件
- */
- $("#i_index_left_switch").on("click",function(){
- if($("#i_index_left_switch").data("state")==1){
- //$(".c_index_system").parent().data("state",1);
- //$(".c_index_system").removeClass("c_index_people");
- $("#i_index_left div").hide();
- //$(".c_index_styleList").remove();
- //changeSysDataSource();
- /*$(".c_index_numberContent").hide();
- $(".c_index_styleList").hide();*/
- //$(".c_index_style").parent().data("state",1);
- /* $("#i_index_lcontent").css({"margin-left":"-300"});*/
- $("#i_index_rcontent").css({left:"15px"});
- $("#i_index_left_switch").css({left:"0px"});
- $("#i_index_left_switch").addClass("icon_index_aside_open");
- /*$("#i_index_left").off("mouseenter").off("mouseleave");*/
- $("#i_index_left_switch").data("state",2);
- /*$(".c_index_numberContent").css({display:"none"});
- $(".c_index_styleList").css({display:"none"});*/
-
- }else{
- /* $("#i_index_left").css({display:"inline-block"});*/
- $("#i_index_left div").css({display:"inline-block"});
- $("#i_index_left_head_list").css({display:"block"});
- $("#i_index_rcontent").css({left:"285px"});
- $("#i_index_left_switch").css({left:"262px"});
- $("#i_index_left_switch").removeClass("icon_index_aside_open");
- $("#i_index_left_switch").data("state",1);
-
- }
- });
-
- /* $("#i_index_left_switch").hide();
- mouseEnterAndLeave();
- */
-
-
- }
- /**
- * 鼠标移入移出事件
- */
- function mouseEnterAndLeave(){
- $("#i_index_left").on("mouseenter",function(){
- /*if($("#i_index_left_switch").data("state")==1){*/
- $("#i_index_left_switch").show();
- /*}*/
- }).on("mouseleave",function(){
- /*if($("#i_index_left_switch").data("state")==1){*/
- $("#i_index_left_switch").hide();
- /*}*/
- });
-
- }
- /**
- * 增加视图
- */
- function indexAddView(){
- $("#i_index_rcontent").find(".c_index_list").each(function(){
- $(this).attr("fd_objectid","000000");
- $(this).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
- });
- }
- /**
- * 保存视图
- */
- function indexSaveView(param){
- /**
- * 弹窗保存
- */
- function fn1(text){
- var temp=indexGetAddViewParam();
- var saveView={name:text,
- userId:urlJson["user_id"],
- roleId:urlJson["role_id"],
- conId:temp.conId,
- maticId:temp.maticId,
- screenState:2};
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/saveViewInfo",saveView,function(result){
- cockpit.createList($("#i_index_left_content"));
- temp();
- },"json");
- alt.destory();
- return;
- }
- function temp(){
- changeLayoutView((parseInt($("#bi_index_changeLayout").data("state"))+2)%3);
- }
- function fn2(text){
- /*temp();*/
- alt.destory();
- top.destoryIframeContent("i_index_maticlist");
- }
- var alt=new Alert({ok:fn1,cancle:fn2},
- {text:"视图名称: ",input:true});
- //创建节点
- alt.create("");
- }
- /**
- * 获取保存视图的参数
- */
- function indexGetAddViewParam(){
- var conId=[];
- var maticId=[];
- /*{"TM_URL":"page/cockpit/equipment_loss/equipment_loss_chart.html",
- "FD_OBJECTID":"0000005","UPDATEDATE":"0",
- "TM_AREAID":"0002",
- "AREA_NAME":"设备受损区",
- "TM_NAME":"设备损失统计图",
- "TM_USE":"1",
- "TM_IMGURL":"_icon_url_bar",
- "TM_LAYERID":"61","SC_DEPT_ID":"0","TM_BEX":"0","IS_DEL":"0"};*/
- $("#i_index_rcontent").find(".c_index_list").each(function(){
- conId.push($(this).attr("id"));
- if($(this).attr("fd_objectid")==undefined){
- maticId.push("0000");
- }else{
- maticId.push($(this).attr("fd_objectid"));
- }
- });
- return {conId:conId.join("-"),maticId:maticId.join("-")};
- }
- /**
- * 绑定编辑事件
- * @returns
- */
- function bindIndexEdit(){
- //判断是否为客户自定义的视图,如果为默认视图绑定客户自定义视图的事件
- if($("#i_index_left_content").find("ul[data='V_OFTEN']").size()>0){
- $("#i_index_left_content").find("ul[data='V_OFTEN']").eq(0).find(".c_index_list_item_li").each(function(){
- $(this).on("mouseenter",createIndeEdit).on("mouseleave",deleteIndexEdit);
- });
- }
-
- if(util.isRole(urlJson["role_id"], de.decode(role["admin"]))){
- if($("#i_index_left_content").find("ul[data='V_SYSTEM']").size()>0){
- $("#i_index_left_content").find("ul[data='V_SYSTEM']").eq(0).find(".c_index_list_item_li").each(function(){
- $(this).on("mouseenter",createIndeEdit).on("mouseleave",deleteIndexEdit);
- });
- }
- return false;
- }
-
- //判断是否为默认的视图,如果为默认视图绑定默认视图的事件
- if($("#i_index_left_content").find("ul[data='V_SYSTEM']").size()>0){
- createIndexSetOften(function(arrParam){
- $("#i_index_left_content").find("ul[data='V_SYSTEM']").eq(0).find(".c_index_list_item_li").each(function(){
- $(this).find("div.c_index_list_item_text").addClass("c_index_list_item_textAftershowBar");
- if(arrParam.indexOf($(this).data("data")["FD_OBJECTID"])>-1){
- $(this).append("<div class='c_index_list_item_showBar'><div class='c_index_list_item_often'></div></div>");
- }else{
- $(this).append("<div class='c_index_list_item_showBar'><div class='c_index_list_item_unoften'></div></div>");
- }
- });
- setOftenLayoutAndView();
- });
-
- }
- return false;
- }
- /**
- * 设置为常用视图
- */
- function setOftenLayoutAndView(){
- $("#i_index_left_content").find(".c_index_list_item_unoften").each(function(){
- $(this).on("click",function(){
- $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/setOftenLayoutAndViewInfo",
- {screenState:"2",userId:urlJson["user_id"],fd_objectId:$(this).parents(".c_index_list_item_li").data("data")["FD_OBJECTID"]},function(result){
- cockpit.createList($("#i_index_left_content"));
- },"json");
- });
-
- });
- return false;
- }
- /**
- * 删除编辑事件生成的节点
- */
- function deleteIndexEdit(){
- $(this).find(".c_index_list_item_text").removeClass("c_index_list_item_textAftershowBar");
- if($(this).find(".c_index_list_item_showBar").size()>0){
- $(this).find(".c_index_list_item_showBar").remove();
- }
-
- }
- /**
- * 增加编辑事件节点,修改,删除,设为默认,并未节点绑定事件
- */
- function createIndeEdit(){
- var arrParam=[{text:"设为默认",icon:"c_index_18_18 icon_index_edit_setdefault",fn:setDefaultLayoutAndView},
- {text:"删除",icon:"c_index_18_18 icon_index_edit_delete",fn:deleteLayoutAndView},
- {text:"修改",icon:"c_index_18_18 icon_index_edit_edit",fn:editLayoutAndView}
- ];
- indexEdit($(this),arrParam);
- }
- /**
- * 修改专题和视图
- */
- function editLayoutAndView($dom){
- var $tempdom =$dom.parents(".c_index_list_item_li");
- $tempdom.find(".c_index_list_item_text").find("span").hide();
- $tempdom.find(".c_index_list_item_text").prepend("<div class='c_edit_layoutItem_content'><input type='text' class='c_index_layoutItem_text' title='视图名称不超过30个汉字' value='"
- +$tempdom.find(".c_index_list_item_text").find("span").text()+"' id='i_index_layoutItem_text'/><div class='c_index_layoutItem_save icon_index_edit_save' id='i_index_layoutItem_save'/></div>");
- /* $("#i_index_layoutItem_text").on("focus",function(e){
- //$(this).get(0).value="";
- return false;
- });*/
- $("#i_index_layoutItem_text").on("click",function(){return false;});
- $("#i_index_layoutItem_save").on("click",function(e){
- editAndSaveLayoutAndView();
- return false;});
- }
- /**
- * 修改并保存布局与视图
- */
- function editAndSaveLayoutAndView(){
- var $tempdom=$("#i_index_layoutItem_save").parents("li.c_index_list_item_li");
- var objectId=$("#i_index_layoutItem_save").parents("li.c_index_list_item_li").data("data")["FD_OBJECTID"];
- var name=$("#i_index_layoutItem_text").val();
- var temp=indexGetAddViewParam();
- var saveView={
- userId:urlJson["user_id"],
- objectId:objectId,
- conId:temp.conId,
- name:name,
- maticId:temp.maticId,
- screenState:2};
- top.Dialog.confirm("是否修改专题视图",function(){
- $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/editLayouAndViewInfo",saveView,function(result){
- cockpit.createList($("#i_index_left_content"));
- bindIndexEdit();
- },"json");
- },function(){
- $tempdom.find(".c_index_list_item_text").find("span").show();
- $tempdom.find(".c_index_list_item_text").find(".c_edit_layoutItem_content").remove();
- });
- }
- /**
- * 设为常用视图专题
- */
- function createIndexSetOften(fn,state){
- if(state==1){
- top.Dialog.confirm("是否设为常用专题",function(){
- $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/getOftenLayoutAndViewInfo",{screenState:"2",userId:urlJson["user_id"]},function(result){
- fn(result.rows.join("-"));
- },"json");
- },function(){});
-
- }else{
- $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/getOftenLayoutAndViewInfo",{screenState:"2",userId:urlJson["user_id"]},function(result){
- fn(result.rows.join("-"));
- },"json");
- }
- };
- /**
- *设置默认布局
- */
- function setDefaultLayoutAndView($dom){
- var cockpitID=$dom.parents(".c_index_list_item_li").data("data")["FD_OBJECTID"];
- top.Dialog.confirm("是否设为默认专题",function(){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/setDefaultViewInfo",{screenState:"2",fd_objectid:cockpitID,userId:urlJson["user_id"],roleId:urlJson["role_id"]},function(result){
- },"json");
- },function(){});
-
- }
- /**
- * 删除布局
- */
- function deleteLayoutAndView($dom){
- var cockpitID=$dom.parents(".c_index_list_item_li").data("data")["FD_OBJECTID"];
- top.Dialog.confirm("是否删除视图",function(){
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/deleteViewInfo",{screenState:"2",fd_objectid:cockpitID},function(result){
- cockpit.createList($("#i_index_left_content"));
- },"json");
- },function(){});
- }
- /**
- * 追加编辑事件触发的节点
- */
- function indexEdit($dom,arrParam){
- if($dom.find(".c_index_list_item_showBar").size()>0){
- $dom.find(".c_index_list_item_showBar").remove();
- }
-
- $dom.find(".c_index_list_item_text").addClass("c_index_list_item_textAftershowBar");
- var htmlStr="<div class='c_index_list_item_showBar'><ul>";
- for(var index=0,len=arrParam.length;index<len;index++){
- htmlStr+="<li><div class='"+arrParam[index]["icon"]+"' title='"+arrParam[index]["text"]+"'></div></li>";
- };
- $dom.append(htmlStr);
- $dom.find(".c_index_list_item_showBar").find("li").each(function(i,item){
- $(this).on("click",function(){
- arrParam[i].fn($(this));
- return false;
- });
- });
- /* $dom.find(".c_index_list_item_showBar").find("ul").eq(1).find("li").each(function(i,item){
- $(this).on("click",function(){
- arrParam[i].fn($(this));
- });
- });*/
-
- }
- /**
- * 填充单个视图
- * @param $dom 视图容器
- */
- Cockpit.prototype.createMainView=function($dom){
- var htmlStr=
- '<div class="aaaaa"></div><div class="c_index_view1 c_index_view c_view_pic_zs "></div><div class="c_index_view2 c_index_view c_view_pic_zx" ></div><div class="c_index_view3 c_index_view c_view_pic_ys "></div>'+
- '<div class="c_index_view4 c_index_view c_view_pic_yx"></div><div class="c_index_viewh1 c_view_pic_sz"></div><div class="c_index_viewh2 c_view_pic_sy"></div>'+
- '<div class="c_index_viewv1 c_view_pic_hs"></div><div class="c_index_viewv2 c_view_pic_hx"></div><div class="c_index_view5"><iframe src="" name="" class="c_view_iframeContent" marginwidth="0px" marginheight="0px"></div>';
- $dom.append(htmlStr);
- htmlStr=null;
- };
- /**
- * 鼠标移入移出生成工具条列表
- * @param arrParam
- */
- //[{firstName:"展开",secondtName:"",firstIcon:"",secondIcon:"",fn:null}];
- Cockpit.prototype.createBarList=function(arrParam){
- $("#i_index_rcontent").find(".c_index_list").on("mouseenter",function(){
- var _this=this;
- if($(this).find(".c_list_content").size()>0){
- $(this).find(".c_list_content").remove();
- }
- var htmlStr="<div class='c_list_content'><ul>";
- for(var index=0,len=arrParam.length;index<len;index++){
- htmlStr+="<li ><div class='"+arrParam[index]["firstIcon"]+"' title="+arrParam[index]["firstName"]+"></div></li>";
- }
- htmlStr+="</ul></div>";
- $(_this).append(htmlStr);
- onClickList($(_this),arrParam);
- }).on("mouseleave",function(){
-
- if($(this).find(".c_list_content").size()>0){
- $(this).find(".c_list_content").remove();
- }
- $domContent=null;
- });
- };
- /**
- * 展开选择菜单列表
- * @param contentId 容器ID
- */
- function fn_open_list(contentId){
- if($("body").find("#i_index_maticlist").size()>0){
- $("body").find("#i_index_maticlist").remove();
- }
- var htmlStr="<div id='i_index_maticlist' class='c_index_maticlist'>";
- htmlStr +="<iframe id='i_index_iframe' name='i_index_iframe' class='c_index_iframe' scrolling='no' src='"+url["http_path"]+"page/cockpit/maticList/maticListZym.html?contentId="+contentId+"&&dept_id="+urlJson["dept_id"]+"' name='test' frameborder='0' >您的浏览器不支持框架,请升级您的浏览器以便正常访问脚本之家</iframe>";
- htmlStr+="</div>";
- $("body").append(htmlStr);
- }
- /**
- * 放大和缩小功能
- * @param contentId 容器ID
- * fangdaState:1为缩小状态,2为放大状态
- */
- function fn_open_large(contentId){
- if($("#"+contentId).data("fangdaState")==undefined || $("#"+contentId).data("fangdaState")==1){
- $("#"+contentId).data("cssWH",{"width":Math.round(parseInt($("#"+contentId).css("width"))/parseInt($("#"+contentId).parent().css("width"))*100)+"%",
- "height":Math.round(parseInt($("#"+contentId).css("height"))/parseInt($("#"+contentId).parent().css("height"))*100)+"%"});
-
- $("#"+contentId).addClass("c_index_large").css({"width":"100%","height":"100%"}).data("fangdaState","2");
- }else{
- $("#"+contentId).removeClass("c_index_large").css($("#"+contentId).data("cssWH")).data("fangdaState","1");
- }
- }
- /**
- * 刷新功能
- * @param contentId 容器ID
- */
- function fn_open_rend(contentId){
- var frame = $("#"+contentId).find("iframe").get(0);
- frame.contentWindow.document.location.reload();
-
- };
- /*function printDom(contentId){
- $($("#"+contentId).find("iframe").get(0).contentWindow.document).find("body").jqprint();
- var iframeWindow=$("#"+contentId).find("iframe").get(0).contentWindow;
- if(iframeWindow!=undefined || iframeWindow!=null){
- if($("#i_iframe_print").size()>0){
- $("#i_iframe_print").remove();
- }
- var $iframe=$('<iframe id="i_iframe_print" src="/nwyj/page/cockpit/print.html" style="width:400px;height:400px;" marginwidth="0px" marginheight="0px">');
- $iframe.appendTo($("body"));
- var opener=$iframe.get(0).contentWindow;
- $(opener).on("load",function(){
- var canvas=opener.document.querySelector("canvas");
- html2canvas($(iframeWindow.document).find("html"), {canvas:canvas,removeContainer:false,allowTaint:false}).then(function(canvas) {
- opener.print();
- });
- });
-
- }else{
- alert("iframeweikong");
- }
-
- }*/
- /**height:inherit
- * 关闭父容器的iframe容器
- * @param contentId
- * @returns
- */
- function destoryIframeContent(contentId){
- if($("#"+contentId).size()>0){
- $("#"+contentId).remove();
- }
- }
- /**
- * 改变视图容器的链接地址
- */
- function changeSite(id,jsonParam){
-
- var $dom=$("#"+id);
- $dom.attr("fd_objectid",jsonParam["FD_OBJECTID"]);
- /* if(jsonParam["TM_URL"].indexOf("http://")==0){*/
- loadPage($dom.find(".c_index_view5").find("iframe"),jsonParam["TM_URL"]);
- /* }else{
- loadPage($dom.find(".c_index_view5").find("iframe"),url.path+jsonParam["TM_URL"]);
- }*/
-
- }
- /**
- * loadPage
- */
- function loadPage($dom,siteString){
- var param={style:style,title:urlJson["dept_name"],number:number};
- if(siteString.indexOf("http://")==0){
- $dom.parent().css({top:"30px"});
- handleOutWebsite($dom, siteString);
- //$dom.attr("src",siteString);
- }else{
- $dom.parent().css({top:"6px"});
- param.dataSourceState=dataSourceState;
- /* alert(JSON.stringify(param));*/
- $dom.attr("src",url.path+siteString+window.location.search+"&&"+encodeURI($.param(param)));
- }
- }
- function handleOutWebsite($dom,siteString){
- // debugger;
- if(XMLContext[siteString.trim()]==undefined){
- $dom.attr("src",siteString);
- return;
- }
- XMLContext[siteString.trim()]($dom,siteString);
- }
- /**
- * 方法汇总
- */
- /**
- * 给工具条绑定点击事件
- */
- function onClickList($dom,arrParam){
- $dom.find("li").each(function(i){
- $(this).data("data",arrParam[i]).data("state",1);
- //绑定点击事件
- $(this).on("click",function(){
- if( $(this).data("state")==1){
- $(this).find("div").addClass($(this).data("data")["secondIcon"]);
- $(this).data("state")==2;
- }else{
- $(this).find("div").removeClass($(this).data("data")["secondIcon"]);
- }
- $(this).data("state",1);
- $(this).data("state",2);
-
- $(this).data("data").fn($(this).parents("div[id^='i_index_content']").attr("id"));
- });
- });
- }
- /**
- * 创建左侧视图选择列表
- */
- Cockpit.prototype.createList=function($dom,arrParam){
- /* {"SL_NAME":"2015雨雪冰冻灾害演练因灾损失统计","SL_PARAMENT":[{"column":"50%","SCREEN_STATE":"1","IS_COMMONUSE":"0",
- "SL_USERID":"R002105430214","FD_OBJECTID":"1018",
- "UPDATEDATE":"2015-12-19 23:10:19.247","IS_USE":"","TM_BEX":"0","IS_DEL":"0","SL_LAYOUTID":"0"}
- }*/
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getLayoutInfo",{screenId:"2",userId:urlJson["user_id"],roleId:urlJson["role_id"]},function(result){
- if(result["state"]=="SUCCESS"){
- var arrResult=[];
- if(result.rows.length>1){
- if(result.rows[0]["name"]=="R002105430214"){
- arrResult.push(result.rows[1]);
- arrResult.push(result.rows[0]);
- }else{
- arrResult.push(result.rows[0]);
- arrResult.push(result.rows[1]);
- }
- }else{
- arrResult=result.rows;
- }
- cockpit.createUlList($dom, arrResult, viewListClick);
- /***
- *
- * 再次加载列表时绑定事件
- *
- *
- * **/
- if($(".c_index_edit").parent().data("state")==2){
- bindIndexEdit();
- }
- }else{
- top.Dialog.alert("加载数据失败",function(){});
- }
- ;
- },"json");
- };
- /**
- * 创建ul-li列表
- * @param $dom
- * @param arrParam
- * @param fn
- */
- Cockpit.prototype.createUlList=function($dom,arrParam,fn){
- $dom.empty();
- if(arrParam.length==0)
- $dom.append("<div>目前尚无列表数据</div>");
- for(var index=0 ,len=arrParam.length;index<len;index++){
- if(arrParam[index].rows.length==0)
- continue;
- var ulTitle=null;
- var type=null;
- if(arrParam[index]["name"]=="R002105430214"){
- ulTitle="默认专题";
- type="V_SYSTEM";
- }else{
- ulTitle="常用专题";
- type="V_OFTEN";
- }
- if($dom.find("ul").size()==0){
- $dom.append("<div class='c_index_list_ul1_headz icon_index_list_ul1_headz'></div>" +
- "<div class='c_index_list_ul1_headc icon_index_list_ul1_headc'></div>" +
- "<div><div class='c_index_list_ul1_heady icon_index_list_ul1_heady'></div>" +
- "<div class='c_index_list_ul_head1'>"+ulTitle+"</div>");
- }else{
- $dom.append("<div class='c_index_list_ul1_headz icon_index_list_ul2_headz'></div>" +
- "<div class='c_index_list_ul1_headc icon_index_list_ul2_headc'></div>" +
- "<div class='c_index_list_ul1_heady icon_index_list_ul2_heady'></div>" +
- "<div class='c_index_list_ul_head1 c_index_list_ul_head2'>"+ulTitle+"</div>");
- }
- this.createUlLi($dom,arrParam[index].rows,type,fn);
-
- }
- };
- /**
- * 点击视图列表加载布局
- * @param jsonParam
- */
- function viewListClick(jsonParam){
- /**
- * 判断是否为增加视图状态
- * 如果为增加视图状态则恢复常规状态
- */
- if($(".c_index_add").size()>0 && $(".c_index_add").parent().data("state")==2){
- $(".c_index_add").parent().data("state",($(".c_index_add").parent().data("state")+1)%2);
- $(".c_index_add").removeClass("c_index_index_save");
- }
- /**
- * 加载页面
- */
- layoutNumber=jsonParam["FD_OBJECTID"];
- $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getViewInfo",{fd_objectid:jsonParam["FD_OBJECTID"]},function(result){
- /*indexAddView();*/
- loadPages(result.rows);
- },"json");
- }
- /**
- * 加载四张页面
- * @param 四张布局的参数
- */
- function loadPages(arrParam){
- $("#i_index_rcontent").find(".c_index_list").each(function(){
- var flag=true;
- for(var index=0,len=arrParam.length;index<len;index++){
- if($(this).attr("id")==arrParam[index]["OL_CONID"]){
- $(this).attr("fd_objectid",arrParam[index]["OL_MATICID"]);
- $(this).find("iframe").attr("name",$(this).attr("id"));
- loadPage($(this).find("iframe"),arrParam[index]["TM_URL"]);
- flag=false;
- continue;
- };
- };
- if(flag)$(this).find("iframe").attr("src","about:blank").removeAttr("name");
- });
- }
- /**
- * @param $dom 追加节点的容器
- * @param arrParam 追加节点的数据
- * @param fn 追加节点的回调函数
- */
- Cockpit.prototype.createUlLi=function($dom,arrParam,type,fn){
- if(arrParam.length==0)
- throw new Error("创建列表的数组长度为0");
- var ulStr="<ul class='c_index_left_content_ul' data="+type+">";
- for(var index=0,len=arrParam.length;index<len;index++){
- ulStr+="<li class='c_index_list_item_li'><div class='c_index_list_item_text'><span title='"+arrParam[index]["SL_NAME"]+"'>"+arrParam[index]["SL_NAME"]+"</span></div></li>";
- }
- ulStr+="</ul>";
- $dom.append(ulStr);
- if((typeof fn)!="function"){
- return;
- }
- $dom.find("ul").last().find("li").each(function(i){
- if(layoutNumber!=null && layoutNumber==arrParam[i]["FD_OBJECTID"]){
- $(this).addClass("c_click_view_item");
- }
- $(this).data("data",arrParam[i]).on("click",function(){
- fn($(this).data("data"));
- if($dom.find("li.c_click_view_item").size()>0){
- $dom.find("li.c_click_view_item").removeClass("c_click_view_item");
- }
- $(this).addClass("c_click_view_item");
- });
- });
-
- $dom.find(".c_index_list_item_li").on("mouseenter",function(){
- $(this).addClass("c_index_list_item_li_hover");
- //var $dom=$(this).find("span");
- /* $(this).find("span").animate({"margin":"-80px",opacity:0.1},"400",function(){
- $dom.css({"margin-left": "180px"});
- $dom.animate({"margin":"0px",opacity:1},"400");
- });*/
-
- }).on("mouseleave",function(){
- $(this).removeClass("c_index_list_item_li_hover");
- });
- };
- function getYear(){
- var date=allGetServerTime();
- return date.getFullYear();
-
- }
|