c2035c13e5f95ba4becef8e72db5859271cb3584.svn-base 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. var _this = this;
  2. _this.listGrid1 = null;// 值班数据列表
  3. _this.listGrid2 = null;// 代办数据列表
  4. //获得当前系统日期
  5. function getDate(){
  6. var s="";
  7. var d = allGetServerTime();
  8. var vYear = d.getFullYear();
  9. var vMon = d.getMonth() + 1;
  10. var vDay = d.getDate();
  11. var h = d.getHours();
  12. var m = d.getMinutes();
  13. var se = d.getSeconds();
  14. s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+"- "+(h<10 ? "0"+ h : h)/*+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se)*/;
  15. return s;
  16. }
  17. //转化日期格式
  18. function changeDateToString(date){
  19. var s="";
  20. var d = date;
  21. var vYear = d.getFullYear();
  22. var vMon = d.getMonth() + 1;
  23. var vDay = d.getDate();
  24. var h = d.getHours();
  25. var m = d.getMinutes();
  26. var se = d.getSeconds();
  27. s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)/*+"- "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se)*/;
  28. return s;
  29. }
  30. /*$(function(){
  31. //加载资源分布图数据
  32. //getResourceData();
  33. //setTitleName($("#index_right_1"),"资源分布图");
  34. //加载值班信息数据
  35. //loadDuty();
  36. //加载常用菜单数据
  37. //getWorkMenuData();
  38. //加载集成url数据
  39. //getUrlData();
  40. //加载预警与响应
  41. //getAlertResponseData();
  42. //待办
  43. //getdaibanData();
  44. //加载应急业务应用数据
  45. //getBusinessData();
  46. //getUserData();
  47. });
  48. */
  49. /**
  50. * 设置模块iframe模块
  51. * @param $dom
  52. * @param iframeUrl
  53. */
  54. function setContentByUrl(idx,iframeUrl,contheight,contwidth){
  55. //console.log($dom.html());
  56. var $dom = $("#cont"+idx);
  57. var $content = $dom.find(".idxModule_content");
  58. //var id = $dom.attr("id");
  59. //console.log($content);
  60. if($content.length == 0){
  61. $dom.append('<div class="idxModule_content iframe_cont" ></div>');
  62. $content = $dom.find(".idxModule_content");
  63. }else{
  64. $content.empty();
  65. }
  66. var $iframe = $('<div style="min-width:'+contwidth+';height:'+contheight+'" ><iframe name="" id="ifm_'+idx+'" src="'+iframeUrl+'" onload="Javascript:idxIframeOnload(\''+idx+'\');" width="100%" height = "100%" frameborder = "0" scrolling ="no" ></iframe></div>');
  67. //var $iframe = $('<iframe name="" id="ifm_'+idx+'" src="'+iframeUrl+'" onload="Javascript:idxIframeOnload(\''+idx+'\');" width="100%" height = "'+contheight+'" frameborder = "0" ></iframe>');
  68. $content.append($iframe);
  69. $iframe = null;
  70. iframeUrl = null;
  71. $content = null;
  72. id = null;
  73. }
  74. /**
  75. * iframe加载完成时需要完成的函数
  76. * @param idx
  77. */
  78. function idxIframeOnload(idx){
  79. //隐藏加载图标
  80. hideLoading(idx);
  81. //重置高度
  82. resetpageheight();
  83. }
  84. /*
  85. function SetWinHeight(obj){
  86. var win = obj;
  87. if(document.getElementById){
  88. if(win && !window.opera){
  89. if(win.contentDocument && win.contentDocument.body.offsetHeight){
  90. win.height = win.contentDocument.body.offsetHeight;
  91. }else if(win.contentDocument && win.contentDocument.body.scrollHeight){
  92. win.height = win.contentDocument.body.scrollHeight;
  93. }
  94. }
  95. }
  96. }
  97. */
  98. /* 日期计算
  99. *
  100. * */
  101. Date.prototype.DateAdd = function(strInterval, Number) {
  102. var dtTmp = this;
  103. switch (strInterval) {
  104. case 's' :return new Date(Date.parse(dtTmp) + (1000 * Number));
  105. case 'n' :return new Date(Date.parse(dtTmp) + (60000 * Number));
  106. case 'h' :return new Date(Date.parse(dtTmp) + (3600000 * Number));
  107. case 'd' :return new Date(Date.parse(dtTmp) + (86400000 * Number));
  108. case 'w' :return new Date(Date.parse(dtTmp) + ((86400000 * 7) * Number));
  109. //一个月的number倍
  110. case 'm' :return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
  111. //三个月的number倍
  112. case 'q' :return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number*3, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
  113. //一年的number倍
  114. case 'y' :return new Date((dtTmp.getFullYear() + Number), dtTmp.getMonth(), dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
  115. }
  116. };
  117. /*公告开始*/
  118. function getGongGaoData(idx,iframeUrl,contheight,contwidth) {
  119. var $dom = $("#cont"+idx).find(".idxModule_content").last();
  120. $.ajax({
  121. url : $.pathname() +'/ws/moduleobj/queryGongGaoData/',
  122. type : 'post',
  123. data : {
  124. compIds : comp_id,
  125. compNames : corp_names
  126. },
  127. dataType : 'json',
  128. success : function(data) {
  129. if(data.state == "ok"&&data.length != 0){
  130. createGongGao($dom,data.resultData);
  131. }else{
  132. $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
  133. }
  134. //隐藏加载图像
  135. hideLoading(idx);
  136. //重置高度
  137. resetpageheight();
  138. },
  139. error : function(error) {
  140. try {
  141. //隐藏加载图像
  142. hideLoading(idx);
  143. top.Dialog.alert('访问服务失败!');
  144. } catch (e) {
  145. }
  146. }
  147. });
  148. }
  149. function createGongGao ($content,data){
  150. //$content.html("");
  151. //console.log(JSON.stringify(data));
  152. //var $content = $('<div class="idxModule_content"></div>');
  153. //$("#index_right_6").append($content);
  154. var $rl6Cont = $('<div class="rl6_cont"></div>');
  155. $content.append($rl6Cont);
  156. var titleCont = $('<div class="rl6_title">'+data[0].TITLE+'</div>');
  157. var timeCont = $('<div class="rl6_time">'+data[0].SUBTIME+'</div>');
  158. var textCont = $('<div class="rl6_marquee " id="rl6_marquee" ><div id="rl6_marquee1">'+data[0].CONTENT+'</div><div id="rl6_marquee2"></div></div>');
  159. //var textCont1 = $('<div class="rl6_text rl6_text_more" id="rl6_text1" >'+data[0].CONTENT+'</div>');
  160. //var textCont2 = $('<div class="rl6_text " id="rl6_text2" style="display:none;">'+data[0].CONTENT+'</div>');
  161. //var deptCont = $('<div class="rl6_dept">发布人:<span>'+data[0].DEPT_NAME+'</span> <span>'+data[0].PERSON+'</span></div>');
  162. var moreCont = $('<div class="rl6_more"><a>点击查看更多公告</a></div>');
  163. moreCont.data("fd_id",data[0].FD_OBJECTID);
  164. $rl6Cont.append(titleCont).append(timeCont).append(textCont).append(moreCont)/*.append(textCont2).append(deptCont)*/;
  165. createUpMarquee("rl6_marquee","rl6_marquee1","rl6_marquee2");
  166. moreCont.bind("click",function(){
  167. //var fd_id = $(this).data("fd_id");
  168. var idxURL = "/nwyj/page/system/notice/NoticeList.jsp";
  169. windowOpenNext(idxURL);
  170. });
  171. //重置高度
  172. //resetpageheight();
  173. }
  174. /**
  175. * 文字向上滚动动画
  176. * @param id
  177. * @param id1
  178. * @param id2
  179. */
  180. function createUpMarquee(id,id1,id2){
  181. var speed = 40;
  182. var ee = document.getElementById(id);
  183. var ee1 = document.getElementById(id1);
  184. var ee2 = document.getElementById(id2);
  185. ee2.innerHTML=ee1.innerHTML;
  186. function Marquee(){
  187. if(ee2.offsetTop-ee.scrollTop<=0){
  188. ee.scrollTop -= (ee1.offsetHeight+10);
  189. }else{
  190. ee.scrollTop ++;
  191. }
  192. }
  193. var myMar = setInterval(Marquee,speed);
  194. ee.onmouseover = function(){
  195. clearInterval(myMar);
  196. $(ee2).hide();
  197. var $self = $(this);
  198. $self.css({"overflowY":"scroll"});
  199. };
  200. ee.onmouseout = function(){
  201. $(ee2).show();
  202. var $self = $(this);
  203. $self.css({"overflowY":"hidden"});
  204. myMar = setInterval(Marquee,speed);
  205. };
  206. }
  207. /*公告结束*/
  208. /*个人信息开始*/
  209. function getUserData(idx,iframeUrl,contheight,contwidth) {
  210. $.ajax({
  211. url : $.pathname() + '/ws/sendmenu/SendMsgService/getReadedCount',
  212. type : 'post',
  213. data : {
  214. userId : user_id
  215. },
  216. dataType : 'text',
  217. success : function(data) {
  218. createUserData(idx,data);
  219. //隐藏加载图像
  220. hideLoading(idx);
  221. //重置高度
  222. resetpageheight();
  223. },
  224. error : function(e) {
  225. try {
  226. //隐藏加载图像
  227. hideLoading(idx);
  228. top.Dialog.alert('访问服务失败!');
  229. } catch (e) {
  230. }
  231. }
  232. });
  233. }
  234. function createUserData (idx,data){
  235. var $dom = $("#cont"+idx).find(".idxModule_content").last();
  236. $dom.html("");
  237. var rolenamesArr = rolenames.split(",");
  238. var l4_rolenames = "";
  239. for(var i=0;i<rolenamesArr.length;i++ ){
  240. if(i==rolenamesArr.length-1){
  241. l4_rolenames += rolenamesArr[i];
  242. }else{
  243. l4_rolenames += (rolenamesArr[i]+"<br/>");
  244. }
  245. }
  246. //l4_rolenames = rolenames;
  247. var $content = $('<div class="l4_cont1"></div>');
  248. $dom.append($content);
  249. var loginDate = "新登陆用户";
  250. if(logindate!=null){
  251. loginDate = logindate;
  252. }
  253. //var $photo = $('<div class="l4_img_div"> <img class="l4_img" src="/nwyj/images/index/module_img/user_photo.png" alt="" /> </div>');
  254. //var $userMsg = $('<div class = "l4_cont1_right" ><span class="l4_text">'+real_name+'<div class="msg_img_cont"><img class="msg_img" src="/nwyj/images/index/idx_main/index_msg.png"/></div></span><span class="l4_text1">'+corp_names+'</span><span class="l4_text2">'+rolenames+'</span><span class="l4_text2" style="display:none;">'+mod_date+'</span></div>');
  255. var $userMsg = $('<div class = "l4_cont1_right l4_img_div_bg" ><span class="l4_text">'+real_name+'<div class="msg_img_cont"><img class="msg_img" src="/nwyj/images/index/idx_main/index_msg.png"/></div></span><span class="l4_text2">'+l4_rolenames+'</span><span class=" l4_date " style="">上次登录时间:'+loginDate+'</span></div>');
  256. //$content.find(".l4_cont1").append($photo).append($userMsg);
  257. $content.append($userMsg);
  258. //alert($photo.width()+","+$userMsg.width()+","+$(".l4_cont1").width());
  259. //$(".l4_cont1_right").css("max-width",($(".l4_cont1").width()-$photo.width()));
  260. //alert($userMsg.width());
  261. //alert($(".l4_cont1").width());
  262. var $msgNum = $('<div class="msg_numb_cont" id="msg_numb_cont"><a class="msg_numb" id="msg_numb">'+data+'</a></div>');
  263. $msgNum.bind("click",function(){
  264. //$(top.document.body).find("#frmright").attr("src","/nwyj/page/system/message/recivedListMsg.jsp");
  265. //selfOpenNext("/nwyj/page/system/message/recivedListMsg.jsp");
  266. var idxURL = "/nwyj/page/system/message/recivedListMsg.jsp";
  267. windowOpenNext(idxURL);
  268. });
  269. $userMsg.find(".msg_img_cont").append($msgNum);
  270. $userMsg = null;
  271. $photo = null;
  272. $content = null;
  273. $msgNum = null;
  274. }
  275. /*个人信息结束*/
  276. /*工作台菜单开始*/
  277. function getWorkMenuData(idx,iframeUrl,contheight,contwidth){
  278. //alert(111);
  279. $.ajax({
  280. url : $.pathname() + '/ws/sys/SysCustomMenuService/queryIndexMenuByroleId/',
  281. type : 'post',
  282. data : {
  283. user_id:user_id
  284. },
  285. dataType : 'json',
  286. async:false,
  287. success : function(data) {
  288. createWorkMenu($("#contindex_left_1"),data.resultData);
  289. //隐藏加载图像
  290. hideLoading("index_left_1");
  291. //重置高度
  292. resetpageheight();
  293. },
  294. error : function(e) {
  295. try{
  296. //隐藏加载图像
  297. hideLoading("index_left_1");
  298. top.Dialog.alert('访问服务失败!');
  299. }catch(e){
  300. }
  301. }
  302. });
  303. }
  304. function createWorkMenu($dom,data){
  305. var $conttt = $dom.find(".idxModule_content").last();
  306. var $menuContent = $('<div class="menu_cont"></div>');
  307. $conttt.append($menuContent);
  308. for(var j=0;j<data.length;j++){
  309. createMenuItem(data[j],$menuContent);
  310. }
  311. //添加按钮
  312. var $div1 = $('<div class="menu_grid"><img class="menu_img" src="/nwyj/images/index/more/menu_add.png"/><div class="menu_text">添加</div></div>');
  313. $div1.bind("click",function(){
  314. //$(top.document.body).find("#frmright").attr("src","/nwyj/page/all_menu.jsp");
  315. selfOpenNext("/nwyj/page/all_menu.jsp");
  316. });
  317. $menuContent.append($div1);
  318. $menuContent=null;
  319. $div1=null;
  320. }
  321. /*function createWorkMenu($dom,data){
  322. var $conttt = $dom.find(".idxModule_content").last();
  323. var $menuContent = $('<div class="menu_cont"></div>');
  324. $conttt.append($menuContent);
  325. var dataLength = Math.ceil((data.length+1)/3);
  326. //console.log(dataLength);
  327. for(var j=0;j<dataLength;j++){
  328. var $contul = $('<div class = "cont_ul" id="cont_ul'+j+'"></div>');
  329. $menuContent.append($contul);
  330. for (var i = j*3; i < (j+1)*3; i++) {
  331. if(i<data.length){
  332. var menu = data[i];
  333. //添加每个menu
  334. createMenuItem(menu,$contul);
  335. menu = null;
  336. }
  337. }
  338. }
  339. //添加按钮
  340. var $div1 = $('<div class="menu_grid"><img class="menu_img" src="/nwyj/images/index/more/menu_add.png"/><div class="menu_text">添加</div></div>');
  341. $div1.bind("click",function(){
  342. //$(top.document.body).find("#frmright").attr("src","/nwyj/page/all_menu.jsp");
  343. selfOpenNext("/nwyj/page/all_menu.jsp");
  344. });
  345. $("#cont_ul"+(dataLength-1)).append($div1);
  346. $menuContent=null;
  347. $div1=null;
  348. heit=null;
  349. }
  350. */
  351. /**
  352. * 创建工作菜单的每个item
  353. * @param menu
  354. * @param $menuContent
  355. */
  356. function createMenuItem(menu,$contul){
  357. var image_url = menu.IMAGE_URL;
  358. var $div = $('<div class="menu_grid" title="'+menu.TITLE_NAME+'" ><img class="menu_img" src="'+image_url+'"/><div class="menu_text">'+menu.TITLE_NAME+'</div></div>');
  359. $div.data("menu_url",menu.BUSINESS_URL);
  360. $div.data("menu_id",menu.MENU_ID);
  361. $contul.append($div);
  362. $div.bind("click",function(){
  363. var memuId = $(this).data("menu_id");
  364. $.indexUserClickNum (user_id,memuId);
  365. //$(top.document.body).find("#frmright").attr("src",$(this).data("menu_url"));
  366. //selfOpenNext($(this).data("menu_url"));
  367. var idxURL = $(this).data("menu_url");
  368. windowOpenNext(idxURL);
  369. });
  370. $div = null;
  371. image_url = null;
  372. }
  373. /*工作台菜单结束*/
  374. /*值班信息开始*/
  375. function loadDuty(idx,iframeUrl,contheight,contwidth){
  376. //初始话标题栏tab
  377. var $dateCont = $('<div class = "date_tab_cont"></div>');
  378. $("#index_right_2").append($dateCont);
  379. $dateCont.append('<span class="changeDate" value="-1">前一天</span><span class="changeDate" value="0" >今天</span><span class="changeDate" value="1">后一天</span>');
  380. //初始话content
  381. $(".changeDate").live("click",function(){
  382. var number = $(this).attr("value");
  383. //console.log(number);
  384. var currentDate = allGetServerTime();
  385. var selectDate = changeDateToString(currentDate.DateAdd("d", parseInt(number)));
  386. //console.log(currentDate.DateAdd("m", parseInt(number)));
  387. $(".changeDate").removeClass("selectDate");
  388. $(this).addClass("selectDate");
  389. getDutyDate(selectDate);
  390. number = null;
  391. currentDate = null;
  392. selectDate = null;
  393. });
  394. $(".changeDate").eq(1).click();
  395. }
  396. function getDutyDate(date){
  397. var gData = [];
  398. $.ajax({
  399. url : $.pathname() + '/ws/EventService/EventService/getDutyInfoByDate/',
  400. type : 'post',
  401. data : {
  402. "date":date,
  403. "deptId":comp_id
  404. },
  405. dataType : 'json',
  406. //timeout : 5000,
  407. success : function(data) {
  408. gData = data;
  409. },
  410. error : function(error) {
  411. try{
  412. $.messager.alert('访问服务失败!', 'error');
  413. }catch(e){
  414. }
  415. }
  416. }).done(function(){
  417. var $dom = $("#contindex_right_2").find(".idxModule_content").last();
  418. $dom.html("");
  419. $dom.append('<div class="dutyTable"><div class="dutyTableCont"><div style="" id="dataGrid1"></div></div></div>');
  420. var $conttt = $("#dataGrid1");
  421. var columsData = [ { display : '开始时间',name : 'START_TIME',width : "10%"},
  422. { display : '结束时间', name : 'END_TIME',width : "10%" },
  423. { display : '值班领导', name : 'LEADER_NAME',width : "10%"},
  424. { display : '领导电话', name : 'LEADER_TEL', width : "12%"},
  425. { display : '值班人员,联系电话', name : 'NAME', width : "32%"},
  426. { display : '值班方式',name : 'DUTY_MODE_SHOW',width : "10%"},
  427. { display : '单位',name : 'CORP_NAME',width : "16%" }];
  428. createIndexTable($conttt,gData,columsData);
  429. //隐藏加载图像
  430. hideLoading("index_right_2");
  431. //重置高度
  432. resetpageheight();
  433. });
  434. }
  435. /*值班信息结束*/
  436. /**
  437. * 动态创建首页表格
  438. */
  439. function createIndexTable($dom,gridData,columsData){
  440. var tablehtml = '<div class="tablediv"><table class="tablecont" cellspacing="0" >';
  441. tablehtml += '<tr class="tablehead">';
  442. for(var i=0;i<columsData.length;i++){
  443. tablehtml += '<th width="'+columsData[i].width+'"><span>'+columsData[i].display+'</span></th>';
  444. }
  445. tablehtml += '</tr>';
  446. //console.log(JSON.stringify(gridData));
  447. if(gridData.length!=0){
  448. for(var j=0;j<gridData.length;j++){
  449. var rowData = gridData[j];
  450. tablehtml += '<tr class="tablerow">';
  451. for(var k=0;k<columsData.length;k++){
  452. var culum = columsData[k].name;
  453. var renderFun = columsData[k].render;
  454. if(renderFun&&renderFun!=""){
  455. var strhtml = renderFun(rowData,culum);
  456. tablehtml += '<td ><span >'+strhtml+'</span></td>';
  457. }else{
  458. tablehtml += '<td ><span title="'+rowData[culum]+'">'+rowData[culum]+'</span></td>';
  459. }
  460. }
  461. tablehtml += '</tr>';
  462. }
  463. }else{
  464. tablehtml += '<tr ><td height="40px" colspan="'+columsData.length+'">此列表暂无数据</td></tr>';
  465. }
  466. tablehtml += '</table></div>';
  467. $dom.append(tablehtml);
  468. }
  469. /*待办开始*/
  470. function getdaibanData(idx,iframeUrl,contheight,contwidth){
  471. var $conttt = $("#contindex_right_4").find(".idxModule_content").last();
  472. $conttt.append('<div class="dutyTable"><div class="dutyTableCont"><div style="" id="dataGrid2"></div></div></div>');
  473. getdaibanAjax();
  474. }
  475. function getdaibanAjax(){
  476. var gData = [];
  477. $.ajax({
  478. url : "/nwyj/ws/xianlutingyun/XianlutingyunService/getDBmsg",
  479. type : 'post',
  480. data : {
  481. user_id:user_id,
  482. //role_id:getRole_id(),
  483. role_id:getRole_id(role_id),
  484. company_id:comp_id,
  485. type:''
  486. },
  487. async:false,
  488. //timeout : 5000,
  489. dataType : 'json',
  490. success : function(data){
  491. gData = data.rows.rows;
  492. },
  493. error : function(e){
  494. try{
  495. $.messager.alert('访问服务失败!', 'error');
  496. }catch(e){
  497. }
  498. }
  499. }).done(function(){
  500. var columsData = [{ display: '事件类型', name: 'DB_TYPE', width: "15%"},
  501. { display: '事件名称', name: 'NAME', width: "30%"},
  502. { display: '下一步操作', name: 'IS_SEND', width: "10%", render:showName},
  503. { display: '发起时间', name: 'WRITE_TIME', width: "15%"},
  504. { display: '发起人', name: 'WRITER', width: "16%"},
  505. { display: '操作', name: 'count', width: "14%",render:function(rowdata,column){
  506. var next_do='"'+rowdata.IS_SEND+'"';
  507. var type = '"'+rowdata.DB_TYPE+'"';
  508. var fd_id = '"'+rowdata.FD_OBJECTID+'"';
  509. var types = '"'+rowdata.EARLY_WARNING_PROPERTY+'"';
  510. var report_type = '"'+rowdata.REPORT_TYPE+'"';
  511. var plan_id = '"'+rowdata.PLAN_ID+'"';//报告填报要求id
  512. var strhtml="<div class='caozuo'><div class='caozuo_btn' onclick='javascript:showNextDo("+next_do+","+type+","+fd_id+","+types+","+plan_id+","+report_type+");'>立即处理</div></div>";
  513. return strhtml;
  514. }}];
  515. console.log(JSON.stringify(gData));
  516. var $conttt = $("#dataGrid2");
  517. createIndexTable($conttt,gData,columsData);
  518. //隐藏加载图像
  519. hideLoading("index_right_4");
  520. //重置高度
  521. resetpageheight();
  522. });
  523. }
  524. function showName(data,culum){
  525. var value = data[culum];
  526. var result = "";
  527. switch (value){
  528. case "0" : result = "待处理"; break;
  529. case "1" :if(data.DB_TYPE=='交接班任务'){ result = "待交接"; }else{ result = "待交接"; } break;
  530. case "3" : result = "待签发"; break;
  531. case "4" : result = "待分发"; break;
  532. case "132" : result = "队伍待审核"; break;
  533. case "133" : result = "队伍待调拨"; break;
  534. case "134" : result = "审核未通过"; break;
  535. case "135" : result = "队伍调拨中"; break;
  536. case "54" : result = "装备待调拨"; break;
  537. case "52" : result = "装备待审核"; break;
  538. case "53" : result = "装备审核未通过"; break;
  539. case "55" : result = "装备调拨中"; break;
  540. case "999" : result = "待填报"; break;
  541. case "99999" : result = "待维护"; break;
  542. case "111" : result = "待修编"; break;
  543. }
  544. return result;
  545. }
  546. function getRole_id(id){
  547. if(id.indexOf(",")!=-1){
  548. var role_ids = id.split(",");
  549. for(var i=0;i<role_ids.length;i++){
  550. if(role_ids[i]=="R002105430210"||role_ids[i]=="R002105430211"||role_ids[i]=="R002105430212"||role_ids[i]=="R002105430213"){
  551. return role_ids[i];
  552. }
  553. }
  554. }else{
  555. return id;
  556. }
  557. }
  558. function showNextDo(next,type,id,types,plan_id,report_type){
  559. var idxURL = "";
  560. if(type=="交接班任务"){
  561. idxURL = $.pathname()+ "/page/business/em/response/tranfer/TransferInfo1.jsp?fd_id="+ id;
  562. }
  563. if(type=="响应通知单"){
  564. if(next=="1"){
  565. if(types=="51"){
  566. idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
  567. }else{
  568. idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
  569. }
  570. }else if(next=="3"){
  571. if(types=="51"){
  572. idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
  573. }else{
  574. idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
  575. }
  576. }else if(next=="4"){
  577. idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp?plan_id="+id;
  578. }
  579. }
  580. if(type=='发布报表任务'){
  581. if(next=="4"){
  582. idxURL = $.pathname()+ "/page/business/em/report/Report_Require.jsp";
  583. }
  584. }
  585. if(type=="预警通知单"){
  586. if(next=="1"){
  587. if(types=="51"){
  588. idxURL = $.pathname()+ "/page/business/em/alert/warning/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
  589. }else{
  590. idxURL = $.pathname()+ "/page/business/em/alert/warning/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
  591. }
  592. }else if(next=="3"){
  593. if(types=="51"){
  594. idxURL = $.pathname()+ "/page/business/em/alert/warning/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
  595. }else{
  596. idxURL = $.pathname()+ "/page/business/em/alert/warning/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
  597. }
  598. }else if(next=="4"){
  599. idxURL = $.pathname()+ "/page/business/em/alert/warning/Warning.jsp?plan_id="+id;
  600. }
  601. }
  602. if(type=="预警报告填报要求"){
  603. if(report_type=="1"){
  604. idxURL = $.pathname()+ "/page/business/em/alert/report/reportInput/ReportInputAddEdit.jsp?plan_id="+plan_id;
  605. }else if(report_type=="2"){
  606. idxURL = $.pathname()+ "/page/business/em/alert/report/reportInput1/ReportInputAddEdit.jsp?plan_id="+plan_id;
  607. }
  608. }
  609. if(type=="响应报告填报要求"){
  610. //alert("响应报告填报要求");
  611. if(report_type=="3"){
  612. idxURL = $.pathname()+ "/page/business/em/response/report/reportInput/ReportInputAddEdit.jsp?plan_id="+plan_id;
  613. }else if(report_type=="4"){
  614. idxURL = $.pathname()+ "/page/business/em/response/report/reportInput1/ReportInputAddEdit.jsp?plan_id="+plan_id;
  615. }
  616. }
  617. if(type=="队伍调拨"){
  618. //调拨
  619. if(next=="133"){
  620. idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandAudit.jsp?fd_id="+ id+"&is_audit="+1;
  621. }
  622. if(next=="132"){
  623. //审核
  624. idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandAuditCheck.jsp?fd_id="+ id+"&is_audit="+0;
  625. }
  626. if(next=="135"){
  627. idxURL = $.pathname()+ "/page/business/em/response/team/TeamAddEditTest.jsp?fd_id="+ id;
  628. }
  629. if(next=="134"){
  630. idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandInfo.jsp?fd_id="+ id;
  631. }
  632. }
  633. if(type=='预案修编'){
  634. //alert("预案修编")
  635. idxURL = $.pathname()+ "/page/business/am/contingencyPlan/ContingencyPlanXiubian.jsp?fd_id="+ id;
  636. }
  637. if(type=="装备调拨"){
  638. //审核
  639. if(next=="52"){
  640. idxURL = $.pathname()+"/page/business/em/response/equipment/EquipmentAudit.jsp?fd_id="+ id+"&is_audit="+0;
  641. }
  642. if(next=="53"){//审核未通过
  643. idxURL = $.pathname()+"/page/business/em/response/equipment/equipment_detail.jsp?fd_id="+ id;
  644. }
  645. if(next=="54"){
  646. idxURL = $.pathname()+ "/page/business/em/response/equipment/EquipmentAllot.jsp?fd_id="+ id+"&is_audit="+1;
  647. }
  648. if(next=="55"){
  649. idxURL = $.pathname()+ "/page/business/em/response/equipment/Eqallocate_addOnly.jsp?fd_id="+ id+"&is_audit="+1;
  650. }
  651. }
  652. if(type=="物资查看权限申请"){
  653. idxURL = $.pathname()+"/page/business/am/resource/ledger/readDeptMsginfo.jsp?"+id;
  654. }
  655. if(next=="999"&&type!="响应报告填报要求"&&type!="预警报告填报要求"){
  656. idxURL = $.pathname()+"/page/business/em/report/Report_Add.html?"+report_type+"?"+id+"_a";
  657. }
  658. if(type=="日常报表填报计划"){
  659. idxURL = $.pathname()+"/page/business/am/report/reportinput/Report_Add.html?"+report_type;
  660. }
  661. if(type=="日常报表维护计划"){
  662. if(report_type=='1'){
  663. idxURL = $.pathname()+ "/page/business/am/resource/team/teamer-inside.jsp";
  664. }
  665. if(report_type=='3'){
  666. idxURL = $.pathname()+ "/page/business/am/resource/team/team-poll.jsp";
  667. }
  668. if(report_type=='4'){
  669. idxURL = $.pathname()+ "/page/business/am/resource/team/team-poll-out.jsp";
  670. }
  671. if(report_type=='6'){
  672. idxURL = $.pathname()+ "/page/business/am/resource/ledger/command-car.jsp";
  673. }
  674. if(report_type=='8'){
  675. idxURL = $.pathname()+ "/page/business/am/resource/ledger/generator-car.jsp";
  676. }
  677. if(report_type=='10'){
  678. idxURL = $.pathname()+ "/page/business/am/resource/ledger/generator.jsp";
  679. }
  680. if(report_type=='5'){
  681. idxURL = $.pathname()+ "/page/business/am/resource/expert/expert-maintenance.jsp";
  682. }
  683. }
  684. windowOpenNext(idxURL);
  685. return false;
  686. }
  687. /*待办结束*/
  688. /*集成Url开始*/
  689. function getUrlData(idx,iframeUrl,contheight,contwidth){
  690. var $dom = $("#cont"+idx).find(".idxModule_content").last();
  691. if("广东电网有限责任公司"==corp_names){
  692. createTabUrl($dom);
  693. }
  694. //alert("getUrlData");
  695. $.ajax({
  696. url : $.pathname() +'/ws/moduleobj/queryURLData/',
  697. type : 'post',
  698. data : {
  699. user_id:user_id,
  700. dept_id:comp_id
  701. },
  702. dataType : 'json',
  703. success : function(data) {
  704. //console.log(JSON.stringify(data));
  705. if(data.state == "ok"&&data.length != 0){
  706. createIDXUrl($dom,data.resultData);
  707. }else{
  708. if("广东电网有限责任公司"!=corp_names){
  709. $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
  710. }
  711. }
  712. //隐藏加载图像
  713. hideLoading("index_left_3");
  714. //重置高度
  715. resetpageheight();
  716. },
  717. error : function(e) {
  718. try{
  719. //隐藏加载图像
  720. hideLoading("index_left_3");
  721. top.Dialog.alert('访问服务失败!');
  722. }catch(e){
  723. }
  724. }
  725. });
  726. }
  727. function createTabUrl($dom){
  728. $(".l3_url_tab").remove();
  729. $dom.append('<div class="l3_url_tab"><div><span class="l3_url_tab_span">地调EMS</span></div><div><span class="l3_url_tab_span">中调OS2</span></div></div>');
  730. $(".l3_url_tab_span").bind("click",function(){
  731. var $self = $(this);
  732. //alert($self.text());
  733. //var workurl = "";
  734. if($self.text()=="地调EMS"){
  735. var diag = new top.Dialog();
  736. diag.Title = "地调EMS";
  737. diag.Width= 400;
  738. diag.Height=180;
  739. diag.Drag=true;
  740. diag.URL = "/nwyj/page/index_module/difang_url.html";
  741. diag.show();
  742. diag.CancelEvent = function(){
  743. diag.close();
  744. diag=null;
  745. };
  746. }else{
  747. //workurl = "/nwyj/page/index_module/zhongdiao_url.html";
  748. window.open("http://10.150.62.9:50000/svg/");
  749. //return;
  750. }
  751. });
  752. }
  753. function createIDXUrl($dom,data){
  754. var $content = $('<ul></ul>');
  755. $dom.append($content);
  756. for (var i = 0; i < data.length; i++) {
  757. var menu = data[i];
  758. var $div = $('<li class="url_li1"></li>');
  759. //var span = $('<span class="idx_ic_circle url_list1 index_main_cursor">'+menu.url_name+'</span>');
  760. var span = $('<a class="idx_ic_circle url_list1 index_main_cursor">'+menu.url_name+'</a>');
  761. span.data("menu_url",menu.url_url);
  762. span.data("url_name",menu.url_name);
  763. span.bind("click",function(){
  764. //alert(1111);
  765. //$(top.document.body).find("#frmright").attr("src",$(this).data("menu_url"));
  766. //openIDXUrl($(this).data("menu_url"));
  767. if($(this).data("url_name")=="广东电网应急指挥图"){
  768. // 获取用户部门
  769. var dept_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  770. // 获取用户Id
  771. var user_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  772. var user_name1 = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
  773. //父部门id
  774. var parentId1 = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  775. var role_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  776. var dept_name1 = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  777. var menuUri1 = "http://10.150.74.8:8080/nwyj/page/cockpit/webgis/webgis.html?dept_id="+dept_id1+"&&user_id="+user_id1+"&&user_name="+encodeURI(user_name1)+"&&dept_name="+encodeURI(dept_name1)+"&&parentId="+parentId1+"&&role_id="+encodeURI(role_id1);
  778. window.open(menuUri1,"_blank","");
  779. }else{
  780. window.open($(this).data("menu_url"));
  781. }
  782. });
  783. $content.append($div);
  784. $div.append(span);
  785. menu = null;
  786. $div = null;
  787. span = null;
  788. }
  789. $content = null;
  790. }
  791. /**
  792. * 打开时,url集成过滤
  793. * @param url
  794. */
  795. function openIDXUrl(url) {
  796. //alert(2222);
  797. //http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?TOKEN=
  798. var vUrl="http://10.150.22.1/web/lcam/fwms/sso/certificate.ac?sapHrUserId="+saphruserid;
  799. jQuery.ajax({
  800. url:vUrl,
  801. dataType:'JSONP',
  802. success: function(result) {
  803. //alert(result);
  804. var indexUrl="http://10.150.22.1/web/lcam/fwms/sso/ssoLogin.ac?ssoticket="+result+"&path="+encodeURIComponent(url);
  805. //alert(3333);
  806. window.open(indexUrl);
  807. }
  808. });
  809. }
  810. /*集成Url结束*/
  811. /*预警与响应开始*/
  812. function getAlertResponseData(idx,iframeUrl,contheight,contwidth){
  813. var alertTitleJson = [{display:"政府预警与响应"},{display:"当前预警与响应"}];
  814. $dommm = $("#contindex_left_2").find(".idxModule_content").last();
  815. createAlertcontent($dommm,alertTitleJson);
  816. $.ajax({
  817. url : $.pathname() + '/ws/EventService/EventService/getGovInfo/',
  818. type : 'post',
  819. async:false,
  820. data : {
  821. deptId :comp_id
  822. },
  823. dataType : 'json',
  824. success : function(data) {
  825. var $dom1 = $("#contindex_left_2 .alert_cont").eq(0).find("ul").eq(0);
  826. //console.log(JSON.stringify(data));
  827. //console.log(data);
  828. if(data.length&&data.length != 0){
  829. //if(JSON.stringify(data) == "[]"||JSON.stringify(data) == "{}"){
  830. createAlertResponse1($dom1,data);
  831. }else{
  832. $dom1.append('<div class="empty_style"><span >暂无数据</span></div>');
  833. }
  834. //隐藏加载图像
  835. hideLoading("index_left_2");
  836. //重置高度
  837. resetpageheight();
  838. },
  839. error : function(e) {
  840. try{
  841. //隐藏加载图像
  842. hideLoading("index_left_2");
  843. top.Dialog.alert('访问服务失败!');
  844. }catch(e){
  845. }
  846. }
  847. });
  848. $.ajax({
  849. url : $.pathname() + '/ws/EventService/EventService/getInfoByUnit/',
  850. type : 'post',
  851. async:false,
  852. data : {
  853. deptId :comp_id
  854. },
  855. dataType : 'json',
  856. success : function(data) {
  857. var $dom2 = $("#contindex_left_2 .alert_cont").eq(1).find("ul").eq(0);
  858. //console.log(JSON.stringify(data));
  859. //console.log(data);
  860. if(data.length&&data.length != 0){
  861. //if(JSON.stringify(data) == "[]"||JSON.stringify(data) == "{}"){
  862. createAlertResponse2($dom2,data);
  863. }else{
  864. $dom2.append('<div class="empty_style"><span >暂无数据</span></div>');
  865. }
  866. //隐藏加载图像
  867. hideLoading("index_left_2");
  868. //重置高度
  869. resetpageheight();
  870. },
  871. error : function(e) {
  872. try{
  873. //隐藏加载图像
  874. hideLoading("index_left_2");
  875. top.Dialog.alert('访问服务失败!');
  876. }catch(e){
  877. }
  878. }
  879. });
  880. }
  881. //加载容器
  882. function createAlertcontent($content,data){
  883. //var $content = $('<div class="idxModule_content"></div>');
  884. //$dom.append($content);
  885. for(var j=0;j<data.length;j++){
  886. $content.append($('<div class="alert_title">'+data[j].display+'</div>'));
  887. var $contentDiv = $('<div class="alert_cont"><ul id = "alert_cont_'+j+'"></ul></div>');
  888. $content.append($contentDiv);
  889. }
  890. }
  891. //加载政府预警与响应
  892. function createAlertResponse1($dom,data){
  893. //$dom.empty();
  894. var value = data;
  895. var is_flag1 = false;
  896. for (var i = 0; i < value.length; i++) {
  897. if(i==3){
  898. $("#alert_cont_0").parent().height(175);
  899. is_flag1 = true;
  900. }
  901. var menu = value[i];
  902. var $div = $('<li><div class="alert_cont_div"></div></li>');
  903. var $span1 = $('<span class="idx_ic_circle alert_text index_main_cursor" title="'+menu.NOTICETYPE+menu.LEVEL+'">'+menu.NOTICETYPE+menu.LEVEL+'</span><br/>');
  904. $span1.data("fd_id",menu.FD_OBJECTID);
  905. $span1.data("type",menu.TYPE);
  906. $span1.bind("click",function(){
  907. var fd_id1 = $(this).data("fd_id");
  908. var type = $(this).data("type");
  909. var url = "";
  910. if(type == "warning"){
  911. url = $.pathname()+"/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveInfo.jsp?fd_id="+fd_id1;
  912. //url = $.pathname()+"/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveInfo.jsp";
  913. }else{
  914. url = $.pathname()+"/page/business/em/monitor/reponseReceive/GovResponseReceiveInfo.jsp?fd_id="+fd_id1;
  915. //url = $.pathname()+"/page/business/em/monitor/reponseReceive/GovResponseReceiveInfo.jsp";
  916. }
  917. //$(top.parent.document.body).find("#frmright").attr('src',url);
  918. //selfOpenNext(url);
  919. windowOpenNext(url);
  920. });
  921. $dom.append($div);
  922. var $div1 = $('<div class="con_d"></div>');
  923. $div.find(".alert_cont_div").append($span1).append($div1);
  924. var $span2 = $('<span class="index_main_cursor1">'+menu.RELEASE_UNIT+'</span>');
  925. $div1.append($span2);
  926. var cutDate = menu.RELEASE_DATE;
  927. if(menu.RELEASE_DATE&&cutDate!=""){
  928. cutDate = cutDate.split(" ")[0];
  929. }
  930. var $span3 = $('<span class="index_main_cursor2">'+cutDate+'</span>');
  931. $div1.append($span3);
  932. cutDate = null;
  933. }
  934. //设置动画
  935. if(is_flag1){
  936. listScroll($("#alert_cont_0"));
  937. is_flag1 = null;
  938. }
  939. }
  940. //加载当前预警与响应
  941. function createAlertResponse2($dom,data){
  942. //$dom.empty();
  943. var value = data;
  944. var is_flag1 = false;
  945. for (var i = 0; i < value.length; i++) {
  946. if(i==3){
  947. $("#alert_cont_1").parent().height(175);
  948. is_flag1 = true;
  949. }
  950. var menu = value[i];
  951. var $div = $('<li><div class="alert_cont_div"></div></li>');
  952. var $span1 = $('<span class="idx_ic_circle alert_text index_main_cursor" title="'+menu.EARLY_WARNING_NAME+'">'+menu.EARLY_WARNING_NAME+'</span><br/>');
  953. $span1.data("fd_id",menu.FD_OBJECTID);
  954. $span1.data("is_alert",menu.IS_ALERT);
  955. $span1.bind("click",function(){
  956. var fd_id1 = $(this).data("fd_id");
  957. var is_alert = $(this).data("is_alert");
  958. var url = "";
  959. if(is_alert == "0"){
  960. url = $.pathname()+"/page/business/em/alert/warning/WarningView.jsp?fd_id="+fd_id1;
  961. //url = $.pathname()+"/page/business/em/alert/warning/WarningView.jsp";
  962. }else{
  963. url = $.pathname()+"/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id="+fd_id1;
  964. //url = $.pathname()+"/page/business/em/response/emergencyResponse/WarningView.jsp";
  965. }
  966. //$(top.parent.document.body).find("#frmright").attr('src',url);
  967. //selfOpenNext(url);
  968. windowOpenNext(url);
  969. });
  970. $dom.append($div);
  971. var $div1 = $('<div class="con_d"></div>');
  972. $div.find(".alert_cont_div").append($span1).append($div1);
  973. var $span2 = $('<span class="index_main_cursor1">'+menu.RELEASE_UNIT_SHOW+'</span>');
  974. $div1.append($span2);
  975. var cutDate = menu.RELEASE_RELIEVE_DATE;
  976. if(menu.RELEASE_RELIEVE_DATE&&cutDate!=""){
  977. cutDate = cutDate.split(" ")[0];
  978. }
  979. var $span3 = $('<span class="index_main_cursor2">'+cutDate+'</span>');
  980. $div1.append($span3);
  981. cutDate = null;
  982. }
  983. //设置动画
  984. if(is_flag1){
  985. listScroll($("#alert_cont_1"));
  986. is_flag1 = null;
  987. }
  988. }
  989. /*设置预警与响应滚动效果*/
  990. function listScroll($this1){
  991. $this1.hover(function() {
  992. clearInterval(scrollTimer1);
  993. }, function() {
  994. scrollTimer1 = setInterval(function() {
  995. scrollNews($this1);
  996. }, 3000);
  997. });
  998. var scrollTimer1 = setInterval(function() {
  999. scrollNews($this1);
  1000. }, 3000);
  1001. }
  1002. function scrollNews(obj1) {
  1003. var $self = obj1;
  1004. var height = $self.find("li").height();
  1005. $self.animate({
  1006. "marginTop" : -height + "px"
  1007. }, 600, function() {
  1008. $self.css("marginTop", 0).find("li:first").appendTo($self);
  1009. });
  1010. }
  1011. /*政府预警与响应结束*/
  1012. /*资源分布图开始*/
  1013. function getResourceData(idx,iframeUrl,contheight,contwidth){
  1014. //引用iframe内容
  1015. setContentByUrl(idx,"/nwyj/page/cockpit/EmergencyresourceMainShow/EmergencyresourceMainShow.html","auto","900px");
  1016. }
  1017. /*资源分布图结束*/
  1018. /*南网模块开始*/
  1019. function getNwyjModuleData(idx,iframeUrl,contheight,contwidth){
  1020. //引用iframe内容
  1021. //openIDXUrl("",2);
  1022. //setContentByUrl($("#index_right_7"),"http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?tSession=1111","400px");
  1023. //$("#ifm_index_right_7").document.body.css({"overflowX":"scroll"});
  1024. //$self.css({"overflowY":"scroll"});
  1025. openNWYJModule(idx,iframeUrl,"400px","900px");
  1026. }
  1027. /**
  1028. * 打开时,url集成过滤
  1029. * @param url
  1030. */
  1031. function openNWYJModule(idx,moduleUrl,height,width) {
  1032. //alert("====>进入方法");
  1033. //var $dom = $("#"+idx);
  1034. //http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?TOKEN=
  1035. //alert(moduleUrl);
  1036. var vUrl="http://10.150.22.1/web/lcam/fwms/sso/certificate.ac?sapHrUserId="+saphruserid;
  1037. jQuery.ajax({
  1038. url:vUrl,
  1039. dataType:'JSONP',
  1040. success: function(result) {
  1041. //alert("====>通过验证得到结果:"+result);
  1042. var indexUrl="http://10.150.22.1/web/lcam/fwms/sso/ssoLogin.ac?ssoticket="+result
  1043. +"&path="+encodeURIComponent(moduleUrl+result);
  1044. //var indexUrl = moduleUrl+result;
  1045. //alert(indexUrl);
  1046. setContentByUrl(idx,indexUrl,height,width);
  1047. //alert("====>执行通过");
  1048. },
  1049. error : function(e) {
  1050. }
  1051. });
  1052. }
  1053. /*南网模块结束*/
  1054. /*故障系统模块*/
  1055. /**
  1056. * 故障系统模块
  1057. */
  1058. function getGZXTModuleData (idx,moduleUrl,contheight,contwidth) {
  1059. var userticket = top.com.sinosoft.lz.system.user.LoginInfo.getUserTicket();
  1060. if(userticket&&userticket!=null&&userticket!=undefined&&userticket!="undefined"){
  1061. var indexUrl = moduleUrl+userticket;
  1062. //alert(indexUrl);
  1063. setContentByUrl(idx,indexUrl,"420px","900px");
  1064. //setContentByUrl(idx,"/nwyj/page/GZXT404.jsp","200px","auto");
  1065. }else{
  1066. setContentByUrl(idx,"/nwyj/page/GZXT404.jsp","200px","auto");
  1067. //delectModule(idx);
  1068. }
  1069. }
  1070. /*故障系统模块*/
  1071. /*线路跳闸曲线*/
  1072. function getLineTripSumStrend(idx,iframeUrl,contheight,contwidth){
  1073. //var $dom = $("#index_right_5");
  1074. var url = "/nwyj/page/cockpit/echart_maticView/line_trip/line_trip_sum_strend.html?"
  1075. +"dept_id="+dept_id
  1076. +"?user_id="+user_id
  1077. +"?dept_name="+deptnames
  1078. +"?parentId="+parent_ids
  1079. +"?style=style1"
  1080. +"?legendColor=green"//图例字体颜色
  1081. +"?xAxisColor=black"//X轴字体颜色
  1082. +"?xAxisColor=black"//Y轴字体颜色
  1083. +"?titleColor=black";//标题颜色
  1084. //引用iframe内容
  1085. setContentByUrl(idx,url,"380px","380px");
  1086. //$dom.find(".idxModule_content").css("height","380px")/*.css("background-color", "#9C9A9B")*/;
  1087. //$dom = null;
  1088. url = null;
  1089. }
  1090. /*线路跳闸曲线*/
  1091. /*线路跳闸曲线*/
  1092. function getImportentUserOutageStrend(idx,iframeUrl,contheight,contwidth){
  1093. //var $dom = $("#index_left_5");
  1094. var url = "/nwyj/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_strend.html?"
  1095. +"dept_id="+dept_id
  1096. +"?user_id="+user_id
  1097. +"?dept_name="+deptnames
  1098. +"?parentId="+parent_ids
  1099. +"?style=style1"
  1100. +"?legendColor=green"//图例字体颜色
  1101. +"?xAxisColor=black"//X轴字体颜色
  1102. +"?xAxisColor=black"//Y轴字体颜色
  1103. +"?titleColor=black";//标题颜色;
  1104. //引用iframe内容
  1105. setContentByUrl(idx,url,"380px","280px");
  1106. //$dom.find(".idxModule_content").css("background-color", "#848484");
  1107. //$dom.find(".idxModule_content").css("height","280px");
  1108. //$dom = null;
  1109. url = null;
  1110. }
  1111. /*线路跳闸曲线*/
  1112. /*曲线iframe*/
  1113. function getStrendIframeData (idx,iframeUrl,contheight,contwidth){
  1114. //var $dom = $("#"+idx).last();
  1115. var url = "/nwyj/"+iframeUrl
  1116. +"?dept_id="+dept_id
  1117. +"?user_id="+user_id
  1118. +"?dept_name="+deptnames
  1119. +"?parentId="+parent_ids
  1120. +"?style=style1"
  1121. +"?legendColor=green"//图例字体颜色
  1122. +"?xAxisColor=black"//X轴字体颜色
  1123. +"?xAxisColor=black"//Y轴字体颜色
  1124. +"?titleColor=black";//标题颜色;
  1125. +"?iframeModuleID="+idx;//idx;
  1126. //引用iframe内容
  1127. setContentByUrl(idx,url,"380px","380px");
  1128. //setContentByUrl($dom,"/nwyj/test.html");\
  1129. //$dom.find(".idxModule_content").css("height","380px");
  1130. url = null;
  1131. //$dom = null;
  1132. }
  1133. /*曲线iframe*/
  1134. /*附件下载*/
  1135. function getAccessoryData(idx,iframeUrl,contheight,contwidth){
  1136. //alert(111);
  1137. var $dom = $("#cont"+idx).find(".idxModule_content").last();
  1138. $.ajax({
  1139. url : $.pathname() +'/ws/moduleobj/queryAccessoryData/',
  1140. type : 'post',
  1141. data : {
  1142. //compIds : comp_id
  1143. },
  1144. dataType : 'json',
  1145. success : function(data) {
  1146. if(data.state == "ok"&&data.length != 0){
  1147. createAccessory($dom,data.resultData);
  1148. }else{
  1149. $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
  1150. }
  1151. //隐藏加载图像
  1152. hideLoading(idx);
  1153. //重置高度
  1154. resetpageheight();
  1155. },
  1156. error : function(error) {
  1157. try {
  1158. //隐藏加载图像
  1159. hideLoading(idx);
  1160. top.Dialog.alert('访问服务失败!');
  1161. } catch (e) {
  1162. }
  1163. }
  1164. });
  1165. }
  1166. function createAccessory($dom,data){
  1167. //alert(JSON.stringify(data));
  1168. var $cont = $('<div class="l6_cont"></div>');
  1169. $dom.append($cont);
  1170. var $listcont = $('<div class="l6_list_cont "></div>');
  1171. var $morebtn = $('<div class="l6_more_btn ">更多</div>');
  1172. $cont.append($listcont).append($morebtn);
  1173. for(var i=0;i<data.length;i++){
  1174. var l6name = data[i].name+"."+data[i].fileext;
  1175. var l6date = getAcceDate(data[i].uploadtime);
  1176. var $list = $('<div class="l6_list"><span class="l6_span1" >'+l6name+'</a></span><span class="l6_span2 ">'+l6date+'</span></div>')
  1177. $listcont.append($list);
  1178. $list.data("fd_id",data[i].fd_id);
  1179. $list.data("filename",data[i].name);
  1180. $list.data("downloadname",data[i].savename);
  1181. $list.data("fileext",data[i].fileext);
  1182. }
  1183. $morebtn.bind("click",function(){
  1184. windowOpenNext("/nwyj/page/system/accessory/accessoryList.jsp");
  1185. //windowOpenNext("/nwyj/page/system/accessory/test.jsp");
  1186. });
  1187. $(".l6_span1").bind("click",function(){
  1188. var $parent = $(this).parent();
  1189. var fd_id = $parent.data("fd_id");
  1190. var filename = $parent.data("filename");
  1191. var downloadname = $parent.data("downloadname");
  1192. var fileext = $parent.data("fileext");
  1193. downloadFile(fd_id,filename,downloadname,fileext);
  1194. });
  1195. }
  1196. function downloadFile(fd_id,filename,downloadname,fileext){
  1197. var url = $.pathname() + '/page/common/getFileExc.jsp?objectID=' + fd_id+
  1198. "&downfilename=" + encodeURI(encodeURI(filename)+ "." +fileext) +
  1199. "&filename=" + encodeURI(encodeURI(downloadname)+ "." +fileext);
  1200. //window.open(url,"_self");
  1201. window.open(url);
  1202. }
  1203. function getAcceDate(dateStr){
  1204. if(dateStr&&dateStr!=null&dateStr!=""){
  1205. var yueri = dateStr.split(" ")[0];
  1206. var currentDate = allGetServerTime();
  1207. var today = changeDateToString(currentDate.DateAdd("d", 0));
  1208. var yestoday = changeDateToString(currentDate.DateAdd("d", -1));
  1209. var qiantian = changeDateToString(currentDate.DateAdd("d", -2));
  1210. if(yueri==today){
  1211. return "今天";
  1212. }else if(yueri==yestoday){
  1213. return "昨天";
  1214. }else if(yueri==qiantian){
  1215. return "前天";
  1216. }else{
  1217. return yueri;
  1218. }
  1219. }else{
  1220. return "";
  1221. }
  1222. }
  1223. /*附件下载*/
  1224. /**
  1225. * 本页面打开地址
  1226. */
  1227. function selfOpenNext(workUrl){
  1228. $(top.parent.document.body).find("#main_index_tab").hide();
  1229. $(top.parent.document.body).find("#frmright").attr('src',workUrl);
  1230. }
  1231. /**
  1232. * 打开新页面
  1233. */
  1234. function windowOpenNext(workUrl){
  1235. $.indexOpenNextWindow(workUrl);
  1236. //window.open("/nwyj/page/frameWork.html?name="+userData+"&idxWorkUrl="+workUrl+"&idxWorkData="+workData,"MSG");
  1237. //if(getOs()=="MSIE"){
  1238. /*var userInfoStr = top.com.sinosoft.lz.system.user.LoginInfo.getUserInfo();
  1239. var opener=window.open("/nwyj/page/frameWork.html");
  1240. opener.fatherParam={"name":userInfoStr,"idxWorkUrl":workUrl};*/
  1241. /*}else{
  1242. var opener=window.open("../page/frameWork.html","_blank","",false);
  1243. opener.fatherParam={"name":userData,"idxWorkUrl":workUrl,"idxWorkData":workData};
  1244. }*/
  1245. }
  1246. //判断浏览器的类型
  1247. function getOs(){
  1248. if(navigator.userAgent.indexOf("MSIE")>0) {
  1249. return "MSIE";
  1250. } ;
  1251. if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
  1252. return "Firefox";
  1253. } ;
  1254. if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
  1255. return "Safari";
  1256. } ;
  1257. if(isCamino=navigator.userAgent.indexOf("Camino")>0){
  1258. return "Camino";
  1259. };
  1260. if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
  1261. return "Gecko";
  1262. } ;
  1263. };