rolemain.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. *角色管理
  3. *
  4. */
  5. $.namespace("role.main");
  6. role.main.init=function(){
  7. //把form传入,构造翻页控件
  8. pageinfo($("#roleform"));
  9. }
  10. role.main.search=function(){
  11. $("#roleform").submit();
  12. }
  13. role.main.del=function(data){
  14. $.confirm({
  15. title: '确认框',
  16. content: '确认删除吗',
  17. confirm: function(){
  18. $.post($.app + "/role/delete", {
  19. id : data
  20. }, function(data) {
  21. if (data.success) {
  22. $.alert({
  23. title: '提示',
  24. content: '操作成功',
  25. confirm: function(){
  26. $("#roleform").submit();
  27. }
  28. });
  29. } else {
  30. $.alert({
  31. title: '提示',
  32. content: data.message,
  33. confirm: function(){
  34. }
  35. });
  36. }
  37. }, "json");
  38. },
  39. cancel: function(){
  40. }
  41. });
  42. }
  43. role.main.edit=function(data){
  44. location.href=$.app+"/role/edit?id="+data;
  45. }
  46. role.main.view=function(data){
  47. location.href=$.app+"/role/view?id="+data;
  48. }
  49. /**
  50. * 弹出新增页面
  51. * */
  52. role.main.add=function(){
  53. location.href=$.app+"/role/add";
  54. }