123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911 |
- // 监听浏览器窗口大小的改变,样式进行相应的调整
- var wid = window.screen.width-50;
- $(window).resize(function() {
- var wwww = $(window).width();
- if(wwww <= wid){
- $("html").css({"min-width":wid+"px","height":"100%","overflow":"auto","overflow-x":""});
- }else{
- $("html").css({"width":"100%","height":"100%","overflow":"scroll","overflow-x":"hidden"});
- }
- wwww = null;
- });
- //获取后台服务器时间
- var serverTime;
- //用于记录定时器次数,从而执行方法获取待办数量
- var numFlag = 0;
- //用于记录定时器次数,从而执行方法获取待办数量
- var numFlag1 = 0;
- var _interval;//定时器对象
- function showSubMenu(){
- var time = null;
- var box = $("#navbox");
- var lista = $(".yj_menu_hover");
- /*
- for(var i=0,j=lista.length;i<j;i++){
- if(lista.eq(i).hasClass("nowCurrent")){
- olda = i;
- }
- }*/
-
- var box_show = function(hei){
- box.stop().animate({
- height:hei,
- opacity:1
- },50);
- };
-
- var box_hide = function(){
- box.stop().animate({
- height:0,
- opacity:0
- },50);
- };
-
- lista.hover(function(){
- lista.removeClass("nowCurrent");
- $(this).addClass("nowCurrent");
- clearTimeout(time);
- var index = $(this).attr("data_index");
- box.find(".hover_cont").hide();
- $("#submenu"+index).show();
- var _height = $("#submenu"+index).height()+54;
- box_show(_height);
- },function(){
- time = setTimeout(function(){
- box.find(".hover_cont").hide();
- box_hide();
- },0);
- lista.removeClass("nowCurrent");
- //lista.eq(olda).addClass("nowCurrent");
- });
-
- box.find(".hover_cont").hover(function(){
- var _index = $(this).attr("data_index");
- lista.removeClass("nowCurrent");
- $("#yj_menu_hover_"+_index).addClass("nowCurrent");
- clearTimeout(time);
- $(this).show();
- var _height = $(this).height()+54;
- box_show(_height);
- },function(){
- time = setTimeout(function(){
- $(this).hide();
- box_hide();
- },0);
- lista.removeClass("nowCurrent");
- //lista.eq(olda).addClass("nowCurrent");
- });
-
-
-
-
- /*
- // 鼠标悬停显示下拉菜单
- $($menu).parent().on("mouseenter",function(){
- $(".hover_cont").hide();
- $(this).find(".yj_menu_hover").css("background-color","#0f4a8b");
- $(this).find(".hover_cont").show();
- });
- $($menu).parent().on("mouseleave",function(){
- $(this).find(".yj_menu_hover").css("background-color","");
- $(this).find(".hover_cont").hide();
-
- });*/
- // 点击三级菜单,变色以显示访问记录
- $(".hover_cont .nav_li_r a").on("click",function(){
- $(".nowCurrent1").removeClass("nowCurrent1");
- var _index = $(this).parent().parent().parent().parent().attr("data_index");
- $("#yj_menu_hover_"+_index).addClass("nowCurrent1");
-
- $(".hover_cont .nav_li_r a").css("color","#0066CC");
- $(this).css("color","#9700ad");
- });
- $(".hover_cont .nav_li_r a").on("mouseover",function(){
- $(this).css({"background-color":"#ddd"});
- });
- $(".hover_cont .nav_li_r a").on("mouseout",function(){
- $(this).css("background-color","");
- });
- $menu = null;
- }
- /********************************************平台日期时间 start**************************************************/
- function showTime(timestr){
- if($("#time").text()==""){
- $("#time").html("<font size=2pt color=ffffff>"+timestr+"</font>");
- }else{
- $("#time font").text(timestr);
- }
- }
- /**
- * 字符串转时间(yyyy-MM-dd HH:mm:ss)
- * result (分钟)
- */
- String.prototype.stringToDate = function(){
- return new Date(Date.parse(this.replace(/-/g, "/")));
- };
- /**
- * 获取服务器时间
- * @returns {String}
- */
- function getServerTime(){
- var nowTime = "";
- $.ajax({//后台获取系统当前时间
- url :'/nwyj/ws/response/responseService/getNowTime',
- type : 'post',
- dataType : 'text',
- async : false,
- timeout : 6000,
- success : function(result){
- nowTime=result;
- },error : function(e){
- return;
- }
- });
- return nowTime;
- }
- /**
- * 通过日期时间字符串获取下一秒时间
- * 返回字符串
- * @param timeStr
- */
- function getNowTimeForTimeStr(timeStr){
- timeStr = timeStr.stringToDate();
- var newDate = Date.parse(timeStr)+1000;
- var result = getFormatDateByLong(newDate,"yyyy年MM月dd日 hh:mm:ss");
- serverTime = getFormatDateByLong(newDate,"yyyy-MM-dd hh:mm:ss");
- return result;
- }
- //扩展Date的format方法
- Date.prototype.format = function (format) {
- var o = {
- "M+": this.getMonth() + 1,
- "d+": this.getDate(),
- "h+": this.getHours(),
- "m+": this.getMinutes(),
- "s+": this.getSeconds(),
- "q+": Math.floor((this.getMonth() + 3) / 3),
- "S": this.getMilliseconds()
- };
- if (/(y+)/.test(format)) {
- format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- }
- for (var k in o) {
- if (new RegExp("(" + k + ")").test(format)) {
- format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
- }
- }
- return format;
- };
-
- /**
- *转换long值为日期字符串
- * @param l long值
- * @param pattern 格式字符串,例如:yyyy-MM-dd hh:mm:ss
- * @return 符合要求的日期字符串
- */
- function getFormatDateByLong(l, pattern) {
- return getFormatDate(new Date(l), pattern);
- }
- /**
- *转换日期对象为日期字符串
- * @param l long值
- * @param pattern 格式字符串,例如:yyyy-MM-dd hh:mm:ss
- * @return 符合要求的日期字符串
- */
- function getFormatDate(date, pattern) {
- if (date == undefined) {
- date = new Date();
- }
- if (pattern == undefined) {
- pattern = "yyyy-MM-dd hh:mm:ss";
- }
- return date.format(pattern);
- }
- //浏览器关闭时清除定时器
- window.unload = function(){
- clearInterval(_interval);
- };
- /********************************************平台日期时间 end**************************************************/
- function getDBNum(){
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var company_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- var url = $.pathname() + '/ws/xianlutingyun/XianlutingyunService/getDBNum';
- $.ajax({
- type: "POST",
- url: url,
- //async: false,
- data: {
- user_id:user_id,
- role_id:role_id,
- company_id:company_id
- },
- dataType:"text",
- success: function(data){
- if(!data || data=='0' || data.trim()==''){
- $("#daibanshu").text("");
- $("#daibanshu").parent().addClass("nodaiban");
- }else{
- $("#daibanshu").text(parseInt(data));
- $("#daibanshu").parent().removeClass("nodaiban");
- }
- },
- error : function(){
- //alert("待办数获取错误");
- }
- });
- user_id = null;
- company_id = null;
- role_id = null;
- }
- // 初始化加载
- var menu = null;
- function menuInit(roleids) {
- //定时执行,间隔一秒钟
- _interval = setInterval(function(){
- serverTime = getServerTime();
-
- if(numFlag1==60){//每一小时执行一次
- //获取服务器时间
- serverTime = getServerTime();
- numFlag1 = 0;
- }
- //通过时间字符串获取下一秒钟的时间,返回字符串
- var timeStr = getNowTimeForTimeStr(serverTime);
- showTime(timeStr);
- if(numFlag==60){//每分钟执行一次
- getDBNum();
- numFlag = 0;
- numFlag1++;
- }else{
- numFlag++;
- }
- }, 1000);
-
- $("#close_sys_msg").click(function(){
- $(this).parent().parent().hide();
- });
-
- // 搜索框获取焦点事件
- $("#search_in").live("focus",function(){
- // 获取焦点时,将搜索框清空
- var val = $(this).val("");
- });
- // 点击搜索按钮
- $("#search_img").live("click",search);
- $("#search_in").keydown(function(event){
- if(event.which == "13")
- search();
- });
-
-
- function search(){
- var loginName = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
- var name = $("#search_in").val();
- if(name==''){
- // window.location.href = "/nwyj/page/system/right/SysSearch.jsp";
- window.open("/nwyj/page/system/right/SysSearch.jsp");
- // $('#frmright', window.parent.document).attr('src',"/nwyj/page/system/right/SysSearch.jsp?");
- }else{
- //window.location.href = "/nwyj/page/system/right/SearchList.jsp?name="+name;
- window.open("/nwyj/page/system/right/SearchList.jsp?name="+name+"&&loginName="+loginName);
- // $('#frmright', window.parent.document).attr('src',"/nwyj/page/system/right/SearchList.jsp?name="+name);
- }
- /* if($("#search_in").val()==""){//打开搜索页面
- $(top.document.body).find("#frmright").attr("src","/nwyj/page/system/right/SysSearch.jsp");
- }else{//获取值,并跳转收缩结果页面
-
- }*/
- //alert($("#search_in").val());
- }
-
- // 获取用户功能菜单
- var url = $.pathname() + '/ws/sys/SysCustomMenuService/getShowMenuInfoByRoleIds';
- var params = {
- roleids : roleids
- };
- $.ajax({
- type: "POST",
- url: url,
- // async: false,
- data: params,
- success: function(data){
- // 一级菜单
- menu = data;
- var menu1 = '';
- if(menu){
-
- // 遍历生成一级菜单
- for(var i=0;i<menu.length;i++){
- // 调用方法生成二级菜单节点
- var menu2 = createSubMenu2(i,menu);
- // alert(menu2);
- // 获取一级菜单名称
- var menu1Name = menu[i].name;
- // 获取图片路径
- var menu1Img = menu[i].sortno;
- var _shownumber = '';
- if(menu1Name == "待办"){
- _shownumber = '<a href="javascript:;"><div class="daiban" id="daiban"><span class="daibanshu" id="daibanshu">0</span></div></a>';
-
- }
- /*var menu1aClass = "";
- if(i==0){
- menu1aClass = "nowCurrent1";
- }*/
- // 将二级菜单添加到一级菜单中
- menu1 = menu1 + '<li>'+_shownumber+'<a href="javascript:;" class="yj_menu_hover " id="yj_menu_hover_'+i+'" data_index="'+i+'" onclick="javascript:openone('+i+');" ><img src="'+menu1Img+'"><span>'+menu1Name+'</span></a></li>';
- menu1Name = null;
- menu1Img = null;
- _shownumber = null;
- $("#navbox").append(menu2);
- menu2 = null;
- }
- var list = $("#list");
- list.append(menu1);
- menu1 = null;
- list = null;
- $(".yj_menu_hover").eq(0).addClass("nowCurrent1");
- }
- // 鼠标点击导航栏一级菜单时,显示对应的子菜单
- showSubMenu();
- // 显示时间
- getDBNum();
- },
- error : function(){
- alert("error");
- }
-
- });
-
- };
- // 生成子二级菜单节点
- function createSubMenu2(i,menu){
- // 如果没有二级菜单,则返回
- if(menu[i].submenu==undefined||menu[i].submenu==""){return '';}
- // 否则循环遍历生成二级菜单
- var menu22 = '';
- for(var j=0;j<menu[i].submenu.length;j++){
- // 调用方法生产三级菜单节点
- var menu3 = createSubMenu3(i,j,menu);
- if(menu3!=""){
- // 将三级菜单节点加入二级菜单节点中
- menu22 = menu22 + '<div class="nav_li"><div class="nav_li_l"><span class="fas">'+menu[i].submenu[j].name+'</span><span class="verticalLine">|</span></div>'+menu3+'</div>';
- menu3 = null;
- }
- }
- var menu2 = '<div class="hover_cont submenu'+i+'" id="submenu'+i+'" data_index="'+i+'" style="display:none;"><div class="nav_cont">'+menu22+'</div></div>';
- menu22 = null;
- return menu2;
- }
- // 生产子三级菜单节点
- function createSubMenu3(i,j,menu){
- // 如果没有三级菜单,则返回
- if(menu[i].submenu[j].submenu.length==0){return '';}
- // 否则循环遍历生成三级菜单
- var menu33 = '';
- for(var k=0;k<menu[i].submenu[j].submenu.length;k++){
- menu33 = menu33 + '<a href="javascript:;" onclick="openuri('+i+','+j+','+k+')" >'+menu[i].submenu[j].submenu[k].name+'</a>';
- }
- var menu3= '<div class="nav_li_r">'+menu33+'</div>';
- menu33 = null;
- return menu3;
- }
- function openone(i){
- var menuUri = menu[i].remark;
- var menuID=menu[i].id;
- if(menuUri==""||menuUri==null)
- {
- return
- }
- //驾驶舱
- else if(menuID==6) {//驾驶舱
- var browser=navigator.appName;
- var b_version=navigator.appVersion;
- //navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.match(new RegExp("Trident\/[7]\.0"))==null
- if(browser=="Microsoft Internet Explorer" && b_version.match(new RegExp("Trident\/[5-9]\.0"))==null)
- {
- top.Dialog.confirm("为了更方便的使用本系统,建议您使用IE9版本的浏览器,请问是否下载IE9版本浏览器",function(){
- window.open("/nwyj/upload/IE9-Windows7-x86-chs.rar");
- return ;
- },function(){
- return ;
- });
- return ;
- }
- // 获取用户部门
- var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- // 获取用户Id
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var user_name = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
-
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //4Atoken值
- var ticket = top.com.sinosoft.lz.system.user.LoginInfo.getUserTicket();
-
- var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
-
- var saphruserid = top.com.sinosoft.lz.system.user.LoginInfo.getSaphruserid();
-
- menuUri = menuUri+"?dept_id="+dept_id+"&&user_id="+user_id+"&&real_name="+realName+"&&user_name="+encodeURI(user_name)+"&&dept_name="+encodeURI(dept_name)+"&&parentId="+parentId+"&&role_id="+encodeURI(role_id)+"&&saphruserid="+encodeURI(saphruserid)+"&&token="+ticket;
- window.open(menuUri,"_blank","");
- }else {
- if(menuID==2){
- setMainIndex();
- }else{
- $("#main_index_tab").hide();
- }
- $("#main_index_fixed").hide();
- var imgurl = menu[i].sortno;
- //document.getElementById("frmright").setAttribute("src", menuUri);
- $.indexOpenSelfWindow(menuUri);
- $("#currPosition").hide();
- $(".nowCurrent1").removeClass("nowCurrent1");
- $("#yj_menu_hover_"+i).addClass("nowCurrent1");
- //$("#yj_menu_hover_"+menuID).addClaas("nowCurrent1");
- $(".hover_cont .nav_li_r a").css("color","#0066CC");
- }
- };
- function openuri(i,j,k){
- var menuUri = menu[i].submenu[j].submenu[k].remark;
- var menuId = menu[i].submenu[j].submenu[k].id;
- var menuName3 = menu[i].submenu[j].submenu[k].name;
- var imgurl = menu[i].submenu[j].submenu[k].sortno;
- var imgclass = imgurl.substring(imgurl.lastIndexOf("/")+1,imgurl.indexOf(".png"));
- if(menuUri==""||menuUri==null||menuUri==undefined){
- return;
- }else{
- var iframe = $("#frmright").get(0).contentWindow;
- if("MSIE"==getOs()){
- iframe.src = 'about:Tabs';
- }else{
- iframe.src = 'about:blank';
- }
- if(iframe.CollectGarbage){
- iframe.CollectGarbage();
- }
- iframe.document.write('');
- //iframe.document.clear();
- iframe=null;
-
- //记录用户点击次数
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- $.indexUserClickNum (user_id,menuId);
- user_id = null;
- //记录用户点击次数
-
- $("#positionMsg").html("<div id='positionTitle1' class='"+imgclass+"'>"+menuName3+"</div>");
- $("#positionMsg #positionTitle1").data("menuid",menuId).data("imgclass",imgclass);
- $("#currPosition .changeYQ").remove();
- var curSrc = getTabMsg();
- menuUri = curSrc!="" && curSrc!=undefined?curSrc:menuUri;
- $.indexOpenSelfWindow(menuUri);
- //$("#frmright").attr("src",menuUri);
- // 隐藏二三极菜单框
- hideMenu();
- $("#currPosition").show();
- $("#main_index_tab").hide();
- $("#main_index_fixed").hide();
- }
- }
- function hideMenu(){
- $(".nav_li_r").click(function(){
- $(this).parent().parent().parent().hide();
- });
-
- }
- /**
- * 获取当前位置页签数据
- */
- function getTabMsg(){
- var curSrc = "";
- var $tab = $("#positionMsg .positionTab");
- if($tab.length == 0){
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var menuId = $("#positionTitle1").data("menuid");
- $.ajax({
- type: "POST",
- url: "/nwyj/ws/tabyq/PositionTabService/getTabById",
- async: false,
- data: {
- menuId:menuId,
- userId:user_id
- },
- dataType:"json",
- success: function(data){
- if(data.length>0){
- curSrc = tabPosition(data,menuId,"");
- }
-
- }
- });
- }
- return curSrc;
- }
- //创建当前位置页签
- function tabPosition(tabjson,menuId,imgclass){
- var curId = "";
- var __top = $(top.document.body);
- var positionText = __top.find("#positionTitle1").text();
- imgclass = imgclass==""?__top.find("#positionTitle1").data("imgclass"):imgclass;
- __top.find("#positionMsg").html("");
-
- //添加菜单和图标
- __top.find("#positionMsg").append("<div id='positionTitle1' class='positiontitab "+imgclass+"'>"+positionText+"</div>");
- __top.find("#positionMsg #positionTitle1").data("menuid",menuId).data("imgclass",imgclass);
-
- __top.find("#currPosition .changeYQ").remove();
- __top.find("#currPosition").append("<div class='changeYQ' id='changeYQ'><div class='setTabBtn' id='setTabBtn'>设置</div></div>");
- $("#changeYQ #setTabBtn").bind("click",setTabBtn);
- $("#changeYQ").append(
- "<div class='tablistcon' id='tablistcon'>" +
- "<div class='tablistcon_div'><ul class='tablistcon_ul'>" +
- "</ul></div>" +
- "<div class='tab_setbtn'>设为默认</div>" +
- "</div>");
- for(var i=0;i<tabjson.length;i++){
- if(tabjson[i].IS_PARENT==1){//子页签
- var PARENT_ID = tabjson[i].PARENT_ID;
- var dom = $("<div class=' positiontitab positionTab positionTabChild' id='"+tabjson[i].YQ_ID+"' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+0+"' data-src='"+tabjson[i].YQ_SRC+"'>"+tabjson[i].YQ_NAME+"</div>");
- $("#chlid_con_"+PARENT_ID).append(dom);
- }else if(tabjson[i].IS_PARENT==0){//父页签
- if(tabjson[i].current){
- curId = tabjson[i].YQ_SRC;
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab positionTabCurrent positionTabParent hasChild' id='"+tabjson[i].YQ_ID+"' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+0+"' data-src='"+tabjson[i].YQ_SRC+"'><div>"+tabjson[i].YQ_NAME+"</div><div class='chlid_con' id='chlid_con_"+tabjson[i].YQ_ID+"'></div></div>");
- //添加设置页签的下拉列表
- $("#changeYQ ul").append(
- "<li class='tablistcon_ul_li'><div class='tabselect tab_selected' data-yqid='"+tabjson[i].FD_OBJECTID+"'>"+tabjson[i].YQ_NAME+"</div>" +
- "</li>");
- }else{
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab positionTabParent' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+i+"' id='"+tabjson[i].YQ_ID+"' data-src='"+tabjson[i].YQ_SRC+"'>"+tabjson[i].YQ_NAME+"</div>");
- //添加设置页签的下拉列表
- $("#changeYQ ul").append(
- "<li class='tablistcon_ul_li'><div class='tabselect tab_noselect' data-yqid='"+tabjson[i].FD_OBJECTID+"'>"+tabjson[i].YQ_NAME+"</div>" +
- "</li>");
- }
-
- }else{
- if(tabjson[i].current){
- curId = tabjson[i].YQ_SRC;
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab positionTabCurrent' id='"+tabjson[i].YQ_ID+"' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+0+"' data-src='"+tabjson[i].YQ_SRC+"'>"+tabjson[i].YQ_NAME+"</div>");
- //添加设置页签的下拉列表
- $("#changeYQ ul").append(
- "<li class='tablistcon_ul_li'><div class='tabselect tab_selected' data-yqid='"+tabjson[i].FD_OBJECTID+"'>"+tabjson[i].YQ_NAME+"</div>" +
- "</li>");
- }else{
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+i+"' id='"+tabjson[i].YQ_ID+"' data-src='"+tabjson[i].YQ_SRC+"'>"+tabjson[i].YQ_NAME+"</div>");
- //添加设置页签的下拉列表
- $("#changeYQ ul").append(
- "<li class='tablistcon_ul_li'><div class='tabselect tab_noselect' data-yqid='"+tabjson[i].FD_OBJECTID+"'>"+tabjson[i].YQ_NAME+"</div>" +
- "</li>");
- }
- }
-
- }
- __top.find("#positionMsg").append("<div class='clear'></div>");
- $("#changeYQ .tabselect").bind("click",selectTab);
- $("#changeYQ .tab_setbtn").bind("click",setDefaultTab);
-
- if(menuId=="30400"){
- //应急预案列表页面注掉切换页头上那个红色圈圈。
- /*getShareNum();
- getXiubianNum();*/
- }
-
- return curId;
- };
- function setDefaultTab(){
- var tabId = $("#changeYQ .tab_selected").attr("data-yqid");
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var menuId = $("#positionTitle1").data("menuid");
- $.ajax({
- type: "POST",
- url: "/nwyj/ws/tabyq/PositionTabService/addOrUpdateTab",
- async: false,
- data: {
- menuId:menuId,
- userId:user_id,
- tabId:tabId
- },
- dataType:"text",
- success: function(data){
- $("#tablistcon").hide();
- }
- });
-
- }
- /***
- * 控制设置页签默认列表显隐
- */
- function setTabBtn(e){
- $("#tablistcon").toggle();
- stopPropagation(e);
- }
- function stopPropagation(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- else
- e.cancelBubble = true;
- }
- /****
- * 设置页签默认列表样式切换
- */
- function selectTab(){
- $(".tab_selected").removeClass("tab_selected").addClass("tab_noselect");
- $(this).addClass("tab_selected").removeClass("tab_noselect");
- }
- //判断浏览器的类型
- 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";
- } ;
- };
- //后台返回共享中的预案个数
- function getShareNum(){
- var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //取系统时间:年月日时分秒
- var date = allGetServerTime();
- var seperator1 = "";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var time = date.getFullYear() + seperator1 +"-" + month + "-"+seperator1 + strDate;
-
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getShareNum/';
- var params = {
- id : parent_id,
- time:time
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var num = data.rows[0].NUM;
- appendOneDiv(num);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- //后台返回待修编的预案个数
- function getXiubianNum(){
- var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
-
- //取系统时间:年月日时分秒
- var date = allGetServerTime();
- var seperator1 = "";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var time = date.getFullYear() + seperator1 +"-" + month + "-"+seperator1 + strDate;
-
-
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getXiubianNum/';
- var params = {
- id : parent_id,
- time:time
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var num = data.rows[0].NUM;
- appendTwoDiv(num);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function appendOneDiv(data){
-
- var $dom = $(top.document.body).find(".positionTab").eq(2);
- $dom.css("position","relative");
- var $div = $("<div id= 'daixiubian' style='position: absolute; right: -18px; top: 0px; background-color: #f00; border-radius: 25px; width: 20px; height: 20px; text-align: center; line-height: 20px; color: #fff;' > "+data+"</div>");
- $dom.append($div);
-
- }
- function appendTwoDiv(data){
- var $dom1 = $(top.document.body).find(".positionTab").eq(1);
- $dom1.css("position","relative");
- var $div1 = $("<div class='aaaa' id= 'gongxiang' style='position: absolute; right: -18px; top: 0px; background-color: #f00; border-radius: 25px; width: 20px; height: 20px; text-align: center; line-height: 20px; color: #fff;' >"+data+"</div>");
- $dom1.append($div1);
- $div1.render();
- }
- /**
- * 加载首页顶部滚动数据
- */
- function setMainIndex(){
- var Corpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();//系统登录人的单位id
- $.ajax({
- url : $.pathname() + "/ws/getNotice/GetNoticeService/getNotice",
- data : { corpId : Corpids},
- type : 'post',
- dataType : 'json',
- success : function(data) {
- // alert(JSON.stringify(data))
- setMainIndexTab(data);
- //setMainIndexTab([]);
- },
- error : function(e) {
- return;
- //$.messager.alert('访问服务失败!', 'error');
- }
- });
- }
- /**
- *设置首页顶部滚动条中的数据
- */
- function setMainIndexTab(myData){
- if(myData.length==0){
- return;
- }
- var alertdata = "";
- var responsedata = "";
- var responseval = "";
- var alertval = "";
- var alertcol = "";
- var responsecol = "";
-
- for(var i=0;i<myData.length;i++){
- if(myData[i].isAlert==1){
- var rcdn = myData[i].responsecol;
- responsecol = rcdn == "29"?"-28px -64px":rcdn == "30"?"-64px -62px":rcdn == "31"?"-102px -63px":rcdn == "32"?"-139px -63px":"";
- responsedata = "最新响应信息:"+ myData[i].corpName+" - "+myData[i].writeTime+" - "+myData[i].warningName;
- responseval = myData[i].isAlert+"|"+myData[i].fd_objectid;
- }
- if(myData[i].isAlert==0){
- var acdn = myData[i].alertcol;
- alertcol = (acdn == "35"?"-32px -20px":(acdn == "36"?"-65px -20px":(acdn == "37"?"-101px -22px":(acdn == "38"?"-139px -20px":""))));
- alertdata = "最新预警信息:"+ myData[i].corpName+" - "+myData[i].writeTime+" - "+myData[i].warningName;
- alertval = myData[i].isAlert+"|"+myData[i].fd_objectid;
- }
- }
- $("#main_index_tab_cont").html("");
- var marhtml = "<marquee id='marqueeid' scrollamount='3' scrolldelay='50' >";
- if(alertdata!=""){
- marhtml += "<span value="+alertval+" class='aresphref' ><u style='background-position:"+alertcol+";'></u><b>"+alertdata+"</b></span>";
- }
- marhtml += " ";
- if(responsedata!=""){
- marhtml += "<span value="+responseval+" class='aresphref' ><u style='background-position:"+responsecol+";'></u><b>"+responsedata+"</b></span>";
- }
- marhtml += "</marquee>";
- $("#main_index_tab_cont").append(marhtml);
- //$("#main_index_tab").append("<div><marquee id='marqueeid' >"+responsedata+" "+alertdata+"</marquee></div>");
- //$("#main_index_tab").append('<div><marquee direction="left" scrollamount="20" scrolldelay="50" >'+responsedata+' '+alertdata+'</marquee></div>');
- //$("#main_index_tab").append("<div id='marqueeid'>"+responsedata+" "+alertdata+"</div>");
- alertdata = null;
- responsedata = null;
- responseval = null;
- alertval = null;
- $("#main_index_tab").show();
-
- $("#marqueeid").bind("mouseover",function(){
- this.stop();
- });
- $("#marqueeid").bind("mouseout",function(){
- this.start();
- });
- $(".aresphref").bind("click",function(){
- var value = $(this).attr("value");
- var valueArr = value.split("|");
- var dddurl = "";
- if(valueArr[0]==1){
- dddurl = "/nwyj/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id="+valueArr[1];
- //$("#frmright").attr("src","/nwyj/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id="+valueArr[1]);
-
- }else{
- dddurl = "/nwyj/page/business/em/alert/warning/WarningView.jsp?fd_id="+valueArr[1];
- //$("#frmright").attr("src","/nwyj/page/business/em/alert/warning/WarningView.jsp?fd_id="+valueArr[1]);
- }
- // $.noIndexOpenNextWindow(dddurl);
- window.open("/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id="+valueArr[1]+"&dept_id="+top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids());
- //alert(top.com.sinosoft.lz.system.user.LoginInfo.getUserInfo());
- //跳转页面
- /*var dddname = top.com.sinosoft.lz.system.user.LoginInfo.getUserInfo();
- //alert(dddname);
- var dddopener=window.open("/nwyj/page/frameWork.html");
- dddopener.fatherParam={"name":dddname,"idxWorkUrl":dddurl};*/
- $(this).remove();
- if($("#marqueeid").html()==" "){
- $("#marqueeid").remove();
- $("#main_index_tab").hide();
- }
- value = null;
- valueArr = null;
- dddurl = null;
- dddopener = null;
- });
- /*移除按钮的监听方法 */
- $("#main_index_closeimg").bind("mouseenter",function(){
- $(this).show().removeClass("cont_close1").addClass("cont_close2");
- });
- $("#main_index_closeimg").bind("mouseleave",function(){
- $(this).show().removeClass("cont_close2").addClass("cont_close1");
- });
- $("#main_index_closeimg").bind("click",function(){
- $(this).parent().hide();
- });
- $("#main_index_tab").bind("mouseover",function(){
- $("#main_index_closeimg").show();
- });
- $("#main_index_tab").bind("mouseout",function(){
- $("#main_index_closeimg").hide();
- });
- /*移除按钮的监听方法 */
- }
-
-
-
|