Edit D:\rfid\libsystem\page\catalogue\js\global_bibliography.js
var bibController=function(){};var initJson;var selectEditBibId=0;var selectCenterBibId=0;var tabGrid_title="(???)";var noEditBibGridByCode=false;$(function(){bibController.prototype.init();bibController.prototype.bind()});bibController.prototype.bind=function(){};bibController.prototype.init=function(){initJson=[{code:"page_sysid",key:"sysid",condition:"type",value:"0",linkage:[{code:"page_template",key:"template",condition:"sysid"}]},{code:"page_ctrlno",key:"ctrlno",condition:"libcode",value:vLibcode},{code:"page_z3950",key:"z3950",condition:"libcode",value:vLibcode},{code:"page_editmodel",key:"editmodel"},{code:"page_finsources",key:"finsources"},{code:"page_mediatype",key:"mediatype"},{code:"page_binding",key:"binding"},{code:"page_docsources",key:"docsources"},{code:"page_ncy,orderbib_ncy",key:"ncy"},{code:"page_bookseller",key:"bookseller",condition:"libcode",value:vLibcode},{code:"page_location",key:"location",condition:"libcode",value:vLibcode},{code:"page_doctype",key:"doctype",condition:"libcode",value:vLibcode},{code:"page_libcode",key:"libcode",condition:"code",value:vLibcode},{code:"operid",key:"operid"}];_myPage.prototype.getLoadData(initJson)};_myPage.prototype.getLoadSuccess=function(a,b){if(vType=="0"||vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){mystorage.set("cat_init_data",a)}else{if(vType=="1"){mystorage.set("per_init_data",a)}}_fmtGridDataRows=a};bibController.prototype.search=function(b,a){if(!_setConfig.prototype.check()){return}if(isUpdateData){$.messager.confirm("??????","?????????????????,??????????????????",function(c){if(c){bibController.prototype.searchOk(b,a);isUpdateData=false}})}else{bibController.prototype.searchOk(b,a)}};bibController.prototype.clear=function(a){if(a){clearGridData("editBibGrid,centerDataGridDetail,acqDataGridList,centerDataGridList,orderDataGridList,checkDataGridList,holdDataGridList")}else{clearGridData("editBibGrid,acqDataGridList,centerDataGridList,orderDataGridList,checkDataGridList,holdDataGridList")}};bibController.prototype.searchOk=function(b,a){bibController.prototype.clear(1);selectEditBibId=0;selectCenterBibId=0;$(".showBibGrid-tip").html("");var c=bibGlobalController.prototype.getSearchCondtion(b,a);if($("#keyword").length>0){$("#keyword").textbox("textbox").focus().select()}if(($("#keyword").length>0&&getValue("keyword").length==0)&&!a){if($("#bibindextitle").length>0&&!$(".add-condtion").is(":hidden")){if(getValue("keyword").length==0&&getValue("titlekey").length==0||getValue("authorkey").length==0){return openMessageDlg("???????????????????????????")}}else{return openMessageDlg("????????????")}}bibController.prototype.searchPost(c,b,a)};bibController.prototype.searchPost=function(f,d,a){var c=0;var e=$("#acqDataGridList").datagrid("getSelected");if(e){c=$("#acqDataGridList").datagrid("getRowIndex",e)}if(a){c=0}var b=base_path+"lib/biblios/page.do";$("#acqDataGridList").datagrid({url:b,queryParams:f,onLoadSuccess:function(g){if(g.status=="0"){$("#tabsGrid").tabs("select",0);bibGlobalController.prototype.onLoadGridSuccess("acqDataGridList",g,c);bibCenterController.prototype.search(g)}else{if(g.status=="9006"){openMessageDlg(g.message)}}},method:"post"})};bibController.prototype.add=function(){if(isUpdateData){$.messager.confirm("??????","?????????????????,??????????????????",function(a){if(a){bibController.prototype.addOk();isUpdateData=false}})}else{bibController.prototype.addOk()}};bibController.prototype.addOk=function(){_linkbuttonObj.prototype.status(false);selectEditBibId=0;if(!_setConfig.prototype.check()){return}var b=cataConfigData.template;if(b){var a=base_path+"par/template/getTemplate.do?pk="+b;var c={};$.post(a,c,function(f){if(f.status=="0"){if(f.total>0){var d=JSON.parse(f.rows[0].paramjson);var e=d.rows;bibGlobalController.prototype.setDataToEditBibGrid("editBibGrid",e);bibController.prototype.addAttrCtrlNO()}}else{openMessageDlg(f.message)}},"json")}};bibController.prototype.addAttrCtrlNO=function(){var b=cataConfigData.editmodel;if(b=="marc"){$(".showEditbib-tip").html("");var d=cataConfigData.ctrlno;if(d){var a=base_path+"par/ctrlno/get.do?pk="+d;var c={};$.post(a,c,function(e){if(e.status=="0"){if(e.total>0){$("#editBibGrid").datagrid("insertRow",{index:1,row:{field:"001",indicator:"",data:e.rows[0].currentctrlno}})}}else{openMessageDlg(e.message)}},"json")}}};bibController.prototype.initEditGridView=function(){if(!$("#editBibGrid").attr("class")){initEidtBiBModel(cataConfigData.editmodel)}};bibController.prototype.save=function(g){if(!_setConfig.prototype.check()){return}accept();var h={};var c=base_path+"lib/biblios/saveMarcRecord.do";var e=$("#editBibGrid").datagrid("getRows");if(e.length>0){if(!g){if(cataConfigData.choose&&cataConfigData.choose=="1"){pinyinController.prototype.pyfun(e);return}}var f=0;for(var d=0;d<e.length;d++){var b=e[d].data;b=pinyinController.prototype.tagdata(b,g,e,f,d);h["marcRowList["+d+"].field"]=e[d].field;h["marcRowList["+d+"].indicator"]=e[d].indicator;h["marcRowList["+d+"].data"]=b}var a="add";if(selectEditBibId>0){h.id=selectEditBibId;a="update"}h.sysid=cataConfigData.sysid;if(cataConfigData.choose){h.choose=cataConfigData.choose}$.post(c,h,function(i){if(i.status=="0"){openMessageDlg(i.message);isUpdateData=false;selectEditBibId=i.rows[0].id;bibController.prototype.saveAfterSerach(a)}else{openMessageDlg(i.message)}},"json")}};bibController.prototype.saveAfterSerach=function(a){if(a=="delete"){bibController.prototype.setDataByGirdSelect(0)}else{if((a=="add"||a=="update")&&selectEditBibId>0){bibController.prototype.search("ID",selectEditBibId)}else{bibController.prototype.search()}}};bibController.prototype.trash=function(){if(!_setConfig.prototype.check()){return}var b=$("#acqDataGridList").datagrid("getSelected");if(!b){return openMessageDlg("????????????????,??????")}var a=$("#acqDataGridList").datagrid("getRowIndex",b);$.messager.confirm("??????","???????????????["+selectEditBibId+"]???????????",function(d){if(d){var c=base_path+"lib/biblios/delete.do";var e={};e.id=selectEditBibId;$.post(c,e,function(f){if(f.status=="0"){$("#acqDataGridList").datagrid("deleteRow",a);bibController.prototype.saveAfterSerach("delete");openMessageDlg(f.message)}else{openMessageDlg(f.message)}},"json")}})};bibController.prototype.accept=function(){if(!_setConfig.prototype.check()){return}if(selectEditBibId>0){var d=$("#acqDataGridList").datagrid("getSelected");var b=$("#acqDataGridList").datagrid("getRowIndex",d);if(!d.classno){return openMessageDlg("??????????????????????????,???????????????????????!")}var a=base_path+"lib/biblios/update.do";var c={};c.id=selectEditBibId;c.status="1";$.post(a,c,function(e){if(e.status=="0"){$(".showEditbib-tip").html("");$("#acqDataGridList").datagrid("deleteRow",b);bibController.prototype.clear();$(".showBibGrid-tip").html("??????????"+selectEditBibId+"??");bibGlobalController.prototype.loadEidtGridByPost(selectEditBibId,"centerDataGridDetail");selectEditBibId=0;openMessageDlg(e.message)}else{openMessageDlg(e.message)}},"json")}};bibController.prototype.paste=function(){if(!_setConfig.prototype.check()){return}$("#pasteMarcDlg").dialog("open")};bibController.prototype.pasteResult=function(){var f=getValue("nclmarc");if(!f){return openMessageDlg("???????????????")}selectEditBibId=0;f=JSON.stringify(f);var h=f.split("\\n");var b=[{field:"HEA",indicator:"",data:"nam a2200000 a 4500"}];var a=/^[0-9 ]+.?[0-9 ]*$/;for(var c=0;c<h.length;c++){var d=h[c];if(d.length==0){continue}var j=d.split("\\t");if(j.length>=2){var g=j[0];if(g&&g.length>2){if(a.test(g)){var e={};e.field=g.substr(0,3);e.indicator=g.substr(3,2);if(j[1]){e.data=j[1].replace(new RegExp(/\|/g,"gm"),"$")}b.push(e)}}}}bibGlobalController.prototype.setDataToEditBibGrid("editBibGrid",b);setValue("nclmarc","");$("#pasteMarcDlg").dialog("close")};bibController.prototype.set=function(){$("#pageconfig_setpara_dlg").dialog("open")};bibController.prototype.setDataByGirdSelect=function(a){selectEditBibId=a;if(a==0){$(".showEditbib-tip").html("");clearGridData("editBibGrid")}else{$(".showEditbib-tip").html("??????????"+selectEditBibId+"??");bibGlobalController.prototype.loadEidtGridByPost(selectEditBibId,"editBibGrid")}};var bibCenterController=function(){};bibCenterController.prototype.search=function(a){var b=base_path+"lib/biblios/page.do";var e=bibGlobalController.prototype.getSearchCondtion();if(e.value){e["limit[0].value"]="1";var c=0;var d=$("#centerDataGridList").datagrid("getSelected");if(d){c=$("#centerDataGridList").datagrid("getRowIndex",d)}$("#centerDataGridList").datagrid({url:b,queryParams:e,onLoadSuccess:function(f){if(a&&a.total==0){$("#tabsGrid").tabs("select",1)}bibGlobalController.prototype.onLoadGridSuccess("centerDataGridList",f,c)},method:"post"})}};bibCenterController.prototype.initCenterGridDetail=function(d,c){var b=$("#centerDataGridDetail");if(!b.attr("class")){$("#showBibGridToolBar").show();var a=[{field:"ck",checkbox:true,width:"4%"},{field:"field",title:"?????",width:"8%"},{field:"indicator",title:"?????",width:"8%",formatter:onShowTextWidth},{field:"data",title:"??????",width:"80%",formatter:onShowDataValidator}];b.datagrid({iconCls:"e-icon fa fa-table",fit:true,fitColumns:true,border:false,nowrap:false,striped:true,toolbar:"#showBibGridToolBar",columns:[a]})}if(d){bibGlobalController.prototype.setDataToEditBibGrid(d,c)}};function copyFLdToLeftScreen(a){bibCenterController.prototype.copy(a)}bibCenterController.prototype.copy=function(e){var d=$("#centerDataGridDetail").datagrid("getSelections");if(e){d=e}if(d.length>0){for(var c=0;c<d.length;c++){if(d[c].field=="HEA"){continue}if(d[c].field!="001"){var b=cataConfigData.delfld;if(b){if(b.indexOf(d[c].field)<0){$("#editBibGrid").datagrid("appendRow",d[c])}}else{$("#editBibGrid").datagrid("appendRow",d[c])}}}var a=$("#editBibGrid").datagrid("getRows");$("#editBibGrid").datagrid("selectRow",a.length-1);$("#editBibGrid").datagrid("scrollTo",a.length-1)}};bibCenterController.prototype.cover=function(){var c=$("#centerDataGridDetail").datagrid("getRows");if(c.length>0){selectEditBibId=0;clearGridData("editBibGrid");for(var b=0;b<c.length;b++){if(c[b].field=="HEA"){continue}if(c[b].field!="001"){var a=cataConfigData.delfld;if(a){if(a.indexOf(c[b].field)<0){$("#editBibGrid").datagrid("appendRow",c[b])}}else{$("#editBibGrid").datagrid("appendRow",c[b])}}}}bibController.prototype.addAttrCtrlNO()};bibCenterController.prototype.merge=function(){var a=cataConfigData.savefld;var d=[];var f;var e=$("#centerDataGridDetail").datagrid("getSelections");var c=$("#editBibGrid").datagrid("getRows");if(a){if(c.length>0){for(var b=0;b<c.length;b++){if(c[b].field=="HEA"){f=c[b];continue}if(a.indexOf(c[b].field)>-1){d.push(c[b])}}}if(e.length>0){for(var b=0;b<e.length;b++){if(a.indexOf(e[b].field)<0){d.push(e[b])}}}}else{d=e}d.sort(function(h,g){if(h.field>g.field){return 1}if(h.field<g.field){return -1}return 0});if(f){d.splice(0,0,f)}$("#editBibGrid").datagrid("loadData",d);$("#editBibGrid").datagrid("selectRow",d.length-1);$("#editBibGrid").datagrid("scrollTo",d.length-1)};bibCenterController.prototype.selectCheckCenterGrid=function(){var c=$("#centerDataGridDetail").datagrid("getRows");var a="HEA,"+cataConfigData.savefld;for(var b=0;b<c.length;b++){if(a.indexOf(c[b].field)<0){$("#centerDataGridDetail").datagrid("checkRow",b)}}};bibCenterController.prototype.title=function(b){var a=$("#biblayout").layout("panel","east");a.panel("setTitle","????????????"+b)};var bibGlobalController=function(){};bibGlobalController.prototype.onLoadGridSuccess=function(c,b,a){if(b.total>0&&b.total>a){$("#"+c).datagrid("selectRow",a)}else{if(b.total>0){$("#"+c).datagrid("selectRow",0)}}};bibGlobalController.prototype.loadEidtGridByPost=function(d,b){var a=base_path+"lib/biblios/getMarcRecordForEdit.do";var c={};c.id=d;$.post(a,c,function(f){if(f.status=="0"){var e=f.rows;if(b=="centerDataGridDetail"){bibCenterController.prototype.initCenterGridDetail(b,e)}else{bibGlobalController.prototype.setDataToEditBibGrid(b,e)}}else{openMessageDlg(f.message)}},"json")};bibGlobalController.prototype.setDataToEditBibGrid=function(b,a){$("#"+b).datagrid({data:a,onLoadSuccess:function(c){$("#"+b).datagrid("resize");if(b=="centerDataGridDetail"){bibCenterController.prototype.selectCheckCenterGrid()}}})};bibGlobalController.prototype.loadGridData=function(f,c){if(f>0){var b=0;var e=$("#"+c+"DataGridList").datagrid("getSelected");if(e){b=$("#"+c+"DataGridList").datagrid("getRowIndex",e)}var a=base_path+"acq/"+c+"/page.do";if(c=="hold"){a=base_path+"hld/holding/page.do"}var d={};d.bibid=f;d.rows=10;d.page=1;d.orderBy=" id desc ";$("#"+c+"DataGridList").datagrid({url:a,queryParams:d,onLoadSuccess:function(g){bibGlobalController.prototype.onLoadGridSuccess(c+"DataGridList",g,b)},method:"post"})}else{deleteGridData(""+c+"DataGridList")}};bibGlobalController.prototype.getSearchCondtion=function(d,b){var e={};e.rows=10;e.page=1;e.orderBy=" id desc ";var c=0;if(vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){e["limit["+c+"].condition"]="status";e["limit["+c+"].value"]="0";c++}e["limit["+c+"].condition"]="sysid";e["limit["+c+"].value"]=cataConfigData.sysid;c++;e.condition=getValue("bibindex");e.value=getValue("keyword");var f=$("#libcodeSelect");if(f.length>0&&getValue("libcodeSelect").length>0){e["limit["+c+"].condition"]="libcode";e["limit["+c+"].value"]=getValue("libcodeSelect");c++}var a=$("#orderbatchno");if(a.length>0&&getValue("orderbatchno").length>0){e["limit["+c+"].condition"]="ORDBATCHNO";e["limit["+c+"].value"]=getValue("orderbatchno");c++}if($("#titlekey").length>0){if(getValue("titlekey").length>0){e["limit["+c+"].condition"]=getValue("bibindextitle");e["limit["+c+"].typeHandler"]=getValue("titlehandler");e["limit["+c+"].value"]=getValue("titlekey");c++}if(getValue("authorkey").length>0){e["limit["+c+"].condition"]=getValue("bibindexauthor");e["limit["+c+"].typeHandler"]=getValue("authorhandler");e["limit["+c+"].value"]=getValue("authorkey");c++}}if(d){e.condition=d;e.value=b}return e};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de