var space={add:function(){ct.form("\u6dfb\u52a0\u4e13\u680f","?app=space&controller=index&action=add",500,410,function(a){if(a.state){ct.ok("\u6dfb\u52a0\u6210\u529f");tableApp.load();return true}else ct.error(a.error)},function(){return true})},edit:function(a){ct.form("\u4fee\u6539\u4e13\u680f\u8d44\u6599","?app=space&controller=index&action=edit&spaceid="+a,500,410,function(b){if(b.state){typeof tableApp!="undefined"&&tableApp.updateRow(a,b.data);return true}else ct.error(b.error)},function(){return true})},
panel:function(a){ct.assoc.open("?app=space&controller=index&action=panel&spaceid="+a,"newtab")},del:function(a){ct.confirm("\u786e\u5b9a\u5220\u9664\u8be5\u4e13\u680f\u5417\uff1f",function(){$.post("?app=space&controller=index&action=delete",{spaceid:a},function(b){b.state?(ct.ok("\u5220\u9664\u5b8c\u6bd5"),tableApp.deleteRow(a)):ct.error(b.error)},"json")}).dialog("option","width",360)},search:function(){},open:function(a){space.action(a,3)},ban:function(a){space.action(a,0)},recommend:function(a){space.action(a,
4)},cancel:function(a){space.action(a,3)},published:function(a){ct.assoc.open("?app=article&controller=article&action=add&modelid=1&author="+a,"newtab")},action:function(a,b,d){$.post("?app=space&controller=index&action=status",{spaceid:a,status:b},function(c){if(c.state){ct.ok("\u64cd\u4f5c\u6210\u529f");d?setTimeout("location.href = location.href",2E3):tableApp.load()}else ct.error(c.error)},"json")},mulDel:function(){var a;a=tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u5220\u9664\u7684\u4e13\u680f\uff01"):
ct.confirm('\u786e\u5b9a\u5220\u9664\u9009\u4e2d\u7684<b style="color:red">'+a.length+"</b>\u6761\u8bb0\u5f55\u5417\uff1f",function(){$.post("?app=space&controller=index&action=delete",{spaceid:a.join(",")},function(b){b.state?(ct.ok("\u5220\u9664\u5b8c\u6bd5"),tableApp.deleteRow(a)):ct.error(b.error)},"json")}).dialog("option","width",360)},mulOpen:function(){var a;a=tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u4e13\u680f\uff01"):$.post("?app=space&controller=index&action=status",
{spaceid:a.join(","),status:3},function(b){b.state?(ct.ok("\u64cd\u4f5c\u6210\u529f"),tableApp.load()):ct.error(b.error)},"json")},mulRecommend:function(){var a;a=tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u4e13\u680f\uff01"):$.post("?app=space&controller=index&action=status",{spaceid:a.join(","),status:4},function(b){b.state?(ct.ok("\u64cd\u4f5c\u6210\u529f"),tableApp.load()):ct.error(b.error)},"json")},mulBan:function(){var a;a=tableApp.checkedIds();
a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u4e13\u680f\uff01"):$.post("?app=space&controller=index&action=status",{spaceid:a.join(","),status:0},function(b){b.state?(ct.ok("\u64cd\u4f5c\u6210\u529f"),tableApp.load()):ct.error(b.error)},"json")},mulCancel:function(){var a;a=tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u4e13\u680f\uff01"):$.post("?app=space&controller=index&action=status",{spaceid:a.join(","),status:3},function(b){b.state?
(ct.ok("\u64cd\u4f5c\u6210\u529f"),tableApp.load()):ct.error(b.error)},"json")}};
