var url = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/Edit"; var urlGDCX = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/EditGDCX"; var bathval = ""; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); //发布 function Announcement_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('公告发布', redirectTo, 850, 600, null, null); } //发布 function AnnouncementGDCX_Add() { var redirectTo = urlGDCX + "?MNU=" + mnu; $.popupTopWindow('公告发布', redirectTo, 850, 600, null, null); } function reload() { $("#dgAnnouncementList").cmsXDataTable("load", $.getDataGridParams("dgAnnouncementList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgAnnouncementList").cmsXDataTable("getSelections"), function (index) { d.push(this.AnnouncementID); }); return d; } //修改按钮 function Announcement_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的公告。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?AnnouncementID=" + d + "&MNU=" + mnu; $.popupTopWindow('公告发布修改', redirectTo, 850, 600, null, null); } function AnnouncementGDCX_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的公告。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = urlGDCX + "?AnnouncementID=" + d + "&MNU=" + mnu; $.popupTopWindow('公告发布修改', redirectTo, 850, 600, null, null); } //删除 function Announcement_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的公告。"); return; } $.messager.confirm("系统提示", "您确定要删除该公告?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Announcement/Delete', { announcementIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgAnnouncementList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function Announcement_SetTop() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要置顶的公告。"); return; } $.messager.confirm("系统提示", "您确定要置顶选择的公告?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Announcement/AnnouncementSetTop', { announcementIDs: d }, function (data) { if (data == "设置成功") { $.messager.alert("系统提示", data); $("#dgAnnouncementList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function viewAnnouncement(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Announcement/AnnouncementView?MNU=" + mnu + "&announcementID=" + rowdata.AnnouncementID; top.$('#sysWindow').dialog({ title: '公告信息', width: 750, height: 450, content: '', modal: true, }); }