var baseUrl="?app=mood&controller=mood",mood={view:function(b,a){ct.assoc.open(baseUrl+"&action=view&modelid="+b+"&contentid="+a,"newtab")},add:function(){ct.form("\u6dfb\u52a0\u5fc3\u60c5\u65b9\u6848",baseUrl+"&action=add",360,180,function(b){tableApp.addRow(b.data);return true},function(){return true})},edit:function(b){ct.form("\u7f16\u8f91\u65b9\u6848",baseUrl+"&action=edit&moodid="+b,360,180,function(a){a.state?(ct.ok("\u4fee\u6539\u6210\u529f"),tableApp.updateRow(b,a.data)):ct.error(a.error);
return true},function(){return true})},del:function(b){ct.confirm("\u786e\u8ba4\u5220\u9664\uff1f",function(){$.post(baseUrl+"&action=delete",{moodid:b},function(a){a.state?(ct.ok("\u5220\u9664\u5b8c\u6bd5"),tableApp.deleteRow(b)):ct.error(a.error)},"json")})},sort_up:function(b){$.post(baseUrl+"&action=sort",{moodid:b,sort:"up"},function(a){a.state?tableApp.load():ct.error(a.error)},"json")},sort_down:function(b){$.post(baseUrl+"&action=sort",{moodid:b,sort:"down"},function(a){a.state?tableApp.load():
ct.error(a.error)},"json")}};
