/**
* jQuery EasyUI 1.4.5
*
* Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function($){
var _1=0;
function _2(a,o){
return $.easyui.indexOfArray(a,o);
};
function _3(a,o,id){
$.easyui.removeArrayItem(a,o,id);
};
function _4(a,o,r){
$.easyui.addArrayItem(a,o,r);
};
function _5(_6,aa){
return $.data(_6,"treegrid")?aa.slice(1):aa;
};
function _7(_8){
var _9=$.data(_8,"datagrid");
var _a=_9.options;
var _b=_9.panel;
var dc=_9.dc;
var ss=null;
if(_a.sharedStyleSheet){
ss=typeof _a.sharedStyleSheet=="boolean"?"head":_a.sharedStyleSheet;
}else{
ss=_b.closest("div.datagrid-view");
if(!ss.length){
ss=dc.view;
}
}
var cc=$(ss);
var _c=$.data(cc[0],"ss");
if(!_c){
_c=$.data(cc[0],"ss",{cache:{},dirty:[]});
}
return {add:function(_d){
var ss=["");
$(ss.join("\n")).appendTo(cc);
cc.children("style[easyui]:not(:last)").remove();
},getRule:function(_10){
var _11=cc.children("style[easyui]:last")[0];
var _12=_11.styleSheet?_11.styleSheet:(_11.sheet||document.styleSheets[document.styleSheets.length-1]);
var _13=_12.cssRules||_12.rules;
return _13[_10];
},set:function(_14,_15){
var _16=_c.cache[_14];
if(_16){
_16.width=_15;
var _17=this.getRule(_16.index);
if(_17){
_17.style["width"]=_15;
}
}
},remove:function(_18){
var tmp=[];
for(var s in _c.cache){
if(s.indexOf(_18)==-1){
tmp.push([s,_c.cache[s].width]);
}
}
_c.cache={};
this.add(tmp);
},dirty:function(_19){
if(_19){
_c.dirty.push(_19);
}
},clean:function(){
for(var i=0;i<_c.dirty.length;i++){
this.remove(_c.dirty[i]);
}
_c.dirty=[];
}};
};
function _1a(_1b,_1c){
var _1d=$.data(_1b,"datagrid");
var _1e=_1d.options;
var _1f=_1d.panel;
if(_1c){
$.extend(_1e,_1c);
}
if(_1e.fit==true){
var p=_1f.panel("panel").parent();
_1e.width=p.width();
_1e.height=p.height();
}
_1f.panel("resize",_1e);
};
function _20(_21){
var _22=$.data(_21,"datagrid");
var _23=_22.options;
var dc=_22.dc;
var _24=_22.panel;
var _25=_24.width();
var _26=_24.height();
var _27=dc.view;
var _28=dc.view1;
var _29=dc.view2;
var _2a=_28.children("div.datagrid-header");
var _2b=_29.children("div.datagrid-header");
var _2c=_2a.find("table");
var _2d=_2b.find("table");
_27.width(_25);
var _2e=_2a.children("div.datagrid-header-inner").show();
_28.width(_2e.find("table").width());
if(!_23.showHeader){
_2e.hide();
}
_29.width(_25-_28._outerWidth());
_28.children()._outerWidth(_28.width());
_29.children()._outerWidth(_29.width());
var all=_2a.add(_2b).add(_2c).add(_2d);
all.css("height","");
var hh=Math.max(_2c.height(),_2d.height());
all._outerHeight(hh);
dc.body1.add(dc.body2).children("table.datagrid-btable-frozen").css({position:"absolute",top:dc.header2._outerHeight()});
var _2f=dc.body2.children("table.datagrid-btable-frozen")._outerHeight();
var _30=_2f+_2b._outerHeight()+_29.children(".datagrid-footer")._outerHeight();
_24.children(":not(.datagrid-view,.datagrid-mask,.datagrid-mask-msg)").each(function(){
_30+=$(this)._outerHeight();
});
var _31=_24.outerHeight()-_24.height();
var _32=_24._size("minHeight")||"";
var _33=_24._size("maxHeight")||"";
_28.add(_29).children("div.datagrid-body").css({marginTop:_2f,height:(isNaN(parseInt(_23.height))?"":(_26-_30)),minHeight:(_32?_32-_31-_30:""),maxHeight:(_33?_33-_31-_30:"")});
_27.height(_29.height());
};
function _34(_35,_36,_37){
var _38=$.data(_35,"datagrid").data.rows;
var _39=$.data(_35,"datagrid").options;
var dc=$.data(_35,"datagrid").dc;
if(!dc.body1.is(":empty")&&(!_39.nowrap||_39.autoRowHeight||_37)){
if(_36!=undefined){
var tr1=_39.finder.getTr(_35,_36,"body",1);
var tr2=_39.finder.getTr(_35,_36,"body",2);
_3a(tr1,tr2);
}else{
var tr1=_39.finder.getTr(_35,0,"allbody",1);
var tr2=_39.finder.getTr(_35,0,"allbody",2);
_3a(tr1,tr2);
if(_39.showFooter){
var tr1=_39.finder.getTr(_35,0,"allfooter",1);
var tr2=_39.finder.getTr(_35,0,"allfooter",2);
_3a(tr1,tr2);
}
}
}
_20(_35);
if(_39.height=="auto"){
var _3b=dc.body1.parent();
var _3c=dc.body2;
var _3d=_3e(_3c);
var _3f=_3d.height;
if(_3d.width>_3c.width()){
_3f+=18;
}
_3f-=parseInt(_3c.css("marginTop"))||0;
_3b.height(_3f);
_3c.height(_3f);
dc.view.height(dc.view2.height());
}
dc.body2.triggerHandler("scroll");
function _3a(_40,_41){
for(var i=0;i<_41.length;i++){
var tr1=$(_40[i]);
var tr2=$(_41[i]);
tr1.css("height","");
tr2.css("height","");
var _42=Math.max(tr1.height(),tr2.height());
tr1.css("height",_42);
tr2.css("height",_42);
}
};
function _3e(cc){
var _43=0;
var _44=0;
$(cc).children().each(function(){
var c=$(this);
if(c.is(":visible")){
_44+=c._outerHeight();
if(_43");
}
_4a(true);
_4a(false);
_20(_46);
function _4a(_4b){
var _4c=_4b?1:2;
var tr=_49.finder.getTr(_46,_47,"body",_4c);
(_4b?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr);
};
};
function _4d(_4e,_4f){
function _50(){
var _51=[];
var _52=[];
$(_4e).children("thead").each(function(){
var opt=$.parser.parseOptions(this,[{frozen:"boolean"}]);
$(this).find("tr").each(function(){
var _53=[];
$(this).find("th").each(function(){
var th=$(this);
var col=$.extend({},$.parser.parseOptions(this,["id","field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?cceval(th.attr("formatter")):undefined),styler:(th.attr("styler")?cceval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?cceval(th.attr("sorter")):undefined)});
if(col.width&&String(col.width).indexOf("%")==-1){
col.width=parseInt(col.width);
}
if(th.attr("editor")){
var s=$.trim(th.attr("editor"));
if(s.substr(0,1)=="{"){
col.editor=cceval("("+s+")");
}else{
col.editor=s;
}
}
_53.push(col);
});
opt.frozen?_51.push(_53):_52.push(_53);
});
});
return [_51,_52];
};
var _54=$("
"+"
"+"
"+"
"+""+"
"+"
"+""+"
"+""+"
"+"
"+"
"+""+"
"+""+""+"
"+"
"+"
").insertAfter(_4e);
_54.panel({doSize:false,cls:"datagrid"});
$(_4e).addClass("datagrid-f").hide().appendTo(_54.children("div.datagrid-view"));
var cc=_50();
var _55=_54.children("div.datagrid-view");
var _56=_55.children("div.datagrid-view1");
var _57=_55.children("div.datagrid-view2");
return {panel:_54,frozenColumns:cc[0],columns:cc[1],dc:{view:_55,view1:_56,view2:_57,header1:_56.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_57.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_56.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_57.children("div.datagrid-body"),footer1:_56.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_57.children("div.datagrid-footer").children("div.datagrid-footer-inner")}};
};
function _58(_59){
var _5a=$.data(_59,"datagrid");
var _5b=_5a.options;
var dc=_5a.dc;
var _5c=_5a.panel;
_5a.ss=$(_59).datagrid("createStyleSheet");
_5c.panel($.extend({},_5b,{id:null,doSize:false,onResize:function(_5d,_5e){
if($.data(_59,"datagrid")){
_20(_59);
$(_59).datagrid("fitColumns");
_5b.onResize.call(_5c,_5d,_5e);
}
},onExpand:function(){
if($.data(_59,"datagrid")){
$(_59).datagrid("fixRowHeight").datagrid("fitColumns");
_5b.onExpand.call(_5c);
}
}}));
_5a.rowIdPrefix="datagrid-row-r"+(++_1);
_5a.cellClassPrefix="datagrid-cell-c"+_1;
_5f(dc.header1,_5b.frozenColumns,true);
_5f(dc.header2,_5b.columns,false);
_60();
dc.header1.add(dc.header2).css("display",_5b.showHeader?"block":"none");
dc.footer1.add(dc.footer2).css("display",_5b.showFooter?"block":"none");
if(_5b.toolbar){
if($.isArray(_5b.toolbar)){
$("div.datagrid-toolbar",_5c).remove();
var tb=$("
").prependTo(_5c);
var tr=tb.find("tr");
for(var i=0;i<_5b.toolbar.length;i++){
var btn=_5b.toolbar[i];
if(btn=="-"){
$("
").appendTo(tr);
}else{
var td=$("
").appendTo(tr);
var _61=$("").appendTo(td);
_61[0].onclick=cceval(btn.handler||function(){
});
_61.linkbutton($.extend({},btn,{plain:true}));
}
}
}else{
$(_5b.toolbar).addClass("datagrid-toolbar").prependTo(_5c);
$(_5b.toolbar).show();
}
}else{
$("div.datagrid-toolbar",_5c).remove();
}
$("div.datagrid-pager",_5c).remove();
if(_5b.pagination){
var _62=$("");
if(_5b.pagePosition=="bottom"){
_62.appendTo(_5c);
}else{
if(_5b.pagePosition=="top"){
_62.addClass("datagrid-pager-top").prependTo(_5c);
}else{
var _63=$("").prependTo(_5c);
_62.appendTo(_5c);
_62=_62.add(_63);
}
}
_62.pagination({total:(_5b.pageNumber*_5b.pageSize),pageNumber:_5b.pageNumber,pageSize:_5b.pageSize,pageList:_5b.pageList,onSelectPage:function(_64,_65){
_5b.pageNumber=_64||1;
_5b.pageSize=_65;
_62.pagination("refresh",{pageNumber:_64,pageSize:_65});
_af(_59);
}});
_5b.pageSize=_62.pagination("options").pageSize;
}
function _5f(_66,_67,_68){
if(!_67){
return;
}
$(_66).show();
$(_66).empty();
var _69=[];
var _6a=[];
var _6b=[];
if(_5b.sortName){
_69=_5b.sortName.split(",");
_6a=_5b.sortOrder.split(",");
}
var t=$("
").appendTo(_66);
for(var i=0;i<_67.length;i++){
var tr=$("
").appendTo($("tbody",t));
var _6c=_67[i];
for(var j=0;j<_6c.length;j++){
var col=_6c[j];
var _6d="";
if(col.rowspan){
_6d+="rowspan=\""+col.rowspan+"\" ";
}
if(col.colspan){
_6d+="colspan=\""+col.colspan+"\" ";
if(!col.id){
col.id=["datagrid-td-group"+_1,i,j].join("-");
}
}
if(col.id){
_6d+="id=\""+col.id+"\"";
}
var td=$("
");
$(_205).html(_208.join(""));
},renderTable:function(_209,_20a,rows,_20b){
var _20c=$.data(_209,"datagrid");
var opts=_20c.options;
if(_20b){
if(!(opts.rownumbers||(opts.frozenColumns&&opts.frozenColumns.length))){
return "";
}
}
var _20d=$(_209).datagrid("getColumnFields",_20b);
var _20e=["
");
return _20e.join("");
},renderRow:function(_211,_212,_213,_214,_215){
var opts=$.data(_211,"datagrid").options;
var cc=[];
if(_213&&opts.rownumbers){
var _216=_214+1;
if(opts.pagination){
_216+=(opts.pageNumber-1)*opts.pageSize;
}
cc.push("
"+_216+"
");
}
for(var i=0;i<_212.length;i++){
var _217=_212[i];
var col=$(_211).datagrid("getColumnOption",_217);
if(col){
var _218=_215[_217];
var css=col.styler?(col.styler(_218,_215,_214)||""):"";
var cs=this.getStyleValue(css);
var cls=cs.c?"class=\""+cs.c+"\"":"";
var _219=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":"");
cc.push("
");
}
}
return cc.join("");
},getStyleValue:function(css){
var _21a="";
var _21b="";
if(typeof css=="string"){
_21b=css;
}else{
if(css){
_21a=css["class"]||"";
_21b=css["style"]||"";
}
}
return {c:_21a,s:_21b};
},refreshRow:function(_21c,_21d){
this.updateRow.call(this,_21c,_21d,{});
},updateRow:function(_21e,_21f,row){
var opts=$.data(_21e,"datagrid").options;
var _220=opts.finder.getRow(_21e,_21f);
var _221=_222.call(this,_21f);
$.extend(_220,row);
var _223=_222.call(this,_21f);
var _224=_221.c;
var _225=_223.s;
var _226="datagrid-row "+(_21f%2&&opts.striped?"datagrid-row-alt ":" ")+_223.c;
function _222(_227){
var css=opts.rowStyler?opts.rowStyler.call(_21e,_227,_220):"";
return this.getStyleValue(css);
};
function _228(_229){
var _22a=$(_21e).datagrid("getColumnFields",_229);
var tr=opts.finder.getTr(_21e,_21f,"body",(_229?1:2));
var _22b=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked");
tr.html(this.renderRow.call(this,_21e,_22a,_229,_21f,_220));
tr.attr("style",_225).removeClass(_224).addClass(_226);
if(_22b){
tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true);
}
};
_228.call(this,true);
_228.call(this,false);
$(_21e).datagrid("fixRowHeight",_21f);
},insertRow:function(_22c,_22d,row){
var _22e=$.data(_22c,"datagrid");
var opts=_22e.options;
var dc=_22e.dc;
var data=_22e.data;
if(_22d==undefined||_22d==null){
_22d=data.rows.length;
}
if(_22d>data.rows.length){
_22d=data.rows.length;
}
function _22f(_230){
var _231=_230?1:2;
for(var i=data.rows.length-1;i>=_22d;i--){
var tr=opts.finder.getTr(_22c,i,"body",_231);
tr.attr("datagrid-row-index",i+1);
tr.attr("id",_22e.rowIdPrefix+"-"+_231+"-"+(i+1));
if(_230&&opts.rownumbers){
var _232=i+2;
if(opts.pagination){
_232+=(opts.pageNumber-1)*opts.pageSize;
}
tr.find("div.datagrid-cell-rownumber").html(_232);
}
if(opts.striped){
tr.removeClass("datagrid-row-alt").addClass((i+1)%2?"datagrid-row-alt":"");
}
}
};
function _233(_234){
var _235=_234?1:2;
var _236=$(_22c).datagrid("getColumnFields",_234);
var _237=_22e.rowIdPrefix+"-"+_235+"-"+_22d;
var tr="
";
if(_22d>=data.rows.length){
if(data.rows.length){
opts.finder.getTr(_22c,"","last",_235).after(tr);
}else{
var cc=_234?dc.body1:dc.body2;
cc.html("