StudentRole.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Role/StudentEdit";
  2. var bathval = "";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function Role_Export() {
  8. $(document.forms[0]).submit();
  9. }
  10. //新增
  11. function Role_Add() {
  12. var redirectTo = url + "?MNU=" + mnu;
  13. $.popupTopWindow('学生角色新增', redirectTo, 650, 250, null, null);
  14. }
  15. function reload() {
  16. $("#dgRoleList").cmsXDataTable("load", $.getDataGridParams("dgRoleList"));
  17. }
  18. //获取选中的数据
  19. function validChoose() {
  20. var d = [];
  21. $.each($("#dgRoleList").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this.RoleID);
  23. });
  24. return d;
  25. }
  26. //点击列表更新
  27. function edit(rowindex, rowdata) {
  28. var redirectTo = url + "?RoleID=" + rowdata.RoleID + "&MNU=" + mnu + "&isView=1";
  29. $.popupTopWindow('学生角色信息', redirectTo, 650, 250, null, null);
  30. }
  31. //修改按钮
  32. function Role_Update() {
  33. var d = validChoose();
  34. if (d.length == 0) {
  35. $.messager.alert("系统提示", "请选择您要修改的角色类型。");
  36. return;
  37. }
  38. if (d.length > 1) {
  39. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  40. return;
  41. }
  42. var redirectTo = url + "?RoleID=" + d + "&MNU=" + mnu;
  43. $.popupTopWindow('学生角色修改', redirectTo, 650, 250, null, null);
  44. }
  45. //删除
  46. function Role_Delete() {
  47. var d = validChoose().join(',');
  48. if (d == "") {
  49. $.messager.alert("系统提示", "请选择您要删除的角色类型。");
  50. return;
  51. }
  52. $.messager.confirm("系统提示", "您确定要删除该角色类型?", function (r) {
  53. if (r) {
  54. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Role/Delete', { roleIDs: d }, function (data) {
  55. if (data == "删除成功!") {
  56. $.messager.alert("系统提示", data);
  57. $("#dgRoleList").cmsXDataTable('load');
  58. } else {
  59. $.messager.alert("系统提示", data);
  60. }
  61. });
  62. }
  63. });
  64. }
  65. //授权
  66. function Role_Authenization() {
  67. var d = validChoose();
  68. if (d.length == 0) {
  69. $.messager.alert("系统提示", "请选择您要授权的角色类型。");
  70. return;
  71. }
  72. if (d.length > 1) {
  73. $.messager.alert("系统提示", "只能选择单个记录进行授权。");
  74. return;
  75. }
  76. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Role/StudentAuthenization?RoleID=" + d + "&MNU=" + mnu;
  77. $.popupTopWindow('角色类型授权', redirectTo, 320, 550, null, null);
  78. }