var baseUrl="?app=space&controller=panel",contribute={view:function(a){window.open(baseUrl+"&action=view&contentid="+a)},del:function(a){if(a.length===0){ct.warn("\u8bf7\u9009\u62e9\u8981\u64cd\u4f5c\u7684\u8bb0\u5f55");return false}ct.confirm('\u786e\u5b9a\u5220\u9664\u7f16\u53f7\u4e3a<b style="color:red">'+a+"</b>\u7684\u8bb0\u5f55\u5417\uff1f",function(){$.getJSON(baseUrl+"&action=delete",{contentid:a},function(b){if(b.state){tableApp.deleteRow(a);contribute.num(b.num);ct.ok("\u64cd\u4f5c\u6210\u529f")}else ct.error(b.error)})})},
edit:function(a){if(contribute.islock(a)){ct.error("\u5f53\u524d\u6587\u6863\u5df2\u88ab\u9501\u5b9a\uff0c\u65e0\u6cd5\u4fee\u6539\uff01");return false}window.open(baseUrl+"&action=edit&contentid="+a)},approve:function(a){contribute._common(a,"approve")},islock:function(a){var b=false;$.getJSON("?app=space&controller=panel&action=islock",{contentid:a},function(c){b=c.state});return b},cancel:function(a){contribute._common(a,"cancel")},_common:function(a,b){if(a.length===0){ct.warn("\u8bf7\u9009\u62e9\u8981\u64cd\u4f5c\u7684\u8bb0\u5f55");
return false}else ct.confirm("\u662f\u5426\u6267\u884c\u64cd\u4f5c\uff1f",function(){$.getJSON(baseUrl+"&action="+b,{contentid:a},function(c){if(c.state){tableApp.deleteRow(a);contribute.num(c.num);ct.ok("\u64cd\u4f5c\u6210\u529f")}else ct.error(c.error)})})},num:function(a){for(var b in a){$("#num_"+b).html(a[b]);try{b==nowPage&&$("#pagetotal").html(a[b])}catch(c){alert(c)}}}};
