123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- var mnu = "";
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
-
- editor = $('#editor_id');
- editor.html($("#Content").val());
- });
- function Announcement_Save() {
- var stime = $("#StartTime").val();
- var etime = $("#EndTime").val();
- stime = new Date(stime);
- etime = new Date(etime);
- if (stime > etime) {
- $.messager.alert("系统提示", "发布时间不能晚于截止时间");
- return;
- }
- var html = editor.html();
- //editor.sync();
- html = $('#editor_id').val();
- var text = html2Escape(html);
- var isSendWX = $("#IsSendWXEdit").is(":checked");
- if (isSendWX)
- {
- var content = editor.html();
- $("#textContent").val(content);
- }
- $("#Content").val(text);
- $(document.forms[0]).submit();
- }
- function html2Escape(sHtml) {
- return $("<div/>").text(sHtml).html();
- }
- function selectSendWX() {
- var isSendWX = $("#IsSendWXEdit").is(":checked");
- if (isSendWX) {
- $(".msgtr").show();
- }
- else {
- $(".msgtr").hide();
- }
- }
- function Announcement_RoleAdd() {
- $.popupTopWindow('选择发布角色', CMS_SystemConfig.VirtualDirectoryPath + '/Common/RoleSelector', 620, 360, Announcement_RoleAdd_Confirm);
- }
- function Announcement_RoleAdd_Confirm(roleList) {
- if (!roleList) return;
- var roleViewList = $("#dgRoleList").cmsXDataTable("getRows");
- $.each(roleList, function (index, value) {
- if ($.grep(roleViewList, function (row, index) { return value.RoleID == row.RoleID; }).length == 0) {
- roleViewList.push({
- RoleID: value.RoleID,
- OrderNo: value.OrderNo,
- RoleName: value.RoleName,
- DefaultDataRangeDesc: value.DefaultDataRangeDesc,
- RecordStatusDesc: value.RecordStatusDesc,
- Description: value.Description
- });
- }
- $("#dgRoleList").cmsXDataTable("loadData", { rows: roleViewList, total: roleViewList.length });
- });
- }
- function validChoose() {
- var d = [];
- $.each($("#dgRoleList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- function Announcement_RoleDelete() {
- var d = validChoose();
- var roleViewList = $("#dgRoleList").cmsXDataTable("getRows");
- var i, j;
- var len = roleViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (roleViewList[i].RoleID == d[j].RoleID) {
- roleViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgRoleList").cmsXDataTable("loadData", { rows: roleViewList, total: roleViewList.length });
- }
- function Announcement_UserAdd() {
- $.popupTopWindow('选择发布用户', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/StudentSelect?MNU=' + mnu, 750, 500, Announcement_UserAdd_Confirm);
- }
- function Announcement_UserAdd_Confirm(userList) {
- if (!userList) return;
- var userViewList = $("#dgUserList").cmsXDataTable("getRows");
- $.each(userList, function (index, value) {
- if ($.grep(userViewList, function (row, index) { return value.IDNumber == row.IDNumber; }).length == 0) {
- userViewList.push({
- UserID: value.UserID,
- CollegeName: value.CollegeName,
- SchoolyearID: value.SchoolyearID,
- ClassmajorName: value.ClassmajorName,
- Name: value.UserName,
- SexName: value.SexName,
- IDNumber: value.IDNumber,
- });
- }
- $("#dgUserList").cmsXDataTable("loadData", { rows: userViewList, total: userViewList.length });
- });
- }
- function validChoose() {
- var d = [];
- $.each($("#dgUserList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- function Announcement_UserDelete() {
- var d = validChoose();
- var userViewList = $("#dgUserList").cmsXDataTable("getRows");
- var i, j;
- var len = userViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (userViewList[i].UserID == d[j].UserID) {
- userViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgUserList").cmsXDataTable("loadData", { rows: userViewList, total: userViewList.length });
- }
|