Announcement.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/Edit";
  2. var bathval = "";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. //发布
  8. function Announcement_Add() {
  9. var redirectTo = url + "?MNU=" + mnu;
  10. $.popupTopWindow('公告发布', redirectTo, 880, 660, null, null);
  11. }
  12. function reload() {
  13. $("#dgAnnouncementList").cmsXDataTable("load", $.getDataGridParams("dgAnnouncementList"));
  14. }
  15. //获取选中的数据
  16. function validChoose() {
  17. var d = [];
  18. $.each($("#dgAnnouncementList").cmsXDataTable("getSelections"), function (index) {
  19. d.push(this.AnnouncementID);
  20. });
  21. return d;
  22. }
  23. //修改按钮
  24. function Announcement_Update() {
  25. var d = validChoose();
  26. if (d.length == 0) {
  27. $.messager.alert("系统提示", "请选择您要修改的公告。");
  28. return;
  29. }
  30. if (d.length > 1) {
  31. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  32. return;
  33. }
  34. var redirectTo = url + "?AnnouncementID=" + d + "&MNU=" + mnu;
  35. $.popupTopWindow('公告发布修改', redirectTo, 880, 660, null, null);
  36. }
  37. //删除
  38. function Announcement_Delete() {
  39. var d = validChoose().join(',');
  40. if (d == "") {
  41. $.messager.alert("系统提示", "请选择您要删除的公告。");
  42. return;
  43. }
  44. $.messager.confirm("系统提示", "您确定要删除该公告类型?", function (r) {
  45. if (r) {
  46. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Announcement/Delete', { announcementIDs: d }, function (data) {
  47. if (data == "删除成功!") {
  48. $.messager.alert("系统提示", data);
  49. $("#dgAnnouncementList").cmsXDataTable('load');
  50. } else {
  51. $.messager.alert("系统提示", data);
  52. }
  53. });
  54. }
  55. });
  56. }