Announcement.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/Edit";
  2. var urlGDCX = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/EditGDCX";
  3. var bathval = "";
  4. var mnu;
  5. $(function () {
  6. mnu = $.SystemGeneral.getUrlParam("MNU");
  7. });
  8. //发布
  9. function Announcement_Add() {
  10. var redirectTo = url + "?MNU=" + mnu;
  11. $.popupTopWindow('公告发布', redirectTo, 850, 600, null, null);
  12. }
  13. //发布
  14. function AnnouncementGDCX_Add() {
  15. var redirectTo = urlGDCX + "?MNU=" + mnu;
  16. $.popupTopWindow('公告发布', redirectTo, 850, 600, null, null);
  17. }
  18. function reload() {
  19. $("#dgAnnouncementList").cmsXDataTable("load", $.getDataGridParams("dgAnnouncementList"));
  20. }
  21. //获取选中的数据
  22. function validChoose() {
  23. var d = [];
  24. $.each($("#dgAnnouncementList").cmsXDataTable("getSelections"), function (index) {
  25. d.push(this.AnnouncementID);
  26. });
  27. return d;
  28. }
  29. //修改按钮
  30. function Announcement_Update() {
  31. var d = validChoose();
  32. if (d.length == 0) {
  33. $.messager.alert("系统提示", "请选择您要修改的公告。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?AnnouncementID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('公告发布修改', redirectTo, 850, 600, null, null);
  42. }
  43. function AnnouncementGDCX_Update() {
  44. var d = validChoose();
  45. if (d.length == 0) {
  46. $.messager.alert("系统提示", "请选择您要修改的公告。");
  47. return;
  48. }
  49. if (d.length > 1) {
  50. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  51. return;
  52. }
  53. var redirectTo = urlGDCX + "?AnnouncementID=" + d + "&MNU=" + mnu;
  54. $.popupTopWindow('公告发布修改', redirectTo, 850, 600, null, null);
  55. }
  56. //删除
  57. function Announcement_Delete() {
  58. var d = validChoose().join(',');
  59. if (d == "") {
  60. $.messager.alert("系统提示", "请选择您要删除的公告。");
  61. return;
  62. }
  63. $.messager.confirm("系统提示", "您确定要删除该公告?", function (r) {
  64. if (r) {
  65. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Announcement/Delete', { announcementIDs: d }, function (data) {
  66. if (data == "删除成功!") {
  67. $.messager.alert("系统提示", data);
  68. $("#dgAnnouncementList").cmsXDataTable('load');
  69. } else {
  70. $.messager.alert("系统提示", data);
  71. }
  72. });
  73. }
  74. });
  75. }
  76. function Announcement_SetTop() {
  77. var d = validChoose().join(',');
  78. if (d == "") {
  79. $.messager.alert("系统提示", "请选择您要置顶的公告。");
  80. return;
  81. }
  82. $.messager.confirm("系统提示", "您确定要置顶选择的公告?", function (r) {
  83. if (r) {
  84. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Announcement/AnnouncementSetTop', { announcementIDs: d }, function (data) {
  85. if (data == "设置成功") {
  86. $.messager.alert("系统提示", data);
  87. $("#dgAnnouncementList").cmsXDataTable('load');
  88. } else {
  89. $.messager.alert("系统提示", data);
  90. }
  91. });
  92. }
  93. });
  94. }
  95. function viewAnnouncement(rowindex, rowdata) {
  96. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/AnnouncementView?MNU=" + mnu + "&announcementID=" + rowdata.AnnouncementID;
  97. top.$('#sysWindow').dialog({
  98. title: '公告信息',
  99. width: 750,
  100. height: 450,
  101. content: '<iframe id="iframe1" frameborder="0" scrolling="auto" src=' + redirectTo + '></iframe>',
  102. modal: true,
  103. });
  104. }