var operid=mystorage.get("operid");var vLibcode=mystorage.get("libcode");var _operRows;var _showMsgListRows;var color=["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"];var arrList=["cbbmsl","cbsxsl","cbdgcs","cbyscs","cbdccs","cbhsjkcs","cbqkdgcs","cbjdcs","cbzdcs","cbbzgs","cbltcs"];var boxArr=[{table:"lib_holdings",classname:"hold_count"},{table:"lib_holdings",classname:"year_hold_count",datefld:"senddate"},{table:"lib_cir_reader",classname:"rdr_count"},{table:"lib_cir_reader",classname:"year_rdr_count",datefld:"createdate"},{table:"opac_visit",classname:"visit_count"},{table:"opac_visit",classname:"year_visit_count",datefld:"vdate"},{table:"opac_retrieve_booklog",classname:"bookclick_count",limit:[{condition:"type",typeHandler:"0",value:"1"}]},{table:"opac_retrieve_rdrlog",classname:"rdrlogin_count",limit:[{condition:"type",typeHandler:"0",value:"0"}]},{table:"lib_sys_oplog",classname:"year_bmsl_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"3001"}],chart:{name:"编目数量",color:"#ffa800",renderTo:"chart-bmsl",type:"column",text:"数量"}},{table:"lib_sys_oplog",classname:"year_sxsl_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"3002"}],chart:{name:"审校数量",color:"#ffa800",renderTo:"chart-sxsl",type:"column",text:"数量"}},{table:"lib_sys_oplog",classname:"year_dgcs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"2007"}],chart:{name:"订购册数",color:"#ffa800",renderTo:"chart-dgcs",type:"column",text:"册"}},{table:"LIB_ACQ_CHECK",classname:"year_yscs_count",groupby:"checkdate",datefld:"checkdate",operid:operid,fld:" sum(copies) ",limit:[],chart:{name:"验收册数",color:"#ffa800",renderTo:"chart-yscs",type:"column",text:"册"}},{table:"lib_sys_oplog",classname:"year_dccs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"5001"}],chart:{name:"典藏册数",color:"#ffa800",renderTo:"chart-dccs",type:"column",text:"册"}},{table:"lib_sys_oplog",classname:"year_hsjkcs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"5001"}],chart:{name:"回溯建库册数",color:"#ffa800",renderTo:"chart-hsjkcs",type:"column",text:"册"}},{table:"lib_sys_oplog",classname:"year_qkdgcs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"6010"}],chart:{name:"期刊订购册数",color:"#ffa800",renderTo:"chart-qkdgcs",type:"column",text:"册"}},{table:"LIB_PER_DETAIL_CHECK",classname:"year_jdcs_count",datefld:"actualdate",operid:operid,groupby:"actualdate",fld:" sum(COPIES) ",limit:[],chart:{name:"期刊记到册数",color:"#ffa800",renderTo:"chart-jdcs",type:"column",text:"册"}},{table:"lib_sys_oplog",classname:"year_zdcs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"6004"}],chart:{name:"期刊验收册数",color:"#ffa800",renderTo:"chart-zdcs",type:"column",text:"册"}},{table:"lib_sys_oplog",classname:"year_bzgs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"4010"}],chart:{name:"办证个数",color:"#ffa800",renderTo:"chart-bzgs",type:"column",text:"个"}},{table:"lib_cir_log",classname:"year_ltcs_count",datefld:"logdate",operid:operid,limit:[{condition:"logtype",typeHandler:"3",value:"101,102,201"}],chart:{name:"流通册数",color:"#ffa800",renderTo:"chart-ltcs",type:"column",text:"册"}},];var startIndex=8;$(function(){getPageCog();getCountInfo(0);getChartData(startIndex);initOperidList()});function showMenuByOper(){var d=[];var b=[{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 a=0;a0){d=base_path+"lib/config/update.do";a.id=getValue("id")}$.post(d,a,function(f){if(f.status=="0"){alert(f.message);savePageCogResult(f);$("#myModal").modal("hide")}else{alert(f.message)}},"json")}function getPageCog(){var a={type:"homeCog"};var b=base_path+"lib/config/page.do";$.post(b,a,function(c){if(c.status=="0"){savePageCogResult(c)}else{alert(c.message)}},"json")}function savePageCogResult(c){if(c.status=="0"){var d=c.rows[0];if(d){setValue("id",d.id);var a=JSON.parse(d.paramjson);var b=$(".cog-checkbox");b.each(function(f,e){if(a[e.id]){setValue(e.id,a[e.id])}});$("#"+a.countopertype).prop("checked",true);getCountInfo(0);resetBoxShow(a)}}}function resetBoxShow(a){if(a){var b=true;for(var c=0;c=boxArr.length){return}var a=base_path+"lib/statistics/homeExecute.do";var c=boxArr[b].classname;var d=getParamCondtion(boxArr,b);if(boxArr[b].fld){d.fld=boxArr[b].fld}$.post(a,d,function(e){if(e.status=="0"){dataToPageBind(e,c,b);b++;getCountInfo(b)}else{alert(e.message)}},"json")}function getChartData(b){if(b>=boxArr.length){return}var a=base_path+"lib/statistics/homeExecute.do";var d=getParamCondtion(boxArr,b);if(boxArr[b].groupby){d.group=" substr("+boxArr[b].groupby+",0,6) "}else{d.group=" substr(logdate,0,6) "}if(boxArr[b].fld){d.fld=boxArr[b].fld}var c=boxArr[b].chart;$.post(a,d,function(e){if(e.status=="0"){bindChart(e,c,b);b++;getChartData(b)}else{alert(e.message)}},"json")}function bindChart(t,n,f){if(f-1){var a=[arrList[l]];$("."+a+" .box-solid.box-success>.box-header").css({color:"#fff",background:n.color,"background-color":n.color});$("."+a+" .box-solid.box-success").css({border:"1px solid "+n.color+""})}var r=new Date();var m=r.getFullYear();var s=r.getMonth()+1;var d=r.getDate();if(s>=1&&s<=9){s="0"+s}var k=t.rows;var c=[];var t=[];for(var q=1;q<=s;q++){c.push(m+"年"+q+"月");var h=q;if(q>=1&&q<=9){h="0"+q}var b=m+""+h;var g=false;for(var p=0;p0){var b=f[d].limit;for(var e=0;e-1){var a=[arrList[c]];$("."+a+" .small-box").addClass("bg-0"+(c))}$("."+e).html(formatNumber(f.count))}}function expandBoxInfo(b){var c=b.element["0"].id;if(c){var c=c.replace("receive","");for(var a=0;a<_showMsgListRows.length;a++){if(c==_showMsgListRows[a].id&&_showMsgListRows[a].status!="2"){onUpdateMsg(c,"status","2");return}}}}function removeBoxInfo(a){}function myMsgSet(){$("#myMsgSet").modal("show")}function initOperidList(){$(".operid-list").html("");var b='操作员名称';var a=base_path+"par/common/getInitData.do";var c={code:"operid",key:"operid",condition:"libcode",value:vLibcode};$.post(a,c,function(f){if(f.rows.length>0){var e=f.rows;_operRows=e;for(var d=0;d'+e[d].name+""}}}$(".operid-list").html(b);$('input[type="checkbox"]').change(function(g){if(this.className=="alloperid"){$(".operid-checkbox").prop("checked",this.checked)}else{$(".alloperid").prop("checked",$(".operid-checkbox:checked").length==$(".operid-checkbox").length)}});initMyMsgBoxList();initShowMsgBoxList()},"json")}function initMyMsgBoxList(){var a=base_path+"msg/message/list.do";var b={};b["limit[0].condition"]="operid";b["limit[0].typeHandler"]="0";b["limit[0].value"]=operid;b.orderBy="id desc";$.post(a,b,function(d){if(d.status=="0"){$(".send-msg").html("");var c=d.rows;if(c.length>0){buildSendMsg(c)}}else{alert(d.message)}},"json")}function buildSendMsg(f){var e="";var d="0";var c=1;for(var b=0;b0){c=1;e+="";e+="";e+="";e+=""}e+='
';e+='
';e+='
';e+=''+f[b].title+"";e+='日期:'+fmtStringToDate(f[b].msgdate)+"~"+fmtStringToDate(f[b].enddate)+"";e+="
";e+='
';e+='";e+='";e+="
";e+="
";e+='
';e+=''+f[b].content+"";e+="

"+f[b].note+"

";e+="
";e+='";e+="
";$(".send-msg").html(e);$(".my-box").boxWidget()}function getOperStatus(a){var b="";if(a=="0"){b='未读'}if(a=="1"){b='已读'}if(a=="2"){b='已详读'}return b}function onTrashMsg(d,a){var b=base_path+"msg/message/deleteList.do";var c={};c["limit[0].condition"]="operid";c["limit[0].typeHandler"]="0";c["limit[0].value"]=d;c["limit[0].condition"]="msgstamp";c["limit[0].typeHandler"]="0";c["limit[0].value"]=a;$.post(b,c,function(e){if(e.status=="0"){initMyMsgBoxList()}else{alert(e.message)}},"json")}function initShowMsgBoxList(){var a=base_path+"msg/message/list.do";var b={};b["limit[0].condition"]="receiveoper";b["limit[0].typeHandler"]="0";b["limit[0].value"]=operid;b["limit[1].condition"]="homestatus";b["limit[1].typeHandler"]="0";b["limit[1].value"]="0";b.orderBy="id desc";$.post(a,b,function(d){if(d.status=="0"){$(".receive-msg").html("");var c=d.rows;_showMsgListRows=c;if(c.length>0){buildReceiveMsg(c)}}else{alert(d.message)}},"json")}function onUpdateMsg(e,a,c){var b=base_path+"msg/message/update.do";var d={};d.id=e;d[a]=c;$.post(b,d,function(f){if(f.status=="0"){initShowMsgBoxList()}else{alert(f.message)}},"json")}function buildReceiveMsg(c){var b="";for(var a=0;a';b+='
';b+='
';b+=''+c[a].title+"";b+='发布人:'+getOperName(c[a].operid)+"    日期:"+fmtStringToDate(c[a].msgdate)+"~"+fmtStringToDate(c[a].enddate)+"";b+="
";b+='
';b+='";b+='";b+="
";b+="
";b+='
';b+=''+c[a].content+"";b+="

"+c[a].note+"

";b+="
";b+=""}$(".receive-msg").html(b);$(".my-box").boxWidget()}function getOperName(b){for(var a=0;a<_operRows.length;a++){if(b==_operRows[a].code){return _operRows[a].name}}return b}function fmtStringToDate(a){if(!a){return a}a=a.toString();if(a!=undefined&&a.length==8){return a.substr(0,4)+"-"+a.substr(4,2)+"-"+a.substr(6,2)}return a}function saveMsgInfo(){var b={};var a=[];var e=$(".operid-checkbox");e.each(function(g,f){if(getValue(f.id)=="1"){a.push(f.id)}});if(a.length==0){alert("请选择接收操作员");return}b.operids=a.join(",");var d=$(".msg-text-input");d.each(function(h,g){var f=getValue(g.id);if(f.length>0){b[g.id]=f}});if(!b.title){alert("标题不能为空");return}if(!b.enddate){alert("截止日期不能为空");return}b.operid=operid;b.enddate=b.enddate.replace(new RegExp("-","g"),"");var c=base_path+"msg/message/insertList.do";if(getValue("msgid")>0){c=base_path+"msg/message/update.do";b.id=getValue("msgid")}b.type=1;$.post(c,b,function(f){if(f.status=="0"){alert(f.message);initMyMsgBoxList();$("#myMsgSet").modal("hide")}else{alert(f.message)}},"json")}function formatNumber(c){var b="";c=c.toString();if(c.indexOf(".")!=-1){b="."+c.split(".")[1];c=parseInt(c.split(".")[0])}var d=c.toString().split("");var a=-3;while(d.length+a>0){d.splice(a,0,",");a-=4}return d.join("")+b}function getCurDateYMD(){var a=new Date();var d=a.getFullYear();var e=a.getMonth()+1;var c=a.getDate();if(e>=1&&e<=9){e="0"+e}if(c>=0&&c<=9){c="0"+c}var b=d+""+e+""+c;return b};