123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350 |
- var _this = this;
- _this.listGrid1 = null;// 值班数据列表
- _this.listGrid2 = null;// 代办数据列表
- //获得当前系统日期
- function getDate(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds();
- 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)*/;
- return s;
- }
- //转化日期格式
- function changeDateToString(date){
- var s="";
- var d = date;
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds();
- 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)*/;
- return s;
- }
- /*$(function(){
- //加载资源分布图数据
- //getResourceData();
- //setTitleName($("#index_right_1"),"资源分布图");
- //加载值班信息数据
- //loadDuty();
- //加载常用菜单数据
- //getWorkMenuData();
- //加载集成url数据
- //getUrlData();
- //加载预警与响应
- //getAlertResponseData();
- //待办
- //getdaibanData();
- //加载应急业务应用数据
- //getBusinessData();
- //getUserData();
- });
- */
- /**
- * 设置模块iframe模块
- * @param $dom
- * @param iframeUrl
- */
- function setContentByUrl(idx,iframeUrl,contheight,contwidth){
- //console.log($dom.html());
- var $dom = $("#cont"+idx);
- var $content = $dom.find(".idxModule_content");
- //var id = $dom.attr("id");
- //console.log($content);
- if($content.length == 0){
- $dom.append('<div class="idxModule_content iframe_cont" ></div>');
- $content = $dom.find(".idxModule_content");
- }else{
- $content.empty();
- }
- 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>');
- //var $iframe = $('<iframe name="" id="ifm_'+idx+'" src="'+iframeUrl+'" onload="Javascript:idxIframeOnload(\''+idx+'\');" width="100%" height = "'+contheight+'" frameborder = "0" ></iframe>');
- $content.append($iframe);
- $iframe = null;
- iframeUrl = null;
- $content = null;
- id = null;
- }
- /**
- * iframe加载完成时需要完成的函数
- * @param idx
- */
- function idxIframeOnload(idx){
- //隐藏加载图标
- hideLoading(idx);
- //重置高度
- resetpageheight();
- }
- /*
- function SetWinHeight(obj){
- var win = obj;
- if(document.getElementById){
- if(win && !window.opera){
- if(win.contentDocument && win.contentDocument.body.offsetHeight){
- win.height = win.contentDocument.body.offsetHeight;
- }else if(win.contentDocument && win.contentDocument.body.scrollHeight){
- win.height = win.contentDocument.body.scrollHeight;
- }
- }
- }
- }
- */
- /* 日期计算
- *
- * */
- Date.prototype.DateAdd = function(strInterval, Number) {
- var dtTmp = this;
- switch (strInterval) {
- case 's' :return new Date(Date.parse(dtTmp) + (1000 * Number));
- case 'n' :return new Date(Date.parse(dtTmp) + (60000 * Number));
- case 'h' :return new Date(Date.parse(dtTmp) + (3600000 * Number));
- case 'd' :return new Date(Date.parse(dtTmp) + (86400000 * Number));
- case 'w' :return new Date(Date.parse(dtTmp) + ((86400000 * 7) * Number));
- //一个月的number倍
- case 'm' :return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
- //三个月的number倍
- case 'q' :return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number*3, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
- //一年的number倍
- case 'y' :return new Date((dtTmp.getFullYear() + Number), dtTmp.getMonth(), dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
- }
- };
- /*公告开始*/
- function getGongGaoData(idx,iframeUrl,contheight,contwidth) {
- var $dom = $("#cont"+idx).find(".idxModule_content").last();
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/queryGongGaoData/',
- type : 'post',
- data : {
- compIds : comp_id,
- compNames : corp_names
- },
- dataType : 'json',
- success : function(data) {
- if(data.state == "ok"&&data.length != 0){
- createGongGao($dom,data.resultData);
- }else{
- $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
- }
- //隐藏加载图像
- hideLoading(idx);
- //重置高度
- resetpageheight();
- },
- error : function(error) {
- try {
- //隐藏加载图像
- hideLoading(idx);
- top.Dialog.alert('访问服务失败!');
- } catch (e) {
- }
- }
- });
-
- }
- function createGongGao ($content,data){
- //$content.html("");
- //console.log(JSON.stringify(data));
- //var $content = $('<div class="idxModule_content"></div>');
- //$("#index_right_6").append($content);
- var $rl6Cont = $('<div class="rl6_cont"></div>');
- $content.append($rl6Cont);
- var titleCont = $('<div class="rl6_title">'+data[0].TITLE+'</div>');
- var timeCont = $('<div class="rl6_time">'+data[0].SUBTIME+'</div>');
- var textCont = $('<div class="rl6_marquee " id="rl6_marquee" ><div id="rl6_marquee1">'+data[0].CONTENT+'</div><div id="rl6_marquee2"></div></div>');
- //var textCont1 = $('<div class="rl6_text rl6_text_more" id="rl6_text1" >'+data[0].CONTENT+'</div>');
- //var textCont2 = $('<div class="rl6_text " id="rl6_text2" style="display:none;">'+data[0].CONTENT+'</div>');
- //var deptCont = $('<div class="rl6_dept">发布人:<span>'+data[0].DEPT_NAME+'</span> <span>'+data[0].PERSON+'</span></div>');
- var moreCont = $('<div class="rl6_more"><a>点击查看更多公告</a></div>');
- moreCont.data("fd_id",data[0].FD_OBJECTID);
- $rl6Cont.append(titleCont).append(timeCont).append(textCont).append(moreCont)/*.append(textCont2).append(deptCont)*/;
-
- createUpMarquee("rl6_marquee","rl6_marquee1","rl6_marquee2");
- moreCont.bind("click",function(){
- //var fd_id = $(this).data("fd_id");
- var idxURL = "/nwyj/page/system/notice/NoticeList.jsp";
- windowOpenNext(idxURL);
- });
- //重置高度
- //resetpageheight();
- }
- /**
- * 文字向上滚动动画
- * @param id
- * @param id1
- * @param id2
- */
- function createUpMarquee(id,id1,id2){
- var speed = 40;
- var ee = document.getElementById(id);
- var ee1 = document.getElementById(id1);
- var ee2 = document.getElementById(id2);
- ee2.innerHTML=ee1.innerHTML;
- function Marquee(){
- if(ee2.offsetTop-ee.scrollTop<=0){
- ee.scrollTop -= (ee1.offsetHeight+10);
- }else{
- ee.scrollTop ++;
- }
- }
- var myMar = setInterval(Marquee,speed);
- ee.onmouseover = function(){
- clearInterval(myMar);
- $(ee2).hide();
- var $self = $(this);
- $self.css({"overflowY":"scroll"});
- };
- ee.onmouseout = function(){
- $(ee2).show();
- var $self = $(this);
- $self.css({"overflowY":"hidden"});
- myMar = setInterval(Marquee,speed);
- };
- }
- /*公告结束*/
- /*个人信息开始*/
- function getUserData(idx,iframeUrl,contheight,contwidth) {
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/getReadedCount',
- type : 'post',
- data : {
- userId : user_id
- },
- dataType : 'text',
- success : function(data) {
- createUserData(idx,data);
- //隐藏加载图像
- hideLoading(idx);
- //重置高度
- resetpageheight();
- },
- error : function(e) {
- try {
- //隐藏加载图像
- hideLoading(idx);
- top.Dialog.alert('访问服务失败!');
- } catch (e) {
- }
- }
- });
-
- }
- function createUserData (idx,data){
- var $dom = $("#cont"+idx).find(".idxModule_content").last();
- $dom.html("");
- var rolenamesArr = rolenames.split(",");
- var l4_rolenames = "";
- for(var i=0;i<rolenamesArr.length;i++ ){
- if(i==rolenamesArr.length-1){
- l4_rolenames += rolenamesArr[i];
- }else{
- l4_rolenames += (rolenamesArr[i]+"<br/>");
- }
- }
- //l4_rolenames = rolenames;
- var $content = $('<div class="l4_cont1"></div>');
- $dom.append($content);
- var loginDate = "新登陆用户";
- if(logindate!=null){
- loginDate = logindate;
- }
- //var $photo = $('<div class="l4_img_div"> <img class="l4_img" src="/nwyj/images/index/module_img/user_photo.png" alt="" /> </div>');
- //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>');
- 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>');
-
- //$content.find(".l4_cont1").append($photo).append($userMsg);
- $content.append($userMsg);
- //alert($photo.width()+","+$userMsg.width()+","+$(".l4_cont1").width());
- //$(".l4_cont1_right").css("max-width",($(".l4_cont1").width()-$photo.width()));
- //alert($userMsg.width());
- //alert($(".l4_cont1").width());
- var $msgNum = $('<div class="msg_numb_cont" id="msg_numb_cont"><a class="msg_numb" id="msg_numb">'+data+'</a></div>');
- $msgNum.bind("click",function(){
- //$(top.document.body).find("#frmright").attr("src","/nwyj/page/system/message/recivedListMsg.jsp");
- //selfOpenNext("/nwyj/page/system/message/recivedListMsg.jsp");
- var idxURL = "/nwyj/page/system/message/recivedListMsg.jsp";
- windowOpenNext(idxURL);
- });
- $userMsg.find(".msg_img_cont").append($msgNum);
- $userMsg = null;
- $photo = null;
- $content = null;
- $msgNum = null;
-
-
- }
- /*个人信息结束*/
- /*工作台菜单开始*/
- function getWorkMenuData(idx,iframeUrl,contheight,contwidth){
- //alert(111);
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/queryIndexMenuByroleId/',
- type : 'post',
- data : {
- user_id:user_id
- },
- dataType : 'json',
- async:false,
- success : function(data) {
-
- createWorkMenu($("#contindex_left_1"),data.resultData);
- //隐藏加载图像
- hideLoading("index_left_1");
- //重置高度
- resetpageheight();
- },
- error : function(e) {
- try{
- //隐藏加载图像
- hideLoading("index_left_1");
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- }
- });
- }
- function createWorkMenu($dom,data){
- var $conttt = $dom.find(".idxModule_content").last();
- var $menuContent = $('<div class="menu_cont"></div>');
- $conttt.append($menuContent);
- for(var j=0;j<data.length;j++){
- createMenuItem(data[j],$menuContent);
- }
- //添加按钮
- var $div1 = $('<div class="menu_grid"><img class="menu_img" src="/nwyj/images/index/more/menu_add.png"/><div class="menu_text">添加</div></div>');
- $div1.bind("click",function(){
- //$(top.document.body).find("#frmright").attr("src","/nwyj/page/all_menu.jsp");
- selfOpenNext("/nwyj/page/all_menu.jsp");
- });
- $menuContent.append($div1);
- $menuContent=null;
- $div1=null;
- }
- /*function createWorkMenu($dom,data){
- var $conttt = $dom.find(".idxModule_content").last();
- var $menuContent = $('<div class="menu_cont"></div>');
- $conttt.append($menuContent);
- var dataLength = Math.ceil((data.length+1)/3);
- //console.log(dataLength);
- for(var j=0;j<dataLength;j++){
- var $contul = $('<div class = "cont_ul" id="cont_ul'+j+'"></div>');
- $menuContent.append($contul);
- for (var i = j*3; i < (j+1)*3; i++) {
- if(i<data.length){
- var menu = data[i];
- //添加每个menu
- createMenuItem(menu,$contul);
- menu = null;
- }
- }
- }
- //添加按钮
- var $div1 = $('<div class="menu_grid"><img class="menu_img" src="/nwyj/images/index/more/menu_add.png"/><div class="menu_text">添加</div></div>');
- $div1.bind("click",function(){
- //$(top.document.body).find("#frmright").attr("src","/nwyj/page/all_menu.jsp");
- selfOpenNext("/nwyj/page/all_menu.jsp");
- });
- $("#cont_ul"+(dataLength-1)).append($div1);
- $menuContent=null;
- $div1=null;
- heit=null;
-
- }
- */
- /**
- * 创建工作菜单的每个item
- * @param menu
- * @param $menuContent
- */
- function createMenuItem(menu,$contul){
- var image_url = menu.IMAGE_URL;
- 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>');
- $div.data("menu_url",menu.BUSINESS_URL);
- $div.data("menu_id",menu.MENU_ID);
- $contul.append($div);
- $div.bind("click",function(){
- var memuId = $(this).data("menu_id");
- $.indexUserClickNum (user_id,memuId);
- //$(top.document.body).find("#frmright").attr("src",$(this).data("menu_url"));
- //selfOpenNext($(this).data("menu_url"));
- var idxURL = $(this).data("menu_url");
- windowOpenNext(idxURL);
- });
- $div = null;
- image_url = null;
- }
- /*工作台菜单结束*/
- /*值班信息开始*/
- function loadDuty(idx,iframeUrl,contheight,contwidth){
- //初始话标题栏tab
- var $dateCont = $('<div class = "date_tab_cont"></div>');
- $("#index_right_2").append($dateCont);
- $dateCont.append('<span class="changeDate" value="-1">前一天</span><span class="changeDate" value="0" >今天</span><span class="changeDate" value="1">后一天</span>');
- //初始话content
- $(".changeDate").live("click",function(){
- var number = $(this).attr("value");
- //console.log(number);
- var currentDate = allGetServerTime();
- var selectDate = changeDateToString(currentDate.DateAdd("d", parseInt(number)));
- //console.log(currentDate.DateAdd("m", parseInt(number)));
- $(".changeDate").removeClass("selectDate");
- $(this).addClass("selectDate");
- getDutyDate(selectDate);
- number = null;
- currentDate = null;
- selectDate = null;
- });
- $(".changeDate").eq(1).click();
- }
- function getDutyDate(date){
- var gData = [];
- $.ajax({
- url : $.pathname() + '/ws/EventService/EventService/getDutyInfoByDate/',
- type : 'post',
- data : {
- "date":date,
- "deptId":comp_id
- },
- dataType : 'json',
- //timeout : 5000,
- success : function(data) {
- gData = data;
- },
- error : function(error) {
- try{
- $.messager.alert('访问服务失败!', 'error');
- }catch(e){
- }
- }
- }).done(function(){
- var $dom = $("#contindex_right_2").find(".idxModule_content").last();
- $dom.html("");
- $dom.append('<div class="dutyTable"><div class="dutyTableCont"><div style="" id="dataGrid1"></div></div></div>');
- var $conttt = $("#dataGrid1");
- var columsData = [ { display : '开始时间',name : 'START_TIME',width : "10%"},
- { display : '结束时间', name : 'END_TIME',width : "10%" },
- { display : '值班领导', name : 'LEADER_NAME',width : "10%"},
- { display : '领导电话', name : 'LEADER_TEL', width : "12%"},
- { display : '值班人员,联系电话', name : 'NAME', width : "32%"},
- { display : '值班方式',name : 'DUTY_MODE_SHOW',width : "10%"},
- { display : '单位',name : 'CORP_NAME',width : "16%" }];
- createIndexTable($conttt,gData,columsData);
- //隐藏加载图像
- hideLoading("index_right_2");
- //重置高度
- resetpageheight();
- });
- }
- /*值班信息结束*/
- /**
- * 动态创建首页表格
- */
- function createIndexTable($dom,gridData,columsData){
- var tablehtml = '<div class="tablediv"><table class="tablecont" cellspacing="0" >';
- tablehtml += '<tr class="tablehead">';
- for(var i=0;i<columsData.length;i++){
- tablehtml += '<th width="'+columsData[i].width+'"><span>'+columsData[i].display+'</span></th>';
- }
- tablehtml += '</tr>';
- //console.log(JSON.stringify(gridData));
- if(gridData.length!=0){
- for(var j=0;j<gridData.length;j++){
- var rowData = gridData[j];
- tablehtml += '<tr class="tablerow">';
- for(var k=0;k<columsData.length;k++){
- var culum = columsData[k].name;
- var renderFun = columsData[k].render;
- if(renderFun&&renderFun!=""){
- var strhtml = renderFun(rowData,culum);
- tablehtml += '<td ><span >'+strhtml+'</span></td>';
- }else{
- tablehtml += '<td ><span title="'+rowData[culum]+'">'+rowData[culum]+'</span></td>';
- }
- }
- tablehtml += '</tr>';
- }
- }else{
- tablehtml += '<tr ><td height="40px" colspan="'+columsData.length+'">此列表暂无数据</td></tr>';
- }
- tablehtml += '</table></div>';
- $dom.append(tablehtml);
- }
- /*待办开始*/
- function getdaibanData(idx,iframeUrl,contheight,contwidth){
- var $conttt = $("#contindex_right_4").find(".idxModule_content").last();
- $conttt.append('<div class="dutyTable"><div class="dutyTableCont"><div style="" id="dataGrid2"></div></div></div>');
- getdaibanAjax();
- }
- function getdaibanAjax(){
- var gData = [];
- $.ajax({
- url : "/nwyj/ws/xianlutingyun/XianlutingyunService/getDBmsg",
- type : 'post',
- data : {
- user_id:user_id,
- //role_id:getRole_id(),
- role_id:getRole_id(role_id),
- company_id:comp_id,
- type:''
- },
- async:false,
- //timeout : 5000,
- dataType : 'json',
- success : function(data){
- gData = data.rows.rows;
- },
- error : function(e){
- try{
- $.messager.alert('访问服务失败!', 'error');
- }catch(e){
- }
- }
- }).done(function(){
- var columsData = [{ display: '事件类型', name: 'DB_TYPE', width: "15%"},
- { display: '事件名称', name: 'NAME', width: "30%"},
- { display: '下一步操作', name: 'IS_SEND', width: "10%", render:showName},
- { display: '发起时间', name: 'WRITE_TIME', width: "15%"},
- { display: '发起人', name: 'WRITER', width: "16%"},
- { display: '操作', name: 'count', width: "14%",render:function(rowdata,column){
- var next_do='"'+rowdata.IS_SEND+'"';
- var type = '"'+rowdata.DB_TYPE+'"';
- var fd_id = '"'+rowdata.FD_OBJECTID+'"';
- var types = '"'+rowdata.EARLY_WARNING_PROPERTY+'"';
- var report_type = '"'+rowdata.REPORT_TYPE+'"';
- var plan_id = '"'+rowdata.PLAN_ID+'"';//报告填报要求id
- var strhtml="<div class='caozuo'><div class='caozuo_btn' onclick='javascript:showNextDo("+next_do+","+type+","+fd_id+","+types+","+plan_id+","+report_type+");'>立即处理</div></div>";
- return strhtml;
- }}];
- console.log(JSON.stringify(gData));
- var $conttt = $("#dataGrid2");
- createIndexTable($conttt,gData,columsData);
- //隐藏加载图像
- hideLoading("index_right_4");
- //重置高度
- resetpageheight();
- });
- }
- function showName(data,culum){
- var value = data[culum];
- var result = "";
- switch (value){
- case "0" : result = "待处理"; break;
- case "1" :if(data.DB_TYPE=='交接班任务'){ result = "待交接"; }else{ result = "待交接"; } break;
- case "3" : result = "待签发"; break;
- case "4" : result = "待分发"; break;
- case "132" : result = "队伍待审核"; break;
- case "133" : result = "队伍待调拨"; break;
- case "134" : result = "审核未通过"; break;
- case "135" : result = "队伍调拨中"; break;
- case "54" : result = "装备待调拨"; break;
- case "52" : result = "装备待审核"; break;
- case "53" : result = "装备审核未通过"; break;
- case "55" : result = "装备调拨中"; break;
- case "999" : result = "待填报"; break;
- case "99999" : result = "待维护"; break;
- case "111" : result = "待修编"; break;
- }
- return result;
- }
- function getRole_id(id){
- if(id.indexOf(",")!=-1){
- var role_ids = id.split(",");
- for(var i=0;i<role_ids.length;i++){
- if(role_ids[i]=="R002105430210"||role_ids[i]=="R002105430211"||role_ids[i]=="R002105430212"||role_ids[i]=="R002105430213"){
- return role_ids[i];
- }
- }
- }else{
- return id;
- }
- }
- function showNextDo(next,type,id,types,plan_id,report_type){
- var idxURL = "";
- if(type=="交接班任务"){
- idxURL = $.pathname()+ "/page/business/em/response/tranfer/TransferInfo1.jsp?fd_id="+ id;
- }
- if(type=="响应通知单"){
- if(next=="1"){
- if(types=="51"){
- idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
- }else{
- idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
- }
- }else if(next=="3"){
- if(types=="51"){
- idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
- }else{
- idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
- }
- }else if(next=="4"){
- idxURL = $.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp?plan_id="+id;
- }
-
- }
-
- if(type=='发布报表任务'){
-
- if(next=="4"){
- idxURL = $.pathname()+ "/page/business/em/report/Report_Require.jsp";
- }
- }
-
-
- if(type=="预警通知单"){
- if(next=="1"){
- if(types=="51"){
- idxURL = $.pathname()+ "/page/business/em/alert/warning/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
- }else{
- idxURL = $.pathname()+ "/page/business/em/alert/warning/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+0;
- }
- }else if(next=="3"){
- if(types=="51"){
- idxURL = $.pathname()+ "/page/business/em/alert/warning/RelieveFlowAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
- }else{
- idxURL = $.pathname()+ "/page/business/em/alert/warning/WarningAuditIssue.jsp?fd_id="+ id+"&is_audit="+1;
- }
- }else if(next=="4"){
- idxURL = $.pathname()+ "/page/business/em/alert/warning/Warning.jsp?plan_id="+id;
- }
- }
- if(type=="预警报告填报要求"){
- if(report_type=="1"){
- idxURL = $.pathname()+ "/page/business/em/alert/report/reportInput/ReportInputAddEdit.jsp?plan_id="+plan_id;
- }else if(report_type=="2"){
- idxURL = $.pathname()+ "/page/business/em/alert/report/reportInput1/ReportInputAddEdit.jsp?plan_id="+plan_id;
- }
- }
- if(type=="响应报告填报要求"){
- //alert("响应报告填报要求");
- if(report_type=="3"){
- idxURL = $.pathname()+ "/page/business/em/response/report/reportInput/ReportInputAddEdit.jsp?plan_id="+plan_id;
- }else if(report_type=="4"){
- idxURL = $.pathname()+ "/page/business/em/response/report/reportInput1/ReportInputAddEdit.jsp?plan_id="+plan_id;
- }
- }
-
- if(type=="队伍调拨"){
- //调拨
- if(next=="133"){
- idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandAudit.jsp?fd_id="+ id+"&is_audit="+1;
- }
-
- if(next=="132"){
- //审核
- idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandAuditCheck.jsp?fd_id="+ id+"&is_audit="+0;
- }
-
- if(next=="135"){
- idxURL = $.pathname()+ "/page/business/em/response/team/TeamAddEditTest.jsp?fd_id="+ id;
- }
- if(next=="134"){
- idxURL = $.pathname()+ "/page/business/em/response/team/TeamDemandInfo.jsp?fd_id="+ id;
- }
- }
-
- if(type=='预案修编'){
- //alert("预案修编")
- idxURL = $.pathname()+ "/page/business/am/contingencyPlan/ContingencyPlanXiubian.jsp?fd_id="+ id;
- }
-
-
- if(type=="装备调拨"){
- //审核
- if(next=="52"){
- idxURL = $.pathname()+"/page/business/em/response/equipment/EquipmentAudit.jsp?fd_id="+ id+"&is_audit="+0;
- }
- if(next=="53"){//审核未通过
- idxURL = $.pathname()+"/page/business/em/response/equipment/equipment_detail.jsp?fd_id="+ id;
- }
- if(next=="54"){
- idxURL = $.pathname()+ "/page/business/em/response/equipment/EquipmentAllot.jsp?fd_id="+ id+"&is_audit="+1;
- }
- if(next=="55"){
- idxURL = $.pathname()+ "/page/business/em/response/equipment/Eqallocate_addOnly.jsp?fd_id="+ id+"&is_audit="+1;
- }
- }
-
- if(type=="物资查看权限申请"){
- idxURL = $.pathname()+"/page/business/am/resource/ledger/readDeptMsginfo.jsp?"+id;
- }
-
- if(next=="999"&&type!="响应报告填报要求"&&type!="预警报告填报要求"){
- idxURL = $.pathname()+"/page/business/em/report/Report_Add.html?"+report_type+"?"+id+"_a";
- }
- if(type=="日常报表填报计划"){
- idxURL = $.pathname()+"/page/business/am/report/reportinput/Report_Add.html?"+report_type;
- }
- if(type=="日常报表维护计划"){
- if(report_type=='1'){
- idxURL = $.pathname()+ "/page/business/am/resource/team/teamer-inside.jsp";
- }
- if(report_type=='3'){
- idxURL = $.pathname()+ "/page/business/am/resource/team/team-poll.jsp";
- }
- if(report_type=='4'){
- idxURL = $.pathname()+ "/page/business/am/resource/team/team-poll-out.jsp";
- }
- if(report_type=='6'){
- idxURL = $.pathname()+ "/page/business/am/resource/ledger/command-car.jsp";
- }
- if(report_type=='8'){
- idxURL = $.pathname()+ "/page/business/am/resource/ledger/generator-car.jsp";
- }
- if(report_type=='10'){
- idxURL = $.pathname()+ "/page/business/am/resource/ledger/generator.jsp";
- }
- if(report_type=='5'){
- idxURL = $.pathname()+ "/page/business/am/resource/expert/expert-maintenance.jsp";
- }
- }
- windowOpenNext(idxURL);
-
- return false;
- }
- /*待办结束*/
- /*集成Url开始*/
- function getUrlData(idx,iframeUrl,contheight,contwidth){
- var $dom = $("#cont"+idx).find(".idxModule_content").last();
- if("广东电网有限责任公司"==corp_names){
- createTabUrl($dom);
- }
- //alert("getUrlData");
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/queryURLData/',
- type : 'post',
- data : {
- user_id:user_id,
- dept_id:comp_id
- },
- dataType : 'json',
- success : function(data) {
- //console.log(JSON.stringify(data));
- if(data.state == "ok"&&data.length != 0){
- createIDXUrl($dom,data.resultData);
- }else{
- if("广东电网有限责任公司"!=corp_names){
- $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
- }
- }
- //隐藏加载图像
- hideLoading("index_left_3");
- //重置高度
- resetpageheight();
- },
- error : function(e) {
- try{
- //隐藏加载图像
- hideLoading("index_left_3");
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
-
- }
- });
- }
- function createTabUrl($dom){
- $(".l3_url_tab").remove();
- $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>');
- $(".l3_url_tab_span").bind("click",function(){
- var $self = $(this);
- //alert($self.text());
- //var workurl = "";
- if($self.text()=="地调EMS"){
- var diag = new top.Dialog();
- diag.Title = "地调EMS";
- diag.Width= 400;
- diag.Height=180;
- diag.Drag=true;
- diag.URL = "/nwyj/page/index_module/difang_url.html";
- diag.show();
- diag.CancelEvent = function(){
- diag.close();
- diag=null;
- };
- }else{
- //workurl = "/nwyj/page/index_module/zhongdiao_url.html";
- window.open("http://10.150.62.9:50000/svg/");
- //return;
- }
-
- });
- }
- function createIDXUrl($dom,data){
- var $content = $('<ul></ul>');
- $dom.append($content);
- for (var i = 0; i < data.length; i++) {
- var menu = data[i];
- var $div = $('<li class="url_li1"></li>');
- //var span = $('<span class="idx_ic_circle url_list1 index_main_cursor">'+menu.url_name+'</span>');
- var span = $('<a class="idx_ic_circle url_list1 index_main_cursor">'+menu.url_name+'</a>');
- span.data("menu_url",menu.url_url);
- span.data("url_name",menu.url_name);
- span.bind("click",function(){
- //alert(1111);
- //$(top.document.body).find("#frmright").attr("src",$(this).data("menu_url"));
- //openIDXUrl($(this).data("menu_url"));
- if($(this).data("url_name")=="广东电网应急指挥图"){
- // 获取用户部门
- var dept_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- // 获取用户Id
- var user_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var user_name1 = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
- //父部门id
- var parentId1 = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var role_id1 = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- var dept_name1 = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- 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);
- window.open(menuUri1,"_blank","");
- }else{
- window.open($(this).data("menu_url"));
- }
- });
- $content.append($div);
- $div.append(span);
- menu = null;
- $div = null;
- span = null;
- }
-
- $content = null;
- }
- /**
- * 打开时,url集成过滤
- * @param url
- */
- function openIDXUrl(url) {
- //alert(2222);
- //http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?TOKEN=
- var vUrl="http://10.150.22.1/web/lcam/fwms/sso/certificate.ac?sapHrUserId="+saphruserid;
- jQuery.ajax({
- url:vUrl,
- dataType:'JSONP',
- success: function(result) {
- //alert(result);
- var indexUrl="http://10.150.22.1/web/lcam/fwms/sso/ssoLogin.ac?ssoticket="+result+"&path="+encodeURIComponent(url);
- //alert(3333);
- window.open(indexUrl);
- }
- });
- }
- /*集成Url结束*/
- /*预警与响应开始*/
- function getAlertResponseData(idx,iframeUrl,contheight,contwidth){
- var alertTitleJson = [{display:"政府预警与响应"},{display:"当前预警与响应"}];
- $dommm = $("#contindex_left_2").find(".idxModule_content").last();
- createAlertcontent($dommm,alertTitleJson);
- $.ajax({
- url : $.pathname() + '/ws/EventService/EventService/getGovInfo/',
- type : 'post',
- async:false,
- data : {
- deptId :comp_id
- },
- dataType : 'json',
- success : function(data) {
- var $dom1 = $("#contindex_left_2 .alert_cont").eq(0).find("ul").eq(0);
- //console.log(JSON.stringify(data));
- //console.log(data);
- if(data.length&&data.length != 0){
- //if(JSON.stringify(data) == "[]"||JSON.stringify(data) == "{}"){
- createAlertResponse1($dom1,data);
- }else{
- $dom1.append('<div class="empty_style"><span >暂无数据</span></div>');
- }
- //隐藏加载图像
- hideLoading("index_left_2");
- //重置高度
- resetpageheight();
- },
- error : function(e) {
- try{
- //隐藏加载图像
- hideLoading("index_left_2");
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- }
- });
- $.ajax({
- url : $.pathname() + '/ws/EventService/EventService/getInfoByUnit/',
- type : 'post',
- async:false,
- data : {
- deptId :comp_id
- },
- dataType : 'json',
- success : function(data) {
- var $dom2 = $("#contindex_left_2 .alert_cont").eq(1).find("ul").eq(0);
- //console.log(JSON.stringify(data));
- //console.log(data);
- if(data.length&&data.length != 0){
- //if(JSON.stringify(data) == "[]"||JSON.stringify(data) == "{}"){
- createAlertResponse2($dom2,data);
- }else{
- $dom2.append('<div class="empty_style"><span >暂无数据</span></div>');
- }
- //隐藏加载图像
- hideLoading("index_left_2");
- //重置高度
- resetpageheight();
- },
- error : function(e) {
- try{
- //隐藏加载图像
- hideLoading("index_left_2");
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- }
- });
- }
- //加载容器
- function createAlertcontent($content,data){
- //var $content = $('<div class="idxModule_content"></div>');
- //$dom.append($content);
- for(var j=0;j<data.length;j++){
- $content.append($('<div class="alert_title">'+data[j].display+'</div>'));
- var $contentDiv = $('<div class="alert_cont"><ul id = "alert_cont_'+j+'"></ul></div>');
- $content.append($contentDiv);
- }
- }
- //加载政府预警与响应
- function createAlertResponse1($dom,data){
- //$dom.empty();
- var value = data;
- var is_flag1 = false;
- for (var i = 0; i < value.length; i++) {
- if(i==3){
- $("#alert_cont_0").parent().height(175);
- is_flag1 = true;
- }
- var menu = value[i];
- var $div = $('<li><div class="alert_cont_div"></div></li>');
-
- var $span1 = $('<span class="idx_ic_circle alert_text index_main_cursor" title="'+menu.NOTICETYPE+menu.LEVEL+'">'+menu.NOTICETYPE+menu.LEVEL+'</span><br/>');
- $span1.data("fd_id",menu.FD_OBJECTID);
- $span1.data("type",menu.TYPE);
- $span1.bind("click",function(){
- var fd_id1 = $(this).data("fd_id");
- var type = $(this).data("type");
- var url = "";
- if(type == "warning"){
- url = $.pathname()+"/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveInfo.jsp?fd_id="+fd_id1;
- //url = $.pathname()+"/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveInfo.jsp";
- }else{
- url = $.pathname()+"/page/business/em/monitor/reponseReceive/GovResponseReceiveInfo.jsp?fd_id="+fd_id1;
- //url = $.pathname()+"/page/business/em/monitor/reponseReceive/GovResponseReceiveInfo.jsp";
- }
- //$(top.parent.document.body).find("#frmright").attr('src',url);
- //selfOpenNext(url);
- windowOpenNext(url);
- });
- $dom.append($div);
- var $div1 = $('<div class="con_d"></div>');
- $div.find(".alert_cont_div").append($span1).append($div1);
- var $span2 = $('<span class="index_main_cursor1">'+menu.RELEASE_UNIT+'</span>');
- $div1.append($span2);
- var cutDate = menu.RELEASE_DATE;
- if(menu.RELEASE_DATE&&cutDate!=""){
- cutDate = cutDate.split(" ")[0];
- }
- var $span3 = $('<span class="index_main_cursor2">'+cutDate+'</span>');
- $div1.append($span3);
- cutDate = null;
- }
- //设置动画
- if(is_flag1){
- listScroll($("#alert_cont_0"));
- is_flag1 = null;
- }
- }
- //加载当前预警与响应
- function createAlertResponse2($dom,data){
- //$dom.empty();
- var value = data;
- var is_flag1 = false;
- for (var i = 0; i < value.length; i++) {
- if(i==3){
- $("#alert_cont_1").parent().height(175);
- is_flag1 = true;
- }
- var menu = value[i];
- var $div = $('<li><div class="alert_cont_div"></div></li>');
-
- var $span1 = $('<span class="idx_ic_circle alert_text index_main_cursor" title="'+menu.EARLY_WARNING_NAME+'">'+menu.EARLY_WARNING_NAME+'</span><br/>');
- $span1.data("fd_id",menu.FD_OBJECTID);
- $span1.data("is_alert",menu.IS_ALERT);
- $span1.bind("click",function(){
- var fd_id1 = $(this).data("fd_id");
- var is_alert = $(this).data("is_alert");
- var url = "";
- if(is_alert == "0"){
- url = $.pathname()+"/page/business/em/alert/warning/WarningView.jsp?fd_id="+fd_id1;
- //url = $.pathname()+"/page/business/em/alert/warning/WarningView.jsp";
- }else{
- url = $.pathname()+"/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id="+fd_id1;
- //url = $.pathname()+"/page/business/em/response/emergencyResponse/WarningView.jsp";
- }
- //$(top.parent.document.body).find("#frmright").attr('src',url);
- //selfOpenNext(url);
- windowOpenNext(url);
- });
- $dom.append($div);
- var $div1 = $('<div class="con_d"></div>');
- $div.find(".alert_cont_div").append($span1).append($div1);
- var $span2 = $('<span class="index_main_cursor1">'+menu.RELEASE_UNIT_SHOW+'</span>');
- $div1.append($span2);
- var cutDate = menu.RELEASE_RELIEVE_DATE;
- if(menu.RELEASE_RELIEVE_DATE&&cutDate!=""){
- cutDate = cutDate.split(" ")[0];
- }
- var $span3 = $('<span class="index_main_cursor2">'+cutDate+'</span>');
- $div1.append($span3);
- cutDate = null;
- }
- //设置动画
- if(is_flag1){
- listScroll($("#alert_cont_1"));
- is_flag1 = null;
- }
- }
- /*设置预警与响应滚动效果*/
- function listScroll($this1){
- $this1.hover(function() {
- clearInterval(scrollTimer1);
- }, function() {
- scrollTimer1 = setInterval(function() {
- scrollNews($this1);
- }, 3000);
- });
- var scrollTimer1 = setInterval(function() {
- scrollNews($this1);
- }, 3000);
- }
- function scrollNews(obj1) {
- var $self = obj1;
- var height = $self.find("li").height();
- $self.animate({
- "marginTop" : -height + "px"
- }, 600, function() {
- $self.css("marginTop", 0).find("li:first").appendTo($self);
- });
- }
- /*政府预警与响应结束*/
- /*资源分布图开始*/
- function getResourceData(idx,iframeUrl,contheight,contwidth){
- //引用iframe内容
- setContentByUrl(idx,"/nwyj/page/cockpit/EmergencyresourceMainShow/EmergencyresourceMainShow.html","auto","900px");
- }
- /*资源分布图结束*/
- /*南网模块开始*/
- function getNwyjModuleData(idx,iframeUrl,contheight,contwidth){
- //引用iframe内容
- //openIDXUrl("",2);
- //setContentByUrl($("#index_right_7"),"http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?tSession=1111","400px");
- //$("#ifm_index_right_7").document.body.css({"overflowX":"scroll"});
- //$self.css({"overflowY":"scroll"});
- openNWYJModule(idx,iframeUrl,"400px","900px");
- }
- /**
- * 打开时,url集成过滤
- * @param url
- */
- function openNWYJModule(idx,moduleUrl,height,width) {
- //alert("====>进入方法");
- //var $dom = $("#"+idx);
- //http://10.150.22.1/web/lcam/fwms/equipment/desktop/index?TOKEN=
- //alert(moduleUrl);
- var vUrl="http://10.150.22.1/web/lcam/fwms/sso/certificate.ac?sapHrUserId="+saphruserid;
- jQuery.ajax({
- url:vUrl,
- dataType:'JSONP',
- success: function(result) {
- //alert("====>通过验证得到结果:"+result);
- var indexUrl="http://10.150.22.1/web/lcam/fwms/sso/ssoLogin.ac?ssoticket="+result
- +"&path="+encodeURIComponent(moduleUrl+result);
- //var indexUrl = moduleUrl+result;
- //alert(indexUrl);
- setContentByUrl(idx,indexUrl,height,width);
- //alert("====>执行通过");
- },
- error : function(e) {
-
- }
- });
- }
- /*南网模块结束*/
- /*故障系统模块*/
- /**
- * 故障系统模块
- */
- function getGZXTModuleData (idx,moduleUrl,contheight,contwidth) {
- var userticket = top.com.sinosoft.lz.system.user.LoginInfo.getUserTicket();
- if(userticket&&userticket!=null&&userticket!=undefined&&userticket!="undefined"){
- var indexUrl = moduleUrl+userticket;
- //alert(indexUrl);
- setContentByUrl(idx,indexUrl,"420px","900px");
- //setContentByUrl(idx,"/nwyj/page/GZXT404.jsp","200px","auto");
- }else{
- setContentByUrl(idx,"/nwyj/page/GZXT404.jsp","200px","auto");
- //delectModule(idx);
- }
- }
- /*故障系统模块*/
- /*线路跳闸曲线*/
- function getLineTripSumStrend(idx,iframeUrl,contheight,contwidth){
- //var $dom = $("#index_right_5");
- var url = "/nwyj/page/cockpit/echart_maticView/line_trip/line_trip_sum_strend.html?"
- +"dept_id="+dept_id
- +"?user_id="+user_id
- +"?dept_name="+deptnames
- +"?parentId="+parent_ids
- +"?style=style1"
- +"?legendColor=green"//图例字体颜色
- +"?xAxisColor=black"//X轴字体颜色
- +"?xAxisColor=black"//Y轴字体颜色
- +"?titleColor=black";//标题颜色
- //引用iframe内容
- setContentByUrl(idx,url,"380px","380px");
-
- //$dom.find(".idxModule_content").css("height","380px")/*.css("background-color", "#9C9A9B")*/;
- //$dom = null;
- url = null;
-
- }
- /*线路跳闸曲线*/
- /*线路跳闸曲线*/
- function getImportentUserOutageStrend(idx,iframeUrl,contheight,contwidth){
- //var $dom = $("#index_left_5");
- var url = "/nwyj/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_strend.html?"
- +"dept_id="+dept_id
- +"?user_id="+user_id
- +"?dept_name="+deptnames
- +"?parentId="+parent_ids
- +"?style=style1"
- +"?legendColor=green"//图例字体颜色
- +"?xAxisColor=black"//X轴字体颜色
- +"?xAxisColor=black"//Y轴字体颜色
- +"?titleColor=black";//标题颜色;
- //引用iframe内容
- setContentByUrl(idx,url,"380px","280px");
- //$dom.find(".idxModule_content").css("background-color", "#848484");
- //$dom.find(".idxModule_content").css("height","280px");
- //$dom = null;
- url = null;
-
- }
- /*线路跳闸曲线*/
- /*曲线iframe*/
- function getStrendIframeData (idx,iframeUrl,contheight,contwidth){
- //var $dom = $("#"+idx).last();
- var url = "/nwyj/"+iframeUrl
- +"?dept_id="+dept_id
- +"?user_id="+user_id
- +"?dept_name="+deptnames
- +"?parentId="+parent_ids
- +"?style=style1"
- +"?legendColor=green"//图例字体颜色
- +"?xAxisColor=black"//X轴字体颜色
- +"?xAxisColor=black"//Y轴字体颜色
- +"?titleColor=black";//标题颜色;
- +"?iframeModuleID="+idx;//idx;
- //引用iframe内容
- setContentByUrl(idx,url,"380px","380px");
- //setContentByUrl($dom,"/nwyj/test.html");\
- //$dom.find(".idxModule_content").css("height","380px");
- url = null;
- //$dom = null;
- }
- /*曲线iframe*/
- /*附件下载*/
- function getAccessoryData(idx,iframeUrl,contheight,contwidth){
- //alert(111);
- var $dom = $("#cont"+idx).find(".idxModule_content").last();
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/queryAccessoryData/',
- type : 'post',
- data : {
- //compIds : comp_id
- },
- dataType : 'json',
- success : function(data) {
- if(data.state == "ok"&&data.length != 0){
- createAccessory($dom,data.resultData);
- }else{
- $dom.append('<div class="empty_style"><span >暂无数据</span></div>');
- }
- //隐藏加载图像
- hideLoading(idx);
- //重置高度
- resetpageheight();
- },
- error : function(error) {
- try {
- //隐藏加载图像
- hideLoading(idx);
- top.Dialog.alert('访问服务失败!');
- } catch (e) {
- }
- }
- });
- }
- function createAccessory($dom,data){
- //alert(JSON.stringify(data));
- var $cont = $('<div class="l6_cont"></div>');
- $dom.append($cont);
- var $listcont = $('<div class="l6_list_cont "></div>');
- var $morebtn = $('<div class="l6_more_btn ">更多</div>');
- $cont.append($listcont).append($morebtn);
- for(var i=0;i<data.length;i++){
- var l6name = data[i].name+"."+data[i].fileext;
- var l6date = getAcceDate(data[i].uploadtime);
- var $list = $('<div class="l6_list"><span class="l6_span1" >'+l6name+'</a></span><span class="l6_span2 ">'+l6date+'</span></div>')
- $listcont.append($list);
- $list.data("fd_id",data[i].fd_id);
- $list.data("filename",data[i].name);
- $list.data("downloadname",data[i].savename);
- $list.data("fileext",data[i].fileext);
- }
- $morebtn.bind("click",function(){
- windowOpenNext("/nwyj/page/system/accessory/accessoryList.jsp");
- //windowOpenNext("/nwyj/page/system/accessory/test.jsp");
- });
- $(".l6_span1").bind("click",function(){
- var $parent = $(this).parent();
- var fd_id = $parent.data("fd_id");
- var filename = $parent.data("filename");
- var downloadname = $parent.data("downloadname");
- var fileext = $parent.data("fileext");
- downloadFile(fd_id,filename,downloadname,fileext);
- });
- }
- function downloadFile(fd_id,filename,downloadname,fileext){
- var url = $.pathname() + '/page/common/getFileExc.jsp?objectID=' + fd_id+
- "&downfilename=" + encodeURI(encodeURI(filename)+ "." +fileext) +
- "&filename=" + encodeURI(encodeURI(downloadname)+ "." +fileext);
- //window.open(url,"_self");
- window.open(url);
- }
- function getAcceDate(dateStr){
- if(dateStr&&dateStr!=null&dateStr!=""){
- var yueri = dateStr.split(" ")[0];
- var currentDate = allGetServerTime();
- var today = changeDateToString(currentDate.DateAdd("d", 0));
- var yestoday = changeDateToString(currentDate.DateAdd("d", -1));
- var qiantian = changeDateToString(currentDate.DateAdd("d", -2));
- if(yueri==today){
- return "今天";
- }else if(yueri==yestoday){
- return "昨天";
- }else if(yueri==qiantian){
- return "前天";
- }else{
- return yueri;
- }
- }else{
- return "";
- }
- }
- /*附件下载*/
- /**
- * 本页面打开地址
- */
- function selfOpenNext(workUrl){
- $(top.parent.document.body).find("#main_index_tab").hide();
- $(top.parent.document.body).find("#frmright").attr('src',workUrl);
- }
- /**
- * 打开新页面
- */
- function windowOpenNext(workUrl){
- $.indexOpenNextWindow(workUrl);
- //window.open("/nwyj/page/frameWork.html?name="+userData+"&idxWorkUrl="+workUrl+"&idxWorkData="+workData,"MSG");
- //if(getOs()=="MSIE"){
- /*var userInfoStr = top.com.sinosoft.lz.system.user.LoginInfo.getUserInfo();
- var opener=window.open("/nwyj/page/frameWork.html");
- opener.fatherParam={"name":userInfoStr,"idxWorkUrl":workUrl};*/
- /*}else{
- var opener=window.open("../page/frameWork.html","_blank","",false);
- opener.fatherParam={"name":userData,"idxWorkUrl":workUrl,"idxWorkData":workData};
- }*/
- }
- //判断浏览器的类型
- function getOs(){
- if(navigator.userAgent.indexOf("MSIE")>0) {
- return "MSIE";
- } ;
- if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
- return "Firefox";
- } ;
- if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
- return "Safari";
- } ;
- if(isCamino=navigator.userAgent.indexOf("Camino")>0){
- return "Camino";
- };
- if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
- return "Gecko";
- } ;
- };
|