var data={save:function(a){var c="?app=section&controller=data&action=save&sectionid="+getPara("sectionid"),b="\u6dfb\u52a0";if(typeof a=="object"||!a)a=null;if(typeof a=="string"){c+="&dataid="+a;b="\u7f16\u8f91";var d=$("#tr_"+a).find("td.sid").text();c+="&sid="+d}ct.form(b,c,460,270,function(e){if(e.state){a?tableApp.updateRow(a,e.data):tableApp.load();return true}else{ct.error(e.error);return false}})},del:function(a){if(typeof a=="object"||!a){a=tableApp.checkedIds().join(",");var c=1}if(!a)return ct.warn("\u8bf7\u9009\u62e9\u8981\u5220\u9664\u7684\u6761\u76ee");
ct.confirm("\u786e\u5b9a\u5220\u9664\u9009\u4e2d\u7684\u6761\u76ee\uff1f",function(){$.getJSON("?app=section&controller=data&action=delete&sectionid="+a,function(b){if(b.state){if(c)a=null;tableApp.load()}else ct.error("\u5220\u9664\u5931\u8d25\uff01")})})},clear:function(a){$.getJSON("?app=section&controller=data&action=clear&sectionid="+a,function(c){if(c.state){ct.tips("\u6e05\u7a7a\u6210\u529f");tableApp.load()}else ct.error("\u6e05\u7a7a\u5931\u8d25\uff01")})},up:function(a){data.upDown(a,"up")},
down:function(a){data.upDown(a,"down")},upDown:function(a,c){if(c=="up"){var b=$("#tr_"+a).prev("tr");if(b.length<1)return;$("#tr_"+a).after(b)}else{b=$("#tr_"+a).next("tr");if(b.length<1)return;$("#tr_"+a).before(b)}b=b.attr("id").replace("tr_","");$.get("?app=section&controller=data&action=upDown&id="+a+"&targetid="+b,function(d){d!=1&&ct.error("\u4fdd\u5b58\u987a\u5e8f\u5931\u8d25")})},top:function(a){data.topBottom(a,"top")},bottom:function(a){data.topBottom(a,"bottom")},topBottom:function(a,
c){if(typeof a=="object"||!a)a=tableApp.checkedIds().join(",");if(!a)return ct.tips("\u8bf7\u9009\u62e9\u8981\u79fb\u52a8\u7684\u533a\u5757");$.getJSON("?app=section&controller=data&action=topBottom&type="+c+"&dataid="+a+"&sectionid="+getPara("sectionid"),function(b){if(b.state){ct.tips("\u79fb\u52a8\u6210\u529f");tableApp.load()}else ct.error(b.error?b.error:"\u79fb\u52a8\u5931\u8d25")})},relate:function(a){ct.ajax("\u9009\u53d6\u5185\u5bb9","?app=section&controller=data&action=relate&sectionid="+
a,760,500)}};
