5c95461935950deaf341de9f8bdb9e5abe31d8f4.svn-base 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689
  1. /**
  2. * 显示的视图专题
  3. */
  4. var layoutNumber=null;
  5. var cockpit=null;
  6. var de=new Base64();
  7. var dataSourceState=1;
  8. var Synthesize=[];
  9. /**
  10. * 解析的参数
  11. */
  12. var urlJson=new Util().resolveUrl();
  13. /**
  14. * 工具类
  15. */
  16. var util=new Util();
  17. /**
  18. *
  19. */
  20. var number=null;
  21. var style="style1";
  22. var styleId=null;
  23. var endTime=null;
  24. $(function(){
  25. //IE浏览器默认全屏
  26. //defaultFullScreen();
  27. //进入页面获取通知单号
  28. $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getResentWarnningNumberInfo",{compId:urlJson["dept_id"]},function(result){
  29. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined ||result.rows[1]["RELEASE_RELIEVE_DATE"]!=undefined){
  30. 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"];
  31. }
  32. init();
  33. showView();
  34. },"json");
  35. });
  36. /**
  37. * 默认全屏操作
  38. */
  39. function defaultFullScreen(){
  40. util.isFullScreen(function(){util.fullScreen();},function(){});
  41. }
  42. /**
  43. * 初始化操作
  44. */
  45. function init(){
  46. cockpit=new Cockpit();
  47. //创建右侧视图容器
  48. $("#i_index_rcontent").find(".c_index_contenthw").each(function(){
  49. cockpit.createMainView($(this));
  50. });
  51. /**
  52. * 加载默认
  53. */
  54. loadDefalutStyle();
  55. //生成样式列表
  56. /* cockpit.createStyleList("",pageStle);*/
  57. //生成左侧头部工具栏
  58. //util.isRole(urlJson["role_id"],de.decode(role["admin"]))||util.isRole(urlJson["role_id"],de.decode(role["sale"]));
  59. 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"]))));
  60. //为左侧工具栏绑定事件
  61. 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"]))));
  62. //生成左侧视图布局列表
  63. //cockpit.createList($("#i_index_left_content"));
  64. //左侧工具栏展开与关闭参数
  65. var barList=[{firstName:"设置",secondtName:"设置",firstIcon:"c_index_open_list c_index_24_24",secondIcon:"",fn:fn_open_list},
  66. {firstName:"放大",secondtName:"缩小",firstIcon:"c_index_fangda c_index_24_24",secondIcon:"c_index_suoxiao",fn:fn_open_large},
  67. {firstName:"关闭",secondtName:"关闭",firstIcon:"c_index_close c_index_24_24",secondIcon:"c_index_close",fn:fn_close_large}
  68. /*{firstName:"刷新",secondtName:"刷新",firstIcon:"c_index_rend c_index_24_24",secondIcon:"",fn:fn_open_rend}*/
  69. /* {firstName:"打印",secondtName:"打印",firstIcon:"c_index_fangda c_index_18_18",secondIcon:"c_index_suoxiao",fn:function(contentId){alert("打印");printDom(contentId);}}*/
  70. ];
  71. //生成左侧工具条与设为常用的方法栏
  72. cockpit.createBarList(barList);
  73. //展开和关闭左侧
  74. openAndCloseLeftAside();
  75. $(document).on("click",function(){
  76. if($(".c_index_selectList").size()==0)return;
  77. $(".c_index_selectList").animate({height:"0px"},"1000",function(){
  78. $(".c_index_selectList").remove();
  79. });
  80. });
  81. //判断是否为IE浏览器,如果不是不加载GIS
  82. if ((navigator.userAgent.indexOf('MSIE') >= 0)
  83. && (navigator.userAgent.indexOf('Opera') < 0)){
  84. // $("#gis").attr({src:"/nwyj/page/cockpit/webgis/gis.html"+window.location.search});
  85. $("#gis").attr({src:"/nwyj/page/cockpit/webgis_silverlight/webgis.html"+window.location.search});
  86. }else{
  87. //信息提示,不是IE浏览器,不支持GIS展示。
  88. $("#i_index_main_content").empty();
  89. $("#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>");
  90. }
  91. }
  92. /**
  93. * 加载默认风格
  94. */
  95. function loadDefalutStyle(){
  96. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getDefaultStyle",{userId:urlJson["user_id"]},function(result){
  97. if(result.rows.length>0){
  98. style=result.rows[0]["STYLE"];
  99. styleId=result.rows[0]["FD_OBJECTID"];
  100. }
  101. /**
  102. * 加载默认专题
  103. */
  104. loadDefalut();
  105. },"json");
  106. }
  107. /**
  108. * 加载默认布局
  109. */
  110. function loadDefalut(){
  111. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getDefaultLayoutInfo",{screenId:'2',userId:urlJson["user_id"]},function(result){
  112. if(result.total>0){
  113. layoutNumber=result.data;
  114. //loadPages(result.rows[0].rows);
  115. }
  116. cockpit.createList($("#i_index_left_content"));
  117. },"json");
  118. }
  119. /**
  120. * 加载默认布局
  121. */
  122. function Cockpit(){}
  123. /**
  124. * 生成样式列表
  125. * @param $dom 存放样式列表的容器
  126. * @param jsonParam 样式列表的数据
  127. */
  128. Cockpit.prototype.createStyleList=function($dom,jsonParam){
  129. if(jsonParam == undefined)throw new Error("createStyleList参数数据不存在");
  130. if($dom==null || typeof $dom==undefined ||$dom=="")
  131. $("body").append("<div id='i_index_styleContent' class='c_index_styleContent'></div>");
  132. var htmlStr="<div><ul>";
  133. for(var item in jsonParam){
  134. htmlStr+="<li data="+item+">"+jsonParam[item].name+"</li>";
  135. }
  136. htmlStr+="</ul></div>";
  137. $("#i_index_left_head").append(htmlStr);
  138. };
  139. /**
  140. * 生成左侧的工具条[{text1:"编辑",text2:"取消编辑",icon1:"".icon2:"",fn1:"",fn:"";}];
  141. * @param $dom 追加节点的父类容器
  142. * @param arrParam 追加节点的参数
  143. */
  144. Cockpit.prototype.createTextBar=function($dom,arrParam){
  145. if(arrParam==undefined || arrParam.length==0)
  146. throw new Error("左侧标题数组为空");
  147. 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'>";
  148. for(var index=0,len=arrParam.length;index<len;index++){
  149. htmlStr+="<li class='c_index_left_head_li' ><div class='"+arrParam[index]["icon1"]+"' title='"+arrParam[index]["text1"]+"'></div></li>";
  150. }
  151. htmlStr+="</ul><div id='i_index_left_head_list' class='c_index_left_head_list'></div></div>";
  152. $dom.append(htmlStr);
  153. $("#bi_index_changeLayout").data("state","0").on("click",function(){
  154. changeLayoutView($(this).data("state"));
  155. //$(this).data("state",(parseInt($(this).data("state"))+1)%3);
  156. $(this).data("state",(parseInt($(this).data("state"))+1)%2);
  157. });
  158. };
  159. /**
  160. * 切换布局状态
  161. */
  162. function changeLayoutView(state){
  163. /* if(state==0){
  164. showGis();
  165. }else if(state==1){
  166. showViewAndGis();
  167. }else if(state==2){
  168. showView();
  169. }*/
  170. // window.open("/nwyj/page/cockpit/webgis/webgis.html"+window.location.search, "gMap");
  171. window.open("/nwyj/page/cockpit/webgis_silverlight/webgis.html"+window.location.search, "gMap");
  172. //window.open("/nwyj/page/cockpit/baidu_map/webgis.html"+window.location.search, "bMap");
  173. /*if(myBrowser().brow == "IE"){
  174. window.open("/nwyj/page/cockpit/webgis/webgis.html"+window.location.search, "gis地图", "", "");
  175. }else{
  176. window.open("/nwyj/page/cockpit/baidu_map/webgis.html"+window.location.search, "百度地图", "", "");
  177. };*/
  178. }
  179. /**
  180. * 显示GIS
  181. */
  182. function showGis(){
  183. $("#i_index_content3").css({left:"0px",right:"0px",width:"100%",height:"100%"});
  184. $("#i_index_content1").css({width:"0%",height:"0%"});
  185. $("#i_index_content2").css({width:"0%",height:"0%"});
  186. $("#i_index_content4").css({width:"0%",height:"0%"});
  187. $("#i_index_content5").css({width:"0%",height:"0%"});
  188. }
  189. /**
  190. * 显示视图
  191. */
  192. function showView(){
  193. $("#i_index_content3").css({left:"0",right:"0",width:"0%",height:"0%"});
  194. $("#i_index_content1").css({width:"50%",height:"50%"});
  195. $("#i_index_content2").css({width:"50%",height:"50%"});
  196. $("#i_index_content4").css({width:"50%",height:"50%"});
  197. $("#i_index_content5").css({width:"50%",height:"50%"});
  198. }
  199. /**
  200. * 显示GIS和视图
  201. */
  202. function showViewAndGis(){
  203. $("#i_index_content3").css({left:"25%",right:"25%",width:"50%",height:"100%"});
  204. $("#i_index_content1").css({width:"25%",height:"50%"});
  205. $("#i_index_content2").css({width:"25%",height:"50%"});
  206. $("#i_index_content4").css({width:"25%",height:"50%"});
  207. $("#i_index_content5").css({width:"25%",height:"50%"});
  208. }
  209. /**
  210. * 绑定左侧头部的文字事件
  211. * 全屏,退出全屏,修改,解除修改,增加保存
  212. * @param $dom
  213. * @param arrParam
  214. */
  215. Cockpit.prototype.bindClickOnTextBar=function($dom,arrParam){
  216. $dom.find("li").each(function(index,item){
  217. $(this).data("state","1");
  218. $(this).on("click",function(){
  219. if($(this).data("state")==1){
  220. $(this).data("state","2");
  221. arrParam[index].fn1();
  222. $(this).find("div").addClass(arrParam[index]["icon2"]);
  223. }else{
  224. $(this).data("state","1");
  225. arrParam[index].fn2();
  226. $(this).find("div").removeClass(arrParam[index]["icon2"]);
  227. }
  228. });
  229. });
  230. };
  231. /**
  232. * 获取左侧工具条的参数
  233. * @returns {Array}
  234. */
  235. Cockpit.prototype.getTextBarParam=function(flag){
  236. if(!flag){
  237. return [
  238. {text1:"全屏",text2:"退出全屏",icon1:"c_index_16_16 c_index_screen",icon2:"c_index_exitscreen",fn1:function(){util.fullScreenOpration();},fn2:function(){util.fullScreenOpration();}},
  239. {text1:"刷新",text2:"刷新",icon1:"c_index_16_16 c_index_refresh",icon2:"c_index_render",fn1:function(){cindexrender();}},
  240. {text1:"风格列表",text2:"风格列表",icon1:"c_index_16_16 c_index_style",icon2:"c_index_style1",fn1:function(){openStyleList(pageStyle);},fn2:closeListStyle},
  241. {text1:"人工数据源",text2:"系统数据源",icon1:"c_index_60_30 c_index_system",icon2:"c_index_people",
  242. fn1:function(){dataSourceState=0;changeDataSource();},
  243. fn2:function(){dataSourceState=1;changeDataSource();}}
  244. ];
  245. }else{
  246. return [
  247. /* {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"));}},*/
  248. {text1:"全屏",text2:"退出全屏",icon1:"c_index_16_16 c_index_screen",icon2:"c_index_exitscreen",fn1:function(){util.fullScreenOpration();},fn2:function(){util.fullScreenOpration();}},
  249. /* {text1:"增加",text2:"保存",icon1:"c_index_16_16 c_index_add",icon2:"c_index_index_save",fn1:function(){ showView();indexAddView();},fn2:function(){indexSaveView();}},*/
  250. {text1:"刷新",text2:"刷新",icon1:"c_index_16_16 c_index_refresh",icon2:"c_index_render",fn1:function(){cindexrender();}},
  251. {text1:"风格列表",text2:"风格列表",icon1:"c_index_16_16 c_index_style",icon2:"c_index_style1",fn1:function(){openStyleList(pageStyle);},fn2:closeListStyle},
  252. {text1:"人工数据源",text2:"系统数据源",icon1:"c_index_60_30 c_index_system",icon2:"c_index_people",
  253. fn1:function(){dataSourceState=0;changeDataSource();},
  254. fn2:function(){dataSourceState=1;changeDataSource();}}
  255. ];
  256. }
  257. };
  258. /**
  259. * 关闭风格列表
  260. */
  261. function closeListStyle(){
  262. var $dom = $("#i_index_left_head").find(".c_index_styleList");
  263. if($dom.size()>0)$dom.remove();
  264. }
  265. /**
  266. * 刷新
  267. */
  268. function cindexrender(){
  269. location.reload();
  270. }
  271. /**
  272. * 展开风格列表方法
  273. */
  274. function openStyleList(jsonParam){
  275. var $dom = $("#i_index_left_head_list").find(".c_index_styleList");
  276. if($dom.size()>0)$dom.remove();
  277. $dom=null;
  278. var htmlStr="<div class='c_index_styleList'><h2 class='c_index_styleList_head'>选择风格类型:</h2><ul>";
  279. for(var item in jsonParam){
  280. htmlStr+="<li data='"+item+"'><div title='"+jsonParam[item]["name"]+"' class='c_index_styleItem "+jsonParam[item]["iconClass"]+"'></div></li>";
  281. }
  282. $("#i_index_left_head_list").append(htmlStr);
  283. $("#i_index_left_head_list").find(".c_index_styleList").find("li").each(function(){
  284. $(this).on("click",function(){
  285. var _style=$(this).attr("data");
  286. style=_style;
  287. changeAllViewStle(_style);
  288. if(styleId!=null){
  289. editUserSelfStyle(styleId,_style);
  290. }else{
  291. saveUserSelfStyle(urlJson["user_id"],_style);
  292. }
  293. $("#bi_index_time_okay").click();
  294. return false;
  295. }).on("mouseenter",function(){
  296. var $this=$(this).find("div");
  297. $(this).find("div").addClass("c_moveIn_li").animate({"background-size":"25px",opacity:0.5},"300",function(){
  298. $this.animate({"background-size":"30px",opacity:1},"300");
  299. });
  300. return false;
  301. }).on("mouseleave",function(){
  302. $(this).find("div").removeClass("c_moveIn_li");
  303. return false;
  304. });
  305. });
  306. };
  307. /**
  308. * 保存用户自定义样式列表
  309. */
  310. function saveUserSelfStyle(userId,style){
  311. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/saveDefaultStyle",{userId:userId,style:style},function(result){
  312. },"json");
  313. }
  314. /**
  315. * 修改用户自定义样式列表
  316. */
  317. function editUserSelfStyle(styleId,style){
  318. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/editDefaultStyle",{styleId:styleId,style:style},function(result){
  319. },"json");
  320. }
  321. /**
  322. * 加载通知单
  323. */
  324. function loadTongZhiDanData(){
  325. var startTime=param+"-01-01 00:00:00";
  326. var endTime=parseInt(param)+1+"-01-01 23:59:59";
  327. $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getWarnningNumberInfo",{startTime:startTime,endTime:endTime,compId:urlJson["dept_id"]},function(result){
  328. },"json");
  329. }
  330. /***重置日期框***/
  331. function renderDate(){
  332. //获取当前主题风格,用于设置日期控件的皮肤
  333. try {
  334. dateSkin=themeColor;
  335. }
  336. catch(e){};
  337. document.getElementById('i_alert_time').onfocus=function(){
  338. var $i_alert_time=$dp.$('i_alert_time');
  339. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  340. WdatePicker({skin:dateSkin,onpicked:function(){$i_alert_time.blur();},maxDate:'%y-%M-%d',
  341. minDate:'#F{$dp.$D(\'beginTime\')}'});
  342. };
  343. }
  344. /**
  345. * 选择系统数据源
  346. */
  347. function changePeoDataSource(){
  348. var $dom = $("#i_index_left_head_list").find(".c_index_numberContent");
  349. if($dom.size()>0)$dom.remove();
  350. var htmlStr="<div class='c_index_numberContent'><ul>";
  351. 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>";
  352. 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>";
  353. 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>";
  354. 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>";
  355. htmlStr+="</ul></div>";
  356. $("#i_index_left_head_list").append(htmlStr);
  357. $("#i_start_date").render();
  358. //$("#i_end_date").render();
  359. $("#i_chaxun").render();
  360. $("#i_alert_time").render();
  361. $("#i_index_left_content").css({top:"150px"});
  362. loadResentWarnningNumber();
  363. $("#bi_index_xiangyingtongzhidan").on("click",function(){
  364. destorySelectList($(this));
  365. createXiangYingDan();
  366. //createNewAlert();
  367. return false;
  368. });
  369. $("#bi_index_yujingtongzhidan").on("click",function(){
  370. destorySelectList($(this));
  371. createYuJingDan();
  372. return false;
  373. });
  374. $("#bi_index_yujingdanhao_okay").on("click",function(){
  375. number="预警|"+$("#i_index_select_yujingtongzhidan").text();
  376. $("#i_index_select_xiangyingtongzhidan").css({"background":"#546377"});
  377. $("#i_index_select_yujingtongzhidan").css({"background":"#3498db"});
  378. changeAllViewData(number);
  379. });
  380. $("#bi_index_chaxun_okay").on("click",function(){
  381. destorySelectList($(this));
  382. //createNewAlert();
  383. createXiangYingDan();
  384. });
  385. $("#bi_index_time_okay").on("click",function(){
  386. ChaXunTongZhiDan();
  387. changeAllViewData(number);
  388. });
  389. /*
  390. * 根据年份查询事件
  391. */
  392. document.getElementById('i_start_date').onchange=function(){
  393. destorySelectList($(this));
  394. //createNewAlert();
  395. createXiangYingDan();
  396. };
  397. $("#i_index_select_xiangyingtongzhidan").on("click",function(){
  398. //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
  399. var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
  400. $.ajax({
  401. url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
  402. data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
  403. type:"post",
  404. dataType:"json",
  405. async:false,
  406. success:function(result){
  407. //console.log("hhhhh"+result.rows[0]["EARLY_WARNING_ID"]);
  408. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
  409. if(result.rows[0]["IS_ALERT"]==0){
  410. number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
  411. }else{
  412. number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
  413. }
  414. }else{
  415. number="";
  416. }
  417. },
  418. error:function(e){
  419. alert("通过事件加载最新一条通知单失败!");
  420. }
  421. });
  422. //number="响应|"+$("#i_index_select_xiangyingtongzhidan").text();
  423. $("#i_index_select_xiangyingtongzhidan").css({"background":"#3498db"});
  424. $("#i_index_select_yujingtongzhidan").css({"background":"#546377"});
  425. changeAllViewData(number);
  426. //alert(number);
  427. });
  428. /*
  429. * 查询框模糊查询加载事件
  430. */
  431. /* document.getElementById('i_chaxun').keyup=function(){
  432. destorySelectList($(this));
  433. //createNewAlert();
  434. createXiangYingDan();
  435. };*/
  436. $("#i_chaxun").keyup(function(){
  437. destorySelectList($(this));
  438. //createNewAlert();
  439. createXiangYingDan();
  440. });
  441. $("#bi_index_xiangyingdanhao_okay").on("click",function(){
  442. //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
  443. var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
  444. $.ajax({
  445. url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
  446. data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
  447. type:"post",
  448. dataType:"json",
  449. async:false,
  450. success:function(result){
  451. //console.log("hhhhh"+result.rows[0]["EARLY_WARNING_ID"]);
  452. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
  453. if(result.rows[0]["IS_ALERT"]==0){
  454. number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
  455. }else{
  456. number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
  457. }
  458. }else{
  459. number="";
  460. }
  461. },
  462. error:function(e){
  463. alert("通过事件加载最新一条通知单失败!");
  464. }
  465. });
  466. //number="响应|"+$("#i_index_select_xiangyingtongzhidan").text();
  467. $("#i_index_select_xiangyingtongzhidan").css({"background":"#3498db"});
  468. $("#i_index_select_yujingtongzhidan").css({"background":"#546377"});
  469. changeAllViewData(number);
  470. //alert(number);
  471. });
  472. $("#bi_index_yujingdanhao_okay").click();
  473. //$("#bi_index_xiangyingdanhao_okay").click();
  474. $("#i_index_select_xiangyingtongzhidan").click();
  475. }
  476. function getTime(){
  477. var endTime = $("#i_alert_time").val();
  478. return endTime;
  479. }
  480. /**
  481. * 查询所输入日期的通知单号
  482. */
  483. function ChaXunTongZhiDan(){
  484. //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
  485. var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
  486. var time = $("#i_alert_time").val();
  487. $.ajax({
  488. url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertTZDInfo",
  489. data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"],time:time},
  490. type:"post",
  491. dataType:"json",
  492. async:false,
  493. success:function(result){
  494. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
  495. if(result.rows[0]["IS_ALERT"]==0){
  496. number="预警|"+result.rows[0]["EARLY_WARNING_ID"];
  497. }else{
  498. number="响应|"+result.rows[0]["EARLY_WARNING_ID"];
  499. }
  500. }else{
  501. number="";
  502. }
  503. },
  504. error:function(e){
  505. //alert("通过事件加载最新一条通知单失败!");
  506. }
  507. });
  508. //alert("最新:"+number);
  509. }
  510. /**
  511. * 销毁事件的选择列表
  512. */
  513. function destorySelectList($dom){
  514. $("body").not($dom).find(".c_index_selectList").each(function(){
  515. var _this=$(this);
  516. _this.animate({height:"0px"},"1000",function(){
  517. _this.remove();
  518. });
  519. });
  520. }
  521. /**
  522. * 加载事件列表
  523. */
  524. function createXiangYingDan($dom){
  525. var year=$("#i_start_date").val();
  526. //var end=$("#i_end_date").val();
  527. var alName=$("#i_chaxun").val();
  528. if(alName=="请输入事件名"){
  529. alName="";
  530. }
  531. var select_text = $("#i_index_select_xiangyingtongzhidan").text();
  532. //if(end<start) top.Dialog.alert("截止时间大于起始时间,请您从新选择时间段",function(){});
  533. //alert(Date.parse(start));
  534. //if(Date.parse(end)<Date.parse(start)) top.Dialog.alert("截止时间小于起始时间,请您从新选择时间段",function(){});
  535. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAllAlertInfo",{year:year,compId:urlJson["dept_id"],alName:alName},function(result){
  536. //alert(JSON.stringify(result));
  537. if(result.rows.length==0){
  538. //top.Dialog.alert(year+"年尚未发布事件",function(){ $("#i_index_select_xiangyingtongzhidan").html("").attr("title","");});
  539. $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布事件").attr({title:"本年度尚未发布事件"});
  540. $("#i_index_select_xiangyingtongzhidan").data("fdId","");
  541. }
  542. $("#i_index_select_xiangyingtongzhidan").html(result.rows[0].EVENT_NAME).attr("title",result.rows[0].EVENT_NAME);
  543. createSelectList($("#i_index_select_xiangyingtongzhidan"),result.rows,"EVENT_NAME",select_text,"ISSUE_START_TIME","ISSUE_END_TIME","FD_OBJECTID");
  544. $("#i_index_select_xiangyingtongzhidan").find("li").on("click",function(){
  545. $("#i_index_select_xiangyingtongzhidan").text($(this).text()).attr("title",$(this).text());
  546. $("#i_index_select_xiangyingtongzhidan").find(".c_index_selectList").remove();
  547. var start= $(this).attr("data-start");
  548. var end = $(this).attr("data-end");
  549. var fdId = $(this).attr("data-fd_id");
  550. $("#i_index_select_xiangyingtongzhidan").data("fdId",fdId);
  551. $("#beginTime").val(start);
  552. renderDate();
  553. if(end==""||end==null||end==undefined||end=="0"){
  554. date = allGetServerTime();
  555. var currtime = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
  556. $("#i_alert_time").val(currtime);
  557. }else{
  558. $("#i_alert_time").val(end);
  559. }
  560. });
  561. },"json");
  562. };
  563. /**
  564. * 模糊查询并重新加载事件列表
  565. */
  566. /*function createNewAlert($dom){
  567. var year=$("#i_start_date").val();
  568. var alName=$("#i_chaxun").val();
  569. var select_text = $("#i_index_select_xiangyingtongzhidan").text();
  570. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAllAlertInfoChaxun",{year:year,compId:urlJson["dept_id"],alName:alName},function(result){
  571. //alert(JSON.stringify(result));
  572. //if(result.rows.length==0)top.Dialog.alert("此时间段内尚未发布事件",function(){});
  573. createSelectList($("#i_index_select_xiangyingtongzhidan"),result.rows,"EVENT_NAME",select_text);
  574. $("#i_index_select_xiangyingtongzhidan").find("li").on("click",function(){
  575. $("#i_index_select_xiangyingtongzhidan").text($(this).text()).attr("title",$(this).text());
  576. $("#i_index_select_xiangyingtongzhidan").find(".c_index_selectList").remove();
  577. });
  578. },"json");
  579. }*/
  580. /**
  581. * 加载预警通知单列表
  582. */
  583. function createYuJingDan(){
  584. var start=$("#i_start_date").val();
  585. var end=$("#i_end_date").val();
  586. var select_text = $("#i_index_select_yujingtongzhidan").text();
  587. $.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){
  588. if(result.rows.length==0) top.Dialog.alert("此时间段内尚未发布预警",function(){});
  589. createSelectList($("#i_index_select_yujingtongzhidan"),result.rows,"EARLY_WARNING_ID",select_text);
  590. $("#i_index_select_yujingtongzhidan").find("li").on("click",function(){
  591. $("#i_index_select_yujingtongzhidan").text($(this).text()).attr("title",$(this).text());
  592. $("#i_index_select_yujingtongzhidan").find(".c_index_selectList").remove();
  593. });
  594. },"json");
  595. }
  596. /**
  597. * 初始化事件数据(当前年份最新一条事件)
  598. */
  599. function loadResentWarnningNumber(){
  600. $.ajax({
  601. url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowInfo",
  602. data:{compId:urlJson["dept_id"],year:allGetServerTime().getFullYear()},
  603. type : 'post',
  604. dataType:"json",
  605. async:false,
  606. success:function(result){
  607. /*if(result.rows[0]["ISSUE_START_TIME"]!=undefined){
  608. 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"];
  609. }*/
  610. if(result.rows[0]["ISSUE_START_TIME"]==undefined){
  611. if($("#i_index_select_xiangyingtongzhidan").size()>0){
  612. $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布事件").attr({title:"本年度尚未发布事件"});
  613. }
  614. }else{
  615. if($("#i_index_select_xiangyingtongzhidan").size()>0){
  616. $("#i_index_select_xiangyingtongzhidan").text(result.rows[0]["EVENT_NAME"]).attr({title:result.rows[0]["FD_OBJECTID"]});
  617. var fdid = result.rows[0]["FD_OBJECTID"];
  618. $("#i_index_select_xiangyingtongzhidan").data("fdId",fdid);
  619. }
  620. }
  621. /*if(result.rows[1]["EARLY_WARNING_ID"]==undefined){
  622. if($("#i_index_select_yujingtongzhidan").size()>0){
  623. $("#i_index_select_yujingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
  624. }
  625. }else{
  626. if($("#i_index_select_yujingtongzhidan").size()>0){
  627. $("#i_index_select_yujingtongzhidan").text(result.rows[1]["EARLY_WARNING_ID"]).attr({title:result.rows[1]["EARLY_WARNING_ID"]});
  628. }
  629. }*/
  630. },error:function(e){
  631. }
  632. });
  633. $("#i_index_select_xiangyingtongzhidan").render();
  634. //var alertName=$("#i_index_select_xiangyingtongzhidan").html();
  635. var fd_objectid = $("#i_index_select_xiangyingtongzhidan").data("fdId");
  636. $.ajax({
  637. url:"/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getAlertNowNumberInfo",
  638. data:{fd_objectid:fd_objectid,compId:urlJson["dept_id"],compId:urlJson["dept_id"]},
  639. type:"post",
  640. dataType:"json",
  641. async:false,
  642. success:function(result){
  643. //console.log(result.rows[0]);
  644. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined){
  645. number=result.rows[0]["EARLY_WARNING_ID"];
  646. }
  647. },
  648. error:function(e){
  649. alert("通过事件加载最新一条通知单失败!");
  650. }
  651. });
  652. /*
  653. $.post(url["http_path"]+"ws/ChartServiceImpl/ChartServiceImpl/getResentWarnningNumberInfo",{compId:urlJson["dept_id"]},function(result){
  654. if(result.rows[0]["RELEASE_RELIEVE_DATE"]!=undefined ||result.rows[1]["RELEASE_RELIEVE_DATE"]!=undefined){
  655. 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"];
  656. }
  657. if(result.rows[0]["EARLY_WARNING_ID"]==undefined){
  658. if($("#i_index_select_xiangyingtongzhidan").size()>0){
  659. $("#i_index_select_xiangyingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
  660. }
  661. }else{
  662. if($("#i_index_select_xiangyingtongzhidan").size()>0){
  663. $("#i_index_select_xiangyingtongzhidan").text(result.rows[0]["EARLY_WARNING_ID"]).attr({title:result.rows[0]["EARLY_WARNING_ID"]});
  664. }
  665. }
  666. if(result.rows[1]["EARLY_WARNING_ID"]==undefined){
  667. if($("#i_index_select_yujingtongzhidan").size()>0){
  668. $("#i_index_select_yujingtongzhidan").text("本年度尚未发布响应预警").attr({title:"本年度尚未发布响应预警"});
  669. }
  670. }else{
  671. if($("#i_index_select_yujingtongzhidan").size()>0){
  672. $("#i_index_select_yujingtongzhidan").text(result.rows[1]["EARLY_WARNING_ID"]).attr({title:result.rows[1]["EARLY_WARNING_ID"]});
  673. }
  674. }
  675. },"json"); */
  676. }
  677. /**
  678. * 生成日期列表
  679. */
  680. function createDateList($dom){
  681. var year=getYear();
  682. var arrTemp=[];
  683. for(var index=0,len=parseInt(year)-startYear+1;index<len;index++){
  684. arrTemp.push({year:startYear+index});
  685. }
  686. createSelectList($dom,arrTemp,"year");
  687. $dom.find("li").on("click",function(){
  688. $dom.text($(this).text());
  689. $dom.find(".c_index_selectList").remove();
  690. ;
  691. });
  692. }
  693. /**
  694. * @param $dom 插入节点的富容器
  695. * @param arrParam 插入节点的数据
  696. * @param label 插入数据指定的标签
  697. */
  698. function createSelectList($dom,arrParam,label,select_text,ISSUE_START_TIME,ISSUE_END_TIME,FD_OBJECTID){
  699. var $domtemp=$dom.find(".c_index_selectList");
  700. if($domtemp.size()>0)
  701. $domtemp.remove();
  702. $domtemp=null;
  703. var htmlStr="<div class='c_index_selectList'><ul>";
  704. for(var index=0,len=arrParam.length;index<len;index++){
  705. if(arrParam[index][label]==select_text){
  706. 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>";
  707. }else{
  708. 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>";
  709. };
  710. }
  711. htmlStr+="</ul></div>";
  712. $htmlStr=$(htmlStr);
  713. $dom.append($htmlStr);
  714. $dom.find(".c_index_selectList").find("li").each(function(){
  715. $(this).on("mouseenter",function(){
  716. $(this).addClass("c_number_color");
  717. }).on("mouseleave",function(){
  718. $(this).removeClass("c_number_color");
  719. });
  720. });
  721. }
  722. /**
  723. * 弹窗动画
  724. */
  725. /**
  726. * 绑定确定按钮点击事件
  727. */
  728. function bindEventOnOkayButton(){
  729. $(".icon_index_okay").on("mouseenter",function(){
  730. $(this).addClass("icon_index_okay2");
  731. }).on("mouseleave",function(){
  732. $(this).removeClass("icon_index_okay2");
  733. });
  734. $(".icon_index_cancle").on("mouseenter",function(){
  735. $(this).addClass("icon_index_cancle2");
  736. }).on("mouseleave",function(){
  737. $(this).removeClass("icon_index_cancle2");
  738. });
  739. }
  740. /**
  741. * 选择人工数据源
  742. */
  743. function changeSysDataSource(){
  744. var $dom = $(".c_index_left_maincontent").find(".c_index_numberContent");
  745. if($dom.size()>0)$dom.remove();
  746. $("#i_index_left_content").css({top:"40px"});
  747. $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
  748. if($(this).get(0).contentWindow.changeSysData!=undefined){
  749. $(this).get(0).contentWindow.changeSysData(number);
  750. }
  751. });
  752. }
  753. /**
  754. * 切换所有视图的风格
  755. */
  756. function changeAllViewStle(key){
  757. $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
  758. if($(this).get(0).contentWindow.rendPage!=undefined){
  759. $(this).get(0).contentWindow.rendPage(key);
  760. }
  761. });
  762. }
  763. /**
  764. *切换所有的数据
  765. */
  766. function changeAllViewData(number){
  767. if(dataSourceState==0){
  768. $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
  769. if($(this).get(0).contentWindow.rendPageData!=undefined){
  770. $(this).get(0).contentWindow.rendPageData(number);
  771. }
  772. });
  773. }else{
  774. changeSysDataSource();
  775. }
  776. };
  777. function changeDataSource(){
  778. if(dataSourceState==0){
  779. changePeoDataSource();
  780. $("#i_index_main").find(".c_index_list").find("iframe").each(function(){
  781. if($(this).get(0).contentWindow.rendPageData!=undefined){
  782. $(this).get(0).contentWindow.rendPageData(number);
  783. }
  784. });
  785. }else{
  786. changeSysDataSource();
  787. }
  788. }
  789. /**
  790. * 展开和关闭侧栏
  791. */
  792. function openAndCloseLeftAside(){
  793. $("#i_index_left_switch").data("state",1);
  794. /**
  795. * 绑定鼠标点击事件
  796. */
  797. $("#i_index_left_switch").on("click",function(){
  798. if($("#i_index_left_switch").data("state")==1){
  799. //$(".c_index_system").parent().data("state",1);
  800. //$(".c_index_system").removeClass("c_index_people");
  801. /*$("#i_index_left div").hide();*/
  802. $("#i_index_left").hide();
  803. //$(".c_index_styleList").remove();
  804. //changeSysDataSource();
  805. /*$(".c_index_numberContent").hide();
  806. $(".c_index_styleList").hide();*/
  807. //$(".c_index_style").parent().data("state",1);
  808. /* $("#i_index_lcontent").css({"margin-left":"-300"});*/
  809. $("#i_index_rcontent").css({left:"15px"});
  810. $("#i_index_left_switch").css({left:"0px"});
  811. $("#i_index_left_switch").addClass("icon_index_aside_open");
  812. /*$("#i_index_left").off("mouseenter").off("mouseleave");*/
  813. $("#i_index_left_switch").data("state",2);
  814. /*$(".c_index_numberContent").css({display:"none"});
  815. $(".c_index_styleList").css({display:"none"});*/
  816. }else{
  817. /* $("#i_index_left").css({display:"inline-block"});*/
  818. /*$("#i_index_left div").css({display:"inline-block"});*/
  819. $("#i_index_left").show();
  820. $("#i_index_left_head_list").css({display:"block"});
  821. $("#i_index_rcontent").css({left:"285px"});
  822. $("#i_index_left_switch").css({left:"262px"});
  823. $("#i_index_left_switch").removeClass("icon_index_aside_open");
  824. $("#i_index_left_switch").data("state",1);
  825. }
  826. });
  827. /* $("#i_index_left_switch").hide();
  828. mouseEnterAndLeave();
  829. */
  830. }
  831. /**
  832. * 鼠标移入移出事件
  833. */
  834. function mouseEnterAndLeave(){
  835. $("#i_index_left").on("mouseenter",function(){
  836. /*if($("#i_index_left_switch").data("state")==1){*/
  837. $("#i_index_left_switch").show();
  838. /*}*/
  839. }).on("mouseleave",function(){
  840. /*if($("#i_index_left_switch").data("state")==1){*/
  841. $("#i_index_left_switch").hide();
  842. /*}*/
  843. });
  844. }
  845. /**
  846. * 增加视图
  847. */
  848. function indexAddView(){
  849. $("#i_index_rcontent").find(".c_index_list").each(function(){
  850. $(this).attr("fd_objectid","000000");
  851. $(this).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
  852. });
  853. }
  854. /**
  855. * 保存视图
  856. */
  857. function indexSaveView(param){
  858. /**
  859. * 弹窗保存
  860. */
  861. function fn1(text){
  862. var temp=indexGetAddViewParam();
  863. var saveView={name:text,
  864. userId:urlJson["user_id"],
  865. roleId:urlJson["role_id"],
  866. conId:temp.conId,
  867. maticId:temp.maticId,
  868. screenState:2};
  869. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/saveViewInfo",saveView,function(result){
  870. cockpit.createList($("#i_index_left_content"));
  871. temp();
  872. },"json");
  873. alt.destory();
  874. return;
  875. }
  876. function temp(){
  877. changeLayoutView((parseInt($("#bi_index_changeLayout").data("state"))+2)%3);
  878. }
  879. function fn2(text){
  880. /*temp();*/
  881. alt.destory();
  882. top.destoryIframeContent("i_index_maticlist");
  883. }
  884. var alt=new Alert({ok:fn1,cancle:fn2},
  885. {text:"视图名称: ",input:true});
  886. //创建节点
  887. alt.create("");
  888. }
  889. /**
  890. * 获取保存视图的参数
  891. */
  892. function indexGetAddViewParam(){
  893. var conId=[];
  894. var maticId=[];
  895. /*{"TM_URL":"page/cockpit/equipment_loss/equipment_loss_chart.html",
  896. "FD_OBJECTID":"0000005","UPDATEDATE":"0",
  897. "TM_AREAID":"0002",
  898. "AREA_NAME":"设备受损区",
  899. "TM_NAME":"设备损失统计图",
  900. "TM_USE":"1",
  901. "TM_IMGURL":"_icon_url_bar",
  902. "TM_LAYERID":"61","SC_DEPT_ID":"0","TM_BEX":"0","IS_DEL":"0"};*/
  903. $("#i_index_rcontent").find(".c_index_list").each(function(){
  904. conId.push($(this).attr("id"));
  905. if($(this).attr("fd_objectid")==undefined){
  906. maticId.push("0000");
  907. }else{
  908. maticId.push($(this).attr("fd_objectid"));
  909. }
  910. });
  911. return {conId:conId.join("-"),maticId:maticId.join("-")};
  912. }
  913. /**
  914. * 绑定编辑事件
  915. * @returns
  916. */
  917. function bindIndexEdit(){
  918. //判断是否为客户自定义的视图,如果为默认视图绑定客户自定义视图的事件
  919. if($("#i_index_left_content").find("ul[data='V_OFTEN']").size()>0){
  920. $("#i_index_left_content").find("ul[data='V_OFTEN']").eq(0).find(".c_index_list_item_li").each(function(){
  921. $(this).on("mouseenter",createIndeEdit).on("mouseleave",deleteIndexEdit);
  922. });
  923. }
  924. if(util.isRole(urlJson["role_id"], de.decode(role["admin"]))){
  925. if($("#i_index_left_content").find("ul[data='V_SYSTEM']").size()>0){
  926. $("#i_index_left_content").find("ul[data='V_SYSTEM']").eq(0).find(".c_index_list_item_li").each(function(){
  927. $(this).on("mouseenter",createIndeEdit).on("mouseleave",deleteIndexEdit);
  928. });
  929. }
  930. return false;
  931. }
  932. //判断是否为默认的视图,如果为默认视图绑定默认视图的事件
  933. if($("#i_index_left_content").find("ul[data='V_SYSTEM']").size()>0){
  934. createIndexSetOften(function(arrParam){
  935. $("#i_index_left_content").find("ul[data='V_SYSTEM']").eq(0).find(".c_index_list_item_li").each(function(){
  936. $(this).find("div.c_index_list_item_text").addClass("c_index_list_item_textAftershowBar");
  937. if(arrParam.indexOf($(this).data("data")["FD_OBJECTID"])>-1){
  938. $(this).append("<div class='c_index_list_item_showBar'><div class='c_index_list_item_often'></div></div>");
  939. }else{
  940. $(this).append("<div class='c_index_list_item_showBar'><div class='c_index_list_item_unoften'></div></div>");
  941. }
  942. });
  943. setOftenLayoutAndView();
  944. });
  945. }
  946. return false;
  947. }
  948. /**
  949. * 设置为常用视图
  950. */
  951. function setOftenLayoutAndView(){
  952. $("#i_index_left_content").find(".c_index_list_item_unoften").each(function(){
  953. $(this).on("click",function(){
  954. $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/setOftenLayoutAndViewInfo",
  955. {screenState:"2",userId:urlJson["user_id"],fd_objectId:$(this).parents(".c_index_list_item_li").data("data")["FD_OBJECTID"]},function(result){
  956. cockpit.createList($("#i_index_left_content"));
  957. },"json");
  958. });
  959. });
  960. return false;
  961. }
  962. /**
  963. * 删除编辑事件生成的节点
  964. */
  965. function deleteIndexEdit(){
  966. $(this).find(".c_index_list_item_text").removeClass("c_index_list_item_textAftershowBar");
  967. if($(this).find(".c_index_list_item_showBar").size()>0){
  968. $(this).find(".c_index_list_item_showBar").remove();
  969. }
  970. }
  971. /**
  972. * 增加编辑事件节点,修改,删除,设为默认,并未节点绑定事件
  973. */
  974. function createIndeEdit(){
  975. var arrParam=[{text:"设为默认",icon:"c_index_18_18 icon_index_edit_setdefault",fn:setDefaultLayoutAndView},
  976. {text:"删除",icon:"c_index_18_18 icon_index_edit_delete",fn:deleteLayoutAndView},
  977. {text:"修改",icon:"c_index_18_18 icon_index_edit_edit",fn:editLayoutAndView}
  978. ];
  979. indexEdit($(this),arrParam);
  980. }
  981. /**
  982. * 修改专题和视图
  983. */
  984. function editLayoutAndView($dom){
  985. var $tempdom =$dom.parents(".c_index_list_item_li");
  986. $tempdom.find(".c_index_list_item_text").find("span").hide();
  987. $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='"
  988. +$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>");
  989. /* $("#i_index_layoutItem_text").on("focus",function(e){
  990. //$(this).get(0).value="";
  991. return false;
  992. });*/
  993. $("#i_index_layoutItem_text").on("click",function(){return false;});
  994. $("#i_index_layoutItem_save").on("click",function(e){
  995. editAndSaveLayoutAndView();
  996. return false;});
  997. }
  998. /**
  999. * 修改并保存布局与视图
  1000. */
  1001. function editAndSaveLayoutAndView(){
  1002. var $tempdom=$("#i_index_layoutItem_save").parents("li.c_index_list_item_li");
  1003. var objectId=$("#i_index_layoutItem_save").parents("li.c_index_list_item_li").data("data")["FD_OBJECTID"];
  1004. var name=$("#i_index_layoutItem_text").val();
  1005. var temp=indexGetAddViewParam();
  1006. var saveView={
  1007. userId:urlJson["user_id"],
  1008. objectId:objectId,
  1009. conId:temp.conId,
  1010. name:name,
  1011. maticId:temp.maticId,
  1012. screenState:2};
  1013. top.Dialog.confirm("是否修改专题视图",function(){
  1014. $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/editLayouAndViewInfo",saveView,function(result){
  1015. cockpit.createList($("#i_index_left_content"));
  1016. bindIndexEdit();
  1017. },"json");
  1018. },function(){
  1019. $tempdom.find(".c_index_list_item_text").find("span").show();
  1020. $tempdom.find(".c_index_list_item_text").find(".c_edit_layoutItem_content").remove();
  1021. });
  1022. }
  1023. /**
  1024. * 设为常用视图专题
  1025. */
  1026. function createIndexSetOften(fn,state){
  1027. if(state==1){
  1028. top.Dialog.confirm("是否设为常用专题",function(){
  1029. $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/getOftenLayoutAndViewInfo",{screenState:"2",userId:urlJson["user_id"]},function(result){
  1030. fn(result.rows.join("-"));
  1031. },"json");
  1032. },function(){});
  1033. }else{
  1034. $.post("/nwyj/ws/MaticServiceImpl/MaticServiceImpl/getOftenLayoutAndViewInfo",{screenState:"2",userId:urlJson["user_id"]},function(result){
  1035. fn(result.rows.join("-"));
  1036. },"json");
  1037. }
  1038. };
  1039. /**
  1040. *设置默认布局
  1041. */
  1042. function setDefaultLayoutAndView($dom){
  1043. var cockpitID=$dom.parents(".c_index_list_item_li").data("data")["FD_OBJECTID"];
  1044. top.Dialog.confirm("是否设为默认专题",function(){
  1045. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/setDefaultViewInfo",{screenState:"2",fd_objectid:cockpitID,userId:urlJson["user_id"],roleId:urlJson["role_id"]},function(result){
  1046. },"json");
  1047. },function(){});
  1048. }
  1049. /**
  1050. * 删除布局
  1051. */
  1052. function deleteLayoutAndView($dom){
  1053. var cockpitID=$dom.parents(".c_index_list_item_li").data("data")["FD_OBJECTID"];
  1054. top.Dialog.confirm("是否删除视图",function(){
  1055. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/deleteViewInfo",{screenState:"2",fd_objectid:cockpitID},function(result){
  1056. cockpit.createList($("#i_index_left_content"));
  1057. },"json");
  1058. },function(){});
  1059. }
  1060. /**
  1061. * 追加编辑事件触发的节点
  1062. */
  1063. function indexEdit($dom,arrParam){
  1064. if($dom.find(".c_index_list_item_showBar").size()>0){
  1065. $dom.find(".c_index_list_item_showBar").remove();
  1066. }
  1067. $dom.find(".c_index_list_item_text").addClass("c_index_list_item_textAftershowBar");
  1068. var htmlStr="<div class='c_index_list_item_showBar'><ul>";
  1069. for(var index=0,len=arrParam.length;index<len;index++){
  1070. htmlStr+="<li><div class='"+arrParam[index]["icon"]+"' title='"+arrParam[index]["text"]+"'></div></li>";
  1071. };
  1072. $dom.append(htmlStr);
  1073. $dom.find(".c_index_list_item_showBar").find("li").each(function(i,item){
  1074. $(this).on("click",function(){
  1075. arrParam[i].fn($(this));
  1076. return false;
  1077. });
  1078. });
  1079. /* $dom.find(".c_index_list_item_showBar").find("ul").eq(1).find("li").each(function(i,item){
  1080. $(this).on("click",function(){
  1081. arrParam[i].fn($(this));
  1082. });
  1083. });*/
  1084. }
  1085. /**
  1086. * 填充单个视图
  1087. * @param $dom 视图容器
  1088. */
  1089. Cockpit.prototype.createMainView=function($dom){
  1090. var id = $($dom).attr("id");
  1091. var htmlStr=
  1092. '<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>'+
  1093. '<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>'+
  1094. '<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>';
  1095. $dom.append(htmlStr);
  1096. htmlStr=null;
  1097. };
  1098. /**
  1099. * 鼠标移入移出生成工具条列表
  1100. * @param arrParam
  1101. */
  1102. //[{firstName:"展开",secondtName:"",firstIcon:"",secondIcon:"",fn:null}];
  1103. Cockpit.prototype.createBarList=function(arrParam){
  1104. $("#i_index_rcontent").find(".c_index_list").on("mouseenter",function(){
  1105. var _this=this;
  1106. if($(this).find(".c_list_content").size()>0){
  1107. $(this).find(".c_list_content").remove();
  1108. }
  1109. var htmlStr="<div class='c_list_content'><ul>";
  1110. for(var index=0,len=arrParam.length;index<len;index++){
  1111. htmlStr+="<li ><div class='"+arrParam[index]["firstIcon"]+"' title="+arrParam[index]["firstName"]+"></div></li>";
  1112. }
  1113. htmlStr+="</ul></div>";
  1114. $(_this).append(htmlStr);
  1115. onClickList($(_this),arrParam);
  1116. }).on("mouseleave",function(){
  1117. if($(this).find(".c_list_content").size()>0){
  1118. $(this).find(".c_list_content").remove();
  1119. }
  1120. $domContent=null;
  1121. });
  1122. };
  1123. /**
  1124. * 展开选择菜单列表
  1125. * @param contentId 容器ID
  1126. */
  1127. function fn_open_list(contentId,param){
  1128. if($("body").find("#i_index_maticlist").size()>0){
  1129. $("body").find("#i_index_maticlist").remove();
  1130. }
  1131. var htmlStr="<div id='i_index_maticlist' class='c_index_maticlist'>";
  1132. var wnum = $("#"+contentId).attr("spn");
  1133. 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"]+
  1134. "&&subject="+param.subjectName+"&&subjectSubName4="+param.subjectSubName4+"&&subjectSubName3="+param.subjectSubName3+"&&subjectSubName2="+param.subjectSubName2+"&&subjectSubName1="+param.subjectSubName1+"&&wnum="+wnum+"' name='test' frameborder='0' >您的浏览器不支持框架,请升级您的浏览器</iframe>";
  1135. htmlStr+="</div>";
  1136. $("body").append(htmlStr);
  1137. }
  1138. /**
  1139. * 放大和缩小功能
  1140. * @param contentId 容器ID
  1141. * fangdaState:1为缩小状态,2为放大状态
  1142. */
  1143. function fn_open_large(contentId){
  1144. if($("#"+contentId).data("fangdaState")==undefined || $("#"+contentId).data("fangdaState")==1){
  1145. $("#"+contentId).data("cssWH",{"width":Math.round(parseInt($("#"+contentId).css("width"))/parseInt($("#"+contentId).parent().css("width"))*100)+"%",
  1146. "height":Math.round(parseInt($("#"+contentId).css("height"))/parseInt($("#"+contentId).parent().css("height"))*100)+"%"});
  1147. $("#"+contentId).addClass("c_index_large").css({"width":"100%","height":"100%"}).data("fangdaState","2");
  1148. }else{
  1149. $("#"+contentId).removeClass("c_index_large").css($("#"+contentId).data("cssWH")).data("fangdaState","1");
  1150. }
  1151. }
  1152. /**
  1153. * 关闭功能
  1154. * @param contentId 容器ID
  1155. * fangdaState:1为缩小状态,2为放大状态
  1156. */
  1157. function fn_close_large(contentId){
  1158. var sn = $("#"+contentId).attr("spn");
  1159. if($(".c_index_subject_pbox"+sn).find(".c_index_view5").find("iframe").attr("src")=="about:blank"){
  1160. return;
  1161. };
  1162. var $dom = $(".select_view").parent().next().find("ul").find(".charwin_checkbox"+sn).next().find("input").click();
  1163. $(".c_index_subject_pbox"+sn).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
  1164. $(".c_index_subject_pbox"+sn).find(".c_view_pic_hs").eq(0).empty();
  1165. // //取消选中
  1166. var checknum = $($dom).attr("checknum");
  1167. $($dom).attr("checknum","0");
  1168. $($dom).parent().prev().removeClass("charwin_checkbox"+sn).addClass("charwin_checkbox0").removeClass("charwin_checkbox1");
  1169. var sdce = $($dom).parent().parent().parent().data("data");
  1170. var old_bex = "0";
  1171. if($($dom).parent().parent().parent().parent().parent().prev().find(".ci_title_box").find("span").html()=="组合展示"){
  1172. old_bex = sdce.IS_SYNTHESIZE;
  1173. sdce.IS_SYNTHESIZE = "0";
  1174. }else{
  1175. old_bex = sdce.TM_BEX;
  1176. sdce.TM_BEX = "0";
  1177. };
  1178. $($dom).parent().parent().parent().data("data",sdce);
  1179. var svce = $($dom).parent().parent().parent().parent().parent().prev().find(".ci_title_box").eq(0).attr("showView");
  1180. if(svce=="1"){
  1181. $(".c_index_subject_pbox"+old_bex).find(".c_index_view5").find("iframe").attr({"src":"about:blank"});
  1182. $(".c_index_subject_pbox"+old_bex).find(".c_view_pic_hs").eq(0).empty();
  1183. };
  1184. var lenc = $(":checkbox[name='"+$($dom).attr("name")+"']:checked").length;
  1185. if(lenc < 4){
  1186. $("input[name='"+$($dom).attr("name")+"']").not("input:checked").each(function(){
  1187. //alert($(this).next().children().next().attr("title"))
  1188. $(this).removeAttr("disabled");
  1189. });
  1190. return;
  1191. };
  1192. }
  1193. /**
  1194. * 刷新功能
  1195. * @param contentId 容器ID
  1196. */
  1197. function fn_open_rend(contentId){
  1198. var frame = $("#"+contentId).find("iframe").get(0);
  1199. frame.contentWindow.document.location.reload();
  1200. };
  1201. /*function printDom(contentId){
  1202. $($("#"+contentId).find("iframe").get(0).contentWindow.document).find("body").jqprint();
  1203. var iframeWindow=$("#"+contentId).find("iframe").get(0).contentWindow;
  1204. if(iframeWindow!=undefined || iframeWindow!=null){
  1205. if($("#i_iframe_print").size()>0){
  1206. $("#i_iframe_print").remove();
  1207. }
  1208. var $iframe=$('<iframe id="i_iframe_print" src="/nwyj/page/cockpit/print.html" style="width:400px;height:400px;" marginwidth="0px" marginheight="0px">');
  1209. $iframe.appendTo($("body"));
  1210. var opener=$iframe.get(0).contentWindow;
  1211. $(opener).on("load",function(){
  1212. var canvas=opener.document.querySelector("canvas");
  1213. html2canvas($(iframeWindow.document).find("html"), {canvas:canvas,removeContainer:false,allowTaint:false}).then(function(canvas) {
  1214. opener.print();
  1215. });
  1216. });
  1217. }else{
  1218. alert("iframeweikong");
  1219. }
  1220. }*/
  1221. /**height:inherit
  1222. * 关闭父容器的iframe容器
  1223. * @param contentId
  1224. * @returns
  1225. */
  1226. function destoryIframeContent(contentId){
  1227. if($("#"+contentId).size()>0){
  1228. $("#"+contentId).remove();
  1229. }
  1230. }
  1231. /**
  1232. * 改变视图容器的链接地址
  1233. */
  1234. function changeSite(id,jsonParam){
  1235. var $dom=$("#"+id);
  1236. if(jsonParam==undefined){
  1237. $($dom).find(".c_index_view5").find("iframe").attr("src","about:blank").removeAttr("name");
  1238. }else{
  1239. $dom.attr("fd_objectid",jsonParam["FD_OBJECTID"]);
  1240. loadPage($dom.find(".c_index_view5").find("iframe"),jsonParam["TM_URL"]);
  1241. };
  1242. // $dom.attr("fd_objectid",jsonParam["FD_OBJECTID"]);
  1243. // /* if(jsonParam["TM_URL"].indexOf("http://")==0){*/
  1244. // loadPage($dom.find(".c_index_view5").find("iframe"),jsonParam["TM_URL"]);
  1245. // /* }else{
  1246. // loadPage($dom.find(".c_index_view5").find("iframe"),url.path+jsonParam["TM_URL"]);
  1247. // }*/
  1248. }
  1249. /**
  1250. * loadPage
  1251. */
  1252. function loadPage($dom,siteString){
  1253. var param={style:style,title:urlJson["dept_name"],number:number};
  1254. if(siteString.indexOf("http://")==0){
  1255. $dom.parent().css({top:"30px"});
  1256. handleOutWebsite($dom, siteString);
  1257. //$dom.attr("src",siteString);
  1258. }else{
  1259. $dom.parent().css({top:"6px"});
  1260. param.dataSourceState=dataSourceState;
  1261. /* alert(JSON.stringify(param));*/
  1262. endTime = $("#i_alert_time").val();
  1263. $dom.attr("src",url.path+siteString+window.location.search+"&&"+encodeURI($.param(param))+"&&date_time="+endTime);
  1264. }
  1265. }
  1266. function handleOutWebsite($dom,siteString){
  1267. // debugger;
  1268. if(XMLContext[siteString.trim()]==undefined){
  1269. $dom.attr("src",siteString);
  1270. return;
  1271. }
  1272. XMLContext[siteString.trim()]($dom,siteString,urlJson);
  1273. }
  1274. /**
  1275. * 方法汇总
  1276. */
  1277. /**
  1278. * 给工具条绑定点击事件
  1279. */
  1280. function onClickList($dom,arrParam){
  1281. $dom.find("li").each(function(i){
  1282. $(this).data("data",arrParam[i]).data("state",1);
  1283. //绑定点击事件
  1284. $(this).on("click",function(){
  1285. if( $(this).data("state")==1){
  1286. $(this).find("div").addClass($(this).data("data")["secondIcon"]);
  1287. $(this).data("state")==2;
  1288. }else{
  1289. $(this).find("div").removeClass($(this).data("data")["secondIcon"]);
  1290. }
  1291. $(this).data("state",1);
  1292. $(this).data("state",2);
  1293. var showData = {};
  1294. $(".ci_title_box").each(function(){
  1295. if($(this).attr("showview")=="1"){
  1296. if($(this).data("data").name==undefined){
  1297. showData.subjectName = "组合展示";
  1298. }else{
  1299. showData.subjectName = $(this).data("data").name;
  1300. };
  1301. var cnum = $(this).next().attr("checkboxnum");
  1302. $(":checkbox[name='checkbox"+cnum+"']:checked").each(function(){
  1303. var sd = $(this).parent().parent().parent().data("data");
  1304. if($(this).parent().parent().parent().parent().parent().prev().find(".ci_title_box").find("span").html()=="组合展示"){
  1305. showData.subjectName = "组合展示";
  1306. showData["subjectSubName"+sd.IS_SYNTHESIZE] = sd.TM_NAME;
  1307. }else{
  1308. showData["subjectSubName"+sd.TM_BEX] = sd.TM_NAME;
  1309. };
  1310. });
  1311. };
  1312. });
  1313. $(this).data("data").fn($(this).parents("div[id^='i_index_content']").attr("id"),showData);
  1314. });
  1315. });
  1316. }
  1317. /**
  1318. * 创建左侧视图选择列表
  1319. */
  1320. Cockpit.prototype.createList=function($dom,arrParam){
  1321. /* {"SL_NAME":"2015雨雪冰冻灾害演练因灾损失统计","SL_PARAMENT":[{"column":"50%","SCREEN_STATE":"1","IS_COMMONUSE":"0",
  1322. "SL_USERID":"R002105430214","FD_OBJECTID":"1018",
  1323. "UPDATEDATE":"2015-12-19 23:10:19.247","IS_USE":"","TM_BEX":"0","IS_DEL":"0","SL_LAYOUTID":"0"}
  1324. }*/
  1325. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getLayoutInfo",{screenId:"2",userId:urlJson["user_id"],roleId:urlJson["role_id"]},function(result){
  1326. if(result["state"]=="SUCCESS"){
  1327. var arrResult=[];
  1328. if(result.rows.length>1){
  1329. if(result.rows[0]["name"]=="R002105430214"){
  1330. arrResult.push(result.rows[1]);
  1331. arrResult.push(result.rows[0]);
  1332. }else{
  1333. arrResult.push(result.rows[0]);
  1334. arrResult.push(result.rows[1]);
  1335. }
  1336. }else{
  1337. arrResult=result.rows;
  1338. }
  1339. cockpit.createUlList($dom, arrResult, viewListClick);
  1340. /***
  1341. *
  1342. * 再次加载列表时绑定事件
  1343. *
  1344. *
  1345. * **/
  1346. if($(".c_index_edit").parent().data("state")==2){
  1347. bindIndexEdit();
  1348. }
  1349. }else{
  1350. top.Dialog.alert("加载数据失败",function(){});
  1351. }
  1352. ;
  1353. },"json");
  1354. };
  1355. /**
  1356. * 创建ul-li列表
  1357. * @param $dom
  1358. * @param arrParam
  1359. * @param fn
  1360. */
  1361. Cockpit.prototype.createUlList=function($dom,arrParam,fn){
  1362. $dom.empty();
  1363. if(arrParam.length==0)
  1364. $dom.append("<div>目前尚无列表数据</div>");
  1365. for(var index=0 ,len=arrParam.length;index<len;index++){
  1366. if(arrParam[index].rows.length==0)
  1367. continue;
  1368. var ulTitle=null;
  1369. var type=null;
  1370. if(arrParam[index]["name"]=="R002105430214"){
  1371. // ulTitle="默认专题";
  1372. ulTitle="专题列表";
  1373. type="V_SYSTEM";
  1374. }else{
  1375. ulTitle="常用专题";
  1376. type="V_OFTEN";
  1377. }
  1378. if($dom.find("ul").size()==0){
  1379. $dom.append("<div class='c_index_list_ul1_headz icon_index_list_ul1_headz'></div>" +
  1380. "<div class='c_index_list_ul1_headc icon_index_list_ul1_headc'></div>" +
  1381. "<div><div class='c_index_list_ul1_heady icon_index_list_ul1_heady'></div>" +
  1382. "<div class='c_index_list_ul_head1'>"+ulTitle+"</div>");
  1383. }else{
  1384. $dom.append("<div class='c_index_list_ul1_headz icon_index_list_ul2_headz'></div>" +
  1385. "<div class='c_index_list_ul1_headc icon_index_list_ul2_headc'></div>" +
  1386. "<div class='c_index_list_ul1_heady icon_index_list_ul2_heady'></div>" +
  1387. "<div class='c_index_list_ul_head1 c_index_list_ul_head2'>"+ulTitle+"</div>");
  1388. }
  1389. //this.createUlLi($dom,arrParam[index].rows,type,fn);
  1390. this.createSubjectList();
  1391. }
  1392. };
  1393. Cockpit.prototype.createSubjectList = function(){
  1394. $.post("/nwyj/ws/MaticService/MaticService/getMaticMapInfo", {comId:urlJson["dept_id"]}, function(result) {
  1395. if (result.state == "SUCCESS") {
  1396. var res = result.rows;
  1397. var resSort = res.sort(function(a,b){
  1398. return a.rows[0].SORT1 - b.rows[0].SORT1;
  1399. });
  1400. var specialty;
  1401. for(var key in resSort){
  1402. if(resSort[key]["name"]=="专业系统"){
  1403. specialty = resSort[key];
  1404. delete resSort[key];
  1405. continue;
  1406. };
  1407. for(var sk in resSort[key].rows){
  1408. Synthesize.push(resSort[key].rows[sk]);
  1409. };
  1410. };
  1411. // leftWin.init(result.rows,Synthesize);
  1412. leftWin.init(resSort,Synthesize);
  1413. $(':input').labelauty();
  1414. if(specialty){
  1415. $("#i_index_left_content").append('<div class="c_index_list_ul1_headz icon_index_list_ul1_headz specialty_title" style="margin-top:20px;"></div>');
  1416. $("#i_index_left_content").append('<div class="c_index_list_ul1_headc icon_index_list_ul1_headc specialty_title" style="margin-top:20px;"></div>');
  1417. $("#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>');
  1418. $("#i_index_left_content").append('<div id="specialty_count"></div>');
  1419. leftWin.initSpecialtyCount(specialty);
  1420. };
  1421. return result;
  1422. } else {
  1423. top.Dialog.alert("加载失败!");
  1424. }
  1425. }, "json");
  1426. };
  1427. /**
  1428. * 点击视图列表加载布局
  1429. * @param jsonParam
  1430. */
  1431. function viewListClick(jsonParam){
  1432. /**
  1433. * 判断是否为增加视图状态
  1434. * 如果为增加视图状态则恢复常规状态
  1435. */
  1436. if($(".c_index_add").size()>0 && $(".c_index_add").parent().data("state")==2){
  1437. $(".c_index_add").parent().data("state",($(".c_index_add").parent().data("state")+1)%2);
  1438. $(".c_index_add").removeClass("c_index_index_save");
  1439. }
  1440. /**
  1441. * 加载页面
  1442. */
  1443. layoutNumber=jsonParam["FD_OBJECTID"];
  1444. $.post(url["http_path"]+"ws/MaticServiceImpl/MaticServiceImpl/getViewInfo",{fd_objectid:jsonParam["FD_OBJECTID"]},function(result){
  1445. /*indexAddView();*/
  1446. loadPages(result.rows);
  1447. },"json");
  1448. }
  1449. /**
  1450. * 加载四张页面
  1451. * @param 四张布局的参数
  1452. */
  1453. function loadPages(arrParam){
  1454. $("#i_index_rcontent").find(".c_index_list").each(function(){
  1455. var flag=true;
  1456. for(var index=0,len=arrParam.length;index<len;index++){
  1457. if($(this).attr("id")==arrParam[index]["OL_CONID"]){
  1458. $(this).attr("fd_objectid",arrParam[index]["OL_MATICID"]);
  1459. $(this).find("iframe").attr("name",$(this).attr("id"));
  1460. loadPage($(this).find("iframe"),arrParam[index]["TM_URL"]);
  1461. flag=false;
  1462. continue;
  1463. };
  1464. };
  1465. if(flag)$(this).find("iframe").attr("src","about:blank");
  1466. // if(flag)$(this).find("iframe").attr("src","about:blank").removeAttr("name");
  1467. });
  1468. }
  1469. /**
  1470. * @param $dom 追加节点的容器
  1471. * @param arrParam 追加节点的数据
  1472. * @param fn 追加节点的回调函数
  1473. */
  1474. Cockpit.prototype.createUlLi=function($dom,arrParam,type,fn){
  1475. if(arrParam.length==0)
  1476. throw new Error("创建列表的数组长度为0");
  1477. var ulStr="<ul class='c_index_left_content_ul' data="+type+">";
  1478. for(var index=0,len=arrParam.length;index<len;index++){
  1479. 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>";
  1480. }
  1481. ulStr+="</ul>";
  1482. $dom.append(ulStr);
  1483. if((typeof fn)!="function"){
  1484. return;
  1485. }
  1486. $dom.find("ul").last().find("li").each(function(i){
  1487. if(layoutNumber!=null && layoutNumber==arrParam[i]["FD_OBJECTID"]){
  1488. $(this).addClass("c_click_view_item");
  1489. }
  1490. $(this).data("data",arrParam[i]).on("click",function(){
  1491. fn($(this).data("data"));
  1492. if($dom.find("li.c_click_view_item").size()>0){
  1493. $dom.find("li.c_click_view_item").removeClass("c_click_view_item");
  1494. }
  1495. $(this).addClass("c_click_view_item");
  1496. });
  1497. });
  1498. $dom.find(".c_index_list_item_li").on("mouseenter",function(){
  1499. $(this).addClass("c_index_list_item_li_hover");
  1500. //var $dom=$(this).find("span");
  1501. /* $(this).find("span").animate({"margin":"-80px",opacity:0.1},"400",function(){
  1502. $dom.css({"margin-left": "180px"});
  1503. $dom.animate({"margin":"0px",opacity:1},"400");
  1504. });*/
  1505. }).on("mouseleave",function(){
  1506. $(this).removeClass("c_index_list_item_li_hover");
  1507. });
  1508. };
  1509. function getYear(){
  1510. var date=allGetServerTime();
  1511. return date.getFullYear();
  1512. }