rolemain.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. $('#pagejump').val(1);
  12. $("#roleform").submit();
  13. }
  14. role.main.del=function(data){
  15. $.confirm({
  16. title: '确认框',
  17. content: '确认删除吗',
  18. confirm: function(){
  19. $.post($.app + "/role/delete", {
  20. id : data
  21. }, function(data) {
  22. if (data.success) {
  23. $.alert({
  24. title: '提示',
  25. content: '操作成功',
  26. confirm: function(){
  27. $("#roleform").submit();
  28. }
  29. });
  30. } else {
  31. $.alert({
  32. title: '提示',
  33. content: data.message,
  34. confirm: function(){
  35. }
  36. });
  37. }
  38. }, "json");
  39. },
  40. cancel: function(){
  41. }
  42. });
  43. }
  44. role.main.edit=function(data){
  45. location.href=$.app+"/role/edit?id="+data;
  46. }
  47. role.main.view=function(data){
  48. location.href=$.app+"/role/view?id="+data;
  49. }
  50. /**
  51. * 弹出新增页面
  52. * */
  53. role.main.add=function(){
  54. location.href=$.app+"/role/add";
  55. }