var url = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectInformation/Edit"; var bathval = ""; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); //发布 function ProjectInformation_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('项目资讯', redirectTo, 850, 600, null, null); } function reload() { $("#dgProjectInformationList").cmsXDataTable("load", $.getDataGridParams("dgProjectInformationList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgProjectInformationList").cmsXDataTable("getSelections"), function (index) { d.push(this.AnnouncementID); }); return d; } //修改按钮 function ProjectInformation_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 ProjectInformation_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); $("#dgProjectInformationList").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); $("#dgProjectInformationList").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, }); }