123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689 |
- /**
- * 显示的视图专题
- */
- var layoutNumber=null;
- var cockpit=null;
- var de=new Base64();
- var dataSourceState=1;
- var Synthesize=[];
- /**
- * 解析的参数
- */
- var urlJson=new Util().resolveUrl();
- /**
- * 工具类
- */
- var util=new Util();
- /**
- *
- */
- var number=null;
- var style="style1";
- var styleId=null;
- var endTime=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_close c_index_24_24",secondIcon:"c_index_close",fn:fn_close_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});
- $("#gis").attr({src:"/nwyj/page/cockpit/webgis_silverlight/webgis.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='打开GIS地图' 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, "gMap");
- window.open("/nwyj/page/cockpit/webgis_silverlight/webgis.html"+window.location.search, "gMap");
- //window.open("/nwyj/page/cockpit/baidu_map/webgis.html"+window.location.search, "bMap");
- /*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_refresh",icon2:"c_index_render",fn1:function(){cindexrender();}},
- {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_refresh",icon2:"c_index_render",fn1:function(){cindexrender();}},
- {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 cindexrender(){
- location.reload();
- }
- /**
- * 展开风格列表方法
- */
- 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);
- }
- $("#bi_index_time_okay").click();
- 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 renderDate(){
- //获取当前主题风格,用于设置日期控件的皮肤
- try {
- dateSkin=themeColor;
- }
- catch(e){};
- document.getElementById('i_alert_time').onfocus=function(){
- var $i_alert_time=$dp.$('i_alert_time');
- //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
- WdatePicker({skin:dateSkin,onpicked:function(){$i_alert_time.blur();},maxDate:'%y-%M-%d',
- minDate:'#F{$dp.$D(\'beginTime\')}'});
- };
- }
- /**
- * 选择系统数据源
- */
- 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' truetype='date' value='"+allGetServerTime().getFullYear()+"'/></div>";
- htmlStr+="<li><div class='c_index_numberContent_left c_index_year'>名称:</div><div class='c_index_numberContent_center'><input type='text' watermark='请输入事件名' id='i_chaxun' class='dt c_date'/></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>";
- htmlStr+="<li><div class='c_index_numberContent_left'>查询日期:</div><div class='c_index_numberContent_center'><input type='text' id='i_alert_time' class='dateIcon dt c_date' dateFmt='yyyy-MM-dd HH:mm' truetype='date' value='"+getDate(1).endTime+"'/><input type='hidden' id='beginTime' /></div><div class='c_index_numberContent_right'><div id='bi_index_time_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_chaxun").render();
- $("#i_alert_time").render();
- $("#i_index_left_content").css({top:"150px"});
- loadResentWarnningNumber();
- $("#bi_index_xiangyingtongzhidan").on("click",function(){
- destorySelectList($(this));
- createXiangYingDan();
- //createNewAlert();
- 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();
- $("#i_index_select_xiangyingtongzhidan").css({"background":"#546377"});
- $("#i_index_select_yujingtongzhidan").css({"background":"#3498db"});
- changeAllViewData(number);
- });
-
- $("#bi_index_chaxun_okay").on("click",function(){
- destorySelectList($(this));
- //createNewAlert();
- createXiangYingDan();
-
- });
-
- $("#bi_index_time_okay").on("click",function(){
- ChaXunTongZhiDan();
- changeAllViewData(number);
- });
-
- /*
- * 根据年份查询事件
- */
- document.getElementById('i_start_date').onchange=function(){
- destorySelectList($(this));
- //createNewAlert();
- createXiangYingDan();
- };
-
- $("#i_index_select_xiangyingtongzhidan").on("click",function(){
- //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
- var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
- $.ajax({
- url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
- data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
- type:"post",
- dataType:"json",
- async:false,
- success:function(result){
- //console.log("hhhhh"+result.rows[0]["EARLY_WARNING_ID"]);
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
- if(result.rows[0]["IS_ALERT"]==0){
- number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
- }else{
- number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
- }
- }else{
- number="";
- }
- },
- error:function(e){
- alert("通过事件加载最新一条通知单失败!");
- }
- });
-
- //number="响应|"+$("#i_index_select_xiangyingtongzhidan").text();
- $("#i_index_select_xiangyingtongzhidan").css({"background":"#3498db"});
- $("#i_index_select_yujingtongzhidan").css({"background":"#546377"});
- changeAllViewData(number);
- //alert(number);
- });
- /*
- * 查询框模糊查询加载事件
- */
- /* document.getElementById('i_chaxun').keyup=function(){
- destorySelectList($(this));
- //createNewAlert();
- createXiangYingDan();
- };*/
-
- $("#i_chaxun").keyup(function(){
- destorySelectList($(this));
- //createNewAlert();
- createXiangYingDan();
- });
-
- $("#bi_index_xiangyingdanhao_okay").on("click",function(){
- //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
- var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
- $.ajax({
- url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
- data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
- type:"post",
- dataType:"json",
- async:false,
- success:function(result){
- //console.log("hhhhh"+result.rows[0]["EARLY_WARNING_ID"]);
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
- if(result.rows[0]["IS_ALERT"]==0){
- number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
- }else{
- number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
- }
- }else{
- number="";
- }
- },
- error:function(e){
- alert("通过事件加载最新一条通知单失败!");
- }
- });
-
- //number="响应|"+$("#i_index_select_xiangyingtongzhidan").text();
- $("#i_index_select_xiangyingtongzhidan").css({"background":"#3498db"});
- $("#i_index_select_yujingtongzhidan").css({"background":"#546377"});
- changeAllViewData(number);
- //alert(number);
- });
-
- $("#bi_index_yujingdanhao_okay").click();
- //$("#bi_index_xiangyingdanhao_okay").click();
- $("#i_index_select_xiangyingtongzhidan").click();
- }
- function getTime(){
- var endTime = $("#i_alert_time").val();
- return endTime;
- }
- /**
- * 查询所输入日期的通知单号
- */
- function ChaXunTongZhiDan(){
- //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
- var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
- var time = $("#i_alert_time").val();
- $.ajax({
- url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertTZDInfo",
- data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"],time:time},
- type:"post",
- dataType:"json",
- async:false,
- success:function(result){
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
- if(result.rows[0]["IS_ALERT"]==0){
- number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
- }else{
- number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
- }
- }else{
- number="";
- }
- },
- error:function(e){
- //alert("通过事件加载最新一条通知单失败!");
- }
- });
- //alert("最新:"+number);
- }
- /**
- * 销毁事件的选择列表
- */
- 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 year=$("#i_start_date").val();
- //var end=$("#i_end_date").val();
- var alName=$("#i_chaxun").val();
- if(alName=="请输入事件名"){
- alName="";
- }
- var select_text = $("#i_index_select_xiangyingtongzhidan").text();
-
- //if(end<start) top.Dialog.alert("截止时间大于起始时间,请您从新选择时间段",function(){});
- //alert(Date.parse(start));
- //if(Date.parse(end)<Date.parse(start)) top.Dialog.alert("截止时间小于起始时间,请您从新选择时间段",function(){});
- $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAllAlertInfo",{year:year,compId:urlJson["dept_id"],alName:alName},function(result){
- //alert(JSON.stringify(result));
- if(result.rows.length==0){
- //top.Dialog.alert(year+"年尚未发布事件",function(){ $("#i_index_select_xiangyingtongzhidan").html("").attr("title","");});
- $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布事件").attr({title:"本年度尚未发布事件"});
- $("#i_index_select_xiangyingtongzhidan").data("fdId","");
- }
- $("#i_index_select_xiangyingtongzhidan").html(result.rows[0].EVENT_NAME).attr("title",result.rows[0].EVENT_NAME);
- createSelectList($("#i_index_select_xiangyingtongzhidan"),result.rows,"EVENT_NAME",select_text,"ISSUE_START_TIME","ISSUE_END_TIME","FD_OBJECTID");
- $("#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();
- var start= $(this).attr("data-start");
- var end = $(this).attr("data-end");
- var fdId = $(this).attr("data-fd_id");
- $("#i_index_select_xiangyingtongzhidan").data("fdId",fdId);
- $("#beginTime").val(start);
- renderDate();
- if(end==""||end==null||end==undefined||end=="0"){
- date = allGetServerTime();
- var currtime = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
-
- $("#i_alert_time").val(currtime);
- }else{
- $("#i_alert_time").val(end);
- }
- });
- },"json");
- };
- /**
- * 模糊查询并重新加载事件列表
- */
- /*function createNewAlert($dom){
- var year=$("#i_start_date").val();
- var alName=$("#i_chaxun").val();
- var select_text = $("#i_index_select_xiangyingtongzhidan").text();
- $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAllAlertInfoChaxun",{year:year,compId:urlJson["dept_id"],alName:alName},function(result){
- //alert(JSON.stringify(result));
- //if(result.rows.length==0)top.Dialog.alert("此时间段内尚未发布事件",function(){});
- createSelectList($("#i_index_select_xiangyingtongzhidan"),result.rows,"EVENT_NAME",select_text);
- $("#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();
- var select_text = $("#i_index_select_yujingtongzhidan").text();
- $.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",select_text);
- $("#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:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowInfo",
- data:{compId:urlJson["dept_id"],year:allGetServerTime().getFullYear()},
- type : 'post',
- dataType:"json",
- async:false,
- success:function(result){
- /*if(result.rows[0]["ISSUE_START_TIME"]!=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]["ISSUE_START_TIME"]==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]["EVENT_NAME"]).attr({title:result.rows[0]["FD_OBJECTID"]});
- var fdid = result.rows[0]["FD_OBJECTID"];
- $("#i_index_select_xiangyingtongzhidan").data("fdId",fdid);
- }
- }
- /*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){
-
- }
- });
- $("#i_index_select_xiangyingtongzhidan").render();
- //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
- var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
- $.ajax({
- url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
- data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
- type:"post",
- dataType:"json",
- async:false,
- success:function(result){
- //console.log(result.rows[0]);
- if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
- number=result.rows[0]["EARLY_WARNING_ID"];
- }
- },
- error:function(e){
- alert("通过事件加载最新一条通知单失败!");
- }
- });
-
- /*
- $.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,select_text,ISSUE_START_TIME,ISSUE_END_TIME,FD_OBJECTID){
- 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++){
- if(arrParam[index][label]==select_text){
- htmlStr+="<li data-start="+arrParam[index][ISSUE_START_TIME]+" data-end="+arrParam[index][ISSUE_END_TIME]+" data-fd_id="+arrParam[index][FD_OBJECTID]+" title='"+arrParam[index][label]+"' class='c_number_color_select'>"+arrParam[index][label]+"</li>";
-
- }else{
- htmlStr+="<li data-start="+arrParam[index][ISSUE_START_TIME]+" data-end="+arrParam[index][ISSUE_END_TIME]+" data-fd_id="+arrParam[index][FD_OBJECTID]+" 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();*/
- $("#i_index_left").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").show();
- $("#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 id = $($dom).attr("id");
- 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="'+id+'" 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,param){
- 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'>";
- var wnum = $("#"+contentId).attr("spn");
- 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"]+
- "&&subject="+param.subjectName+"&&subjectSubName4="+param.subjectSubName4+"&&subjectSubName3="+param.subjectSubName3+"&&subjectSubName2="+param.subjectSubName2+"&&subjectSubName1="+param.subjectSubName1+"&&wnum="+wnum+"' 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
- * fangdaState:1为缩小状态,2为放大状态
- */
- function fn_close_large(contentId){
- var sn = $("#"+contentId).attr("spn");
-
- if($(".c_index_subject_pbox"+sn).find(".c_index_view5").find("iframe").attr("src")=="about:blank"){
- return;
- };
-
- var $dom = $(".select_view").parent().next().find("ul").find(".charwin_checkbox"+sn).next().find("input").click();
- $(".c_index_subject_pbox"+sn).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
- $(".c_index_subject_pbox"+sn).find(".c_view_pic_hs").eq(0).empty();
-
- // //取消选中
- var checknum = $($dom).attr("checknum");
-
- $($dom).attr("checknum","0");
- $($dom).parent().prev().removeClass("charwin_checkbox"+sn).addClass("charwin_checkbox0").removeClass("charwin_checkbox1");
-
- var sdce = $($dom).parent().parent().parent().data("data");
- var old_bex = "0";
-
- if($($dom).parent().parent().parent().parent().parent().prev().find(".ci_title_box").find("span").html()=="组合展示"){
- old_bex = sdce.IS_SYNTHESIZE;
- sdce.IS_SYNTHESIZE = "0";
- }else{
- old_bex = sdce.TM_BEX;
- sdce.TM_BEX = "0";
- };
-
-
- $($dom).parent().parent().parent().data("data",sdce);
- var svce = $($dom).parent().parent().parent().parent().parent().prev().find(".ci_title_box").eq(0).attr("showView");
- if(svce=="1"){
- $(".c_index_subject_pbox"+old_bex).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
- $(".c_index_subject_pbox"+old_bex).find(".c_view_pic_hs").eq(0).empty();
- };
-
- var lenc = $(":checkbox[name='"+$($dom).attr("name")+"']:checked").length;
- if(lenc < 4){
- $("input[name='"+$($dom).attr("name")+"']").not("input:checked").each(function(){
- //alert($(this).next().children().next().attr("title"))
- $(this).removeAttr("disabled");
- });
- return;
- };
-
- }
- /**
- * 刷新功能
- * @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);
- if(jsonParam==undefined){
- $($dom).find(".c_index_view5").find("iframe").attr("src","about:blank").removeAttr("name");
- }else{
- $dom.attr("fd_objectid",jsonParam["FD_OBJECTID"]);
- loadPage($dom.find(".c_index_view5").find("iframe"),jsonParam["TM_URL"]);
- };
- // $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));*/
- endTime = $("#i_alert_time").val();
- $dom.attr("src",url.path+siteString+window.location.search+"&&"+encodeURI($.param(param))+"&&date_time="+endTime);
- }
- }
- function handleOutWebsite($dom,siteString){
- // debugger;
- if(XMLContext[siteString.trim()]==undefined){
- $dom.attr("src",siteString);
- return;
- }
- XMLContext[siteString.trim()]($dom,siteString,urlJson);
- }
- /**
- * 方法汇总
- */
- /**
- * 给工具条绑定点击事件
- */
- 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);
- var showData = {};
- $(".ci_title_box").each(function(){
- if($(this).attr("showview")=="1"){
- if($(this).data("data").name==undefined){
- showData.subjectName = "组合展示";
- }else{
- showData.subjectName = $(this).data("data").name;
- };
- var cnum = $(this).next().attr("checkboxnum");
-
- $(":checkbox[name='checkbox"+cnum+"']:checked").each(function(){
- var sd = $(this).parent().parent().parent().data("data");
- if($(this).parent().parent().parent().parent().parent().prev().find(".ci_title_box").find("span").html()=="组合展示"){
- showData.subjectName = "组合展示";
- showData["subjectSubName"+sd.IS_SYNTHESIZE] = sd.TM_NAME;
- }else{
- showData["subjectSubName"+sd.TM_BEX] = sd.TM_NAME;
- };
- });
- };
- });
- $(this).data("data").fn($(this).parents("div[id^='i_index_content']").attr("id"),showData);
- });
- });
- }
- /**
- * 创建左侧视图选择列表
- */
- 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="默认专题";
- 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);
- this.createSubjectList();
- }
-
-
-
- };
- Cockpit.prototype.createSubjectList = function(){
- $.post("/nwyj/ws/MaticService/MaticService/getMaticMapInfo", {comId:urlJson["dept_id"]}, function(result) {
- if (result.state == "SUCCESS") {
- var res = result.rows;
- var resSort = res.sort(function(a,b){
- return a.rows[0].SORT1 - b.rows[0].SORT1;
- });
-
- var specialty;
-
- for(var key in resSort){
-
- if(resSort[key]["name"]=="专业系统"){
- specialty = resSort[key];
- delete resSort[key];
- continue;
- };
-
- for(var sk in resSort[key].rows){
- Synthesize.push(resSort[key].rows[sk]);
- };
- };
-
- // leftWin.init(result.rows,Synthesize);
- leftWin.init(resSort,Synthesize);
- $(':input').labelauty();
-
- if(specialty){
- $("#i_index_left_content").append('<div class="c_index_list_ul1_headz icon_index_list_ul1_headz specialty_title" style="margin-top:20px;"></div>');
- $("#i_index_left_content").append('<div class="c_index_list_ul1_headc icon_index_list_ul1_headc specialty_title" style="margin-top:20px;"></div>');
- $("#i_index_left_content").append('<div class="specialty_title"><div class="c_index_list_ul1_heady icon_index_list_ul1_heady"></div><div class="c_index_list_ul_head1" style="margin-top:20px;">专业系统</div></div>');
- $("#i_index_left_content").append('<div id="specialty_count"></div>');
- leftWin.initSpecialtyCount(specialty);
- };
-
- return result;
- } else {
- top.Dialog.alert("加载失败!");
- }
- }, "json");
- };
- /**
- * 点击视图列表加载布局
- * @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");
- // 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();
-
- }
|