var firstMenu=null;var isFullScreen=false;var itemArrLength=0;var bookMarkJson;$(function(){firstMenu=$("#firstMenu");getReaderFld();focusItem(modifyPwd);initLicenseInfo();$("#menu-tabs").tabs({onContextMenu:function(a,b){if(b!="首页"){a.preventDefault();$("#tabsMenu").menu("show",{left:a.pageX,top:a.pageY}).data("tabTitle",b)}},onSelect:function(c,a){var d=$("#menu-tabs").tabs("getTab",a);var b=d.panel("options").id;bookMarkFun(b)}});$("#tabsMenu").menu({onClick:function(a){closeTab(this,a.name)}});$(".navbar-nav-menu li").each(function(a){$(this).click(function(){$(".navbar-nav-menu li.cur-menu").removeClass("cur-menu");$(this).addClass("cur-menu");addAccordions(a);vCurMenuIndex=a})});vCurMenuIndex=parseInt(vCurMenuIndex);getBookMarkData(vCurMenuIndex);serachMenu()});function initLicenseInfo(){var a=base_path+"lib/common/getLibName.do";var b={};$.post(a,b,function(c){if(c.status=="0"){getLibName(c.rows[0])}else{openMessageDlg(c.message)}},"json")}function serachMenu(){var o=[];var m=[{code:"acq",dirFolder:"acquisition",name:"采访-菜单导航"},{code:"cat",dirFolder:"catalogue",name:"编目-菜单导航"},{code:"hld",dirFolder:"collection",name:"典藏-菜单导航"},{code:"cir",dirFolder:"circulation",name:"流通-菜单导航"},{code:"per",dirFolder:"periodical",name:"期刊-菜单导航"},{code:"par",dirFolder:"parameter",name:"系统参数-菜单导航"},{code:"sys",dirFolder:"application",name:"应用服务-菜单导航"}];for(var g=0;g0){if(j.indexOf("/")>0){var p=$("#searchmenu").combobox("getText");var k=j.split("|");addTab(p,k[0],k[1],k[2])}}}})}function addBookMark(){var b=$("#menu-tabs").tabs("getSelected");if(b){var c=b.panel("options").title;var j=b.panel("options").id;if(!bookMarkJson){bookMarkJson={bookmark:[]}}var k=bookMarkJson.bookmark;var l=false;for(var d=0;d20){return openMessageDlg("您最多可以收藏20个菜单哦!")}var e=b.panel("options").iconCls.replace("e-icon fa fa-","");var g=b.panel("body");var a=g.find("iframe").attr("src");if(!l){var h={id:j,title:c,url:a,iconCls:e};bookMarkJson.bookmark.push(h)}var f={};f.type="bookmark";f.paramjson=JSON.stringify(bookMarkJson);var a=base_path+"lib/pageconfig/save.do";$.post(a,f,function(i){if(i.status=="0"){if(l){openMessageDlg("操作成功,此菜单已经从我的菜单中移除。");bookMarkFun()}else{openMessageDlg("操作成功,此菜单已经放入我的菜单,方便工作人员查找自己常用的菜单!");bookMarkFun(j)}moveMarkMenu()}else{openMessageDlg(i.message)}},"json")}}function moveMarkMenu(){if(vCurMenuIndex==7){getBookMarkData()}}function getBookMarkData(){var b={};b.pk="bookmark";var a=base_path+"lib/pageconfig/get.do";$.post(a,b,function(c){if(c.status=="0"){if(c.rows[0]){bookMarkJson=JSON.parse(c.rows[0].paramjson)}}addAccordions(vCurMenuIndex)},"json")}function getSysDataByBookMark(){var g=[];var a=[];var f=bookMarkJson.bookmark;for(var d=0;d0){k=d[0].title;for(var e=0;e";b+='  ';b+=h[c].name;b+="";b+=""}b+="";firstMenu.accordion("add",{title:d[e].title,iconCls:d[e].iconcls,content:b})}firstMenu.accordion("select",k)}$(".accordions-ul li").each(function(i){$(this).click(function(){$(".accordions-ul li.tabin").removeClass("tabin");$(this).addClass("tabin")})})}function getLiknUrl(c,b){var a=b;if(a.indexOf("bookmarkfalg/")>-1){a=a.replace(new RegExp("bookmarkfalg/","g"),"")}else{if(a.indexOf("exportlist.jsp")>-1||a.indexOf("exportlabellist.jsp")>-1||a.indexOf("exp_")>-1){a="export/"+a}else{if(a.indexOf("acq_ordermenu.jsp")>-1||a.indexOf("acq_orderimport.jsp")>-1||a.indexOf("acq_recommend.jsp")>-1||a.indexOf("acq_orderhandler.jsp")>-1||a.indexOf("acq_ordermenuxlsimport.jsp")>-1||a.indexOf("acq_orderxlsimport.jsp")>-1){a="acquisition/"+a}else{if(a.indexOf("statistics.jsp")>-1||a.indexOf("sta_")>-1){a="statistics/"+a}else{if(a.indexOf("systemlog.jsp")>-1||a.indexOf("systemlogcount.jsp")>-1){a="public/"+a}else{if(a.indexOf("com_bibliography.jsp")>-1||a.indexOf("bibliography.jsp")>-1||a.indexOf("com_cataholdings.jsp")>-1||a.indexOf("exportlabellist.jsp")>-1||a.indexOf("bib_import_data.jsp")>-1||a.indexOf("bib_export_data.jsp")>-1||a.indexOf("bib_data_batchrecord.jsp")>-1||a.indexOf("bib_data_z3950batchrecord.jsp")>-1||a.indexOf("bib_data_integritycheck.jsp")>-1||a.indexOf("bib_data_checkhandle.jsp")>-1||a.indexOf("title_number.jsp")>-1||a.indexOf("rebulidbib.jsp")>-1||a.indexOf("bib_xls_import_data.jsp")>-1){a="catalogue/"+a}else{if(c=="circulation"&&(a.indexOf("holdings.jsp")>-1||a.indexOf("hld_import_data.jsp")>-1)){a="collection/"+a}else{if(c=="periodical"&&(a.indexOf("hld_import_data.jsp")>-1)){a="collection/"+a}else{a=c+"/"+a}}}}}}}}return a}function getMenu(a){var b=mystorage.get("menu");if(!b||!b[a]){return[]}return b[a]}function controlSidebar(){$(".control-sidebar").toggle(300);setValue("oldpassword","");setValue("newpassword","");setValue("okpassword","")}function loingOut(){var a=base_path+"par/operator/logout.do";var b={};$.post(a,b,function(d){if(d.status=="0"){localStorage.removeItem("loginAccount");localStorage.removeItem("loginPassword");var c=base_path+"page/login.jsp";window.location=c}else{openMessageDlg(d.message)}},"json")}function modifyPwd(){var b=getValue("oldpassword");if(b.length==0){return openMessageDlg("旧密码不能为空")}var c=getValue("newpassword");var e=getValue("okpassword");if(c.length==0||e.length==0){return openMessageDlg("新密码或者确认密码不能为空")}if(e!=c){return openMessageDlg("新密码或者确认密码不一致")}var a=base_path+"par/operator/updatepwd.do";var d={};d.password=c;d.oldpassword=b;$.post(a,d,function(f){if(f.status=="0"){openConfirmDlg("是否要重新登录!",null,modifyPwdOk,modifyCancle)}else{openMessageDlg(f.message)}},"json")}function modifyPwdOk(){controlSidebar();loingOut()}function modifyCancle(){controlSidebar()}function clearFirstMenu(){var b=firstMenu.accordion("panels");for(var a=0;a