/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:陈彬彬 * 日 期:2017.07.11 * 描 述:公告通知 */ var refreshGirdData; // 更新数据 var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGrid(); page.bind(); }, bind: function () { // 查询 $('#btn_Search').on('click', function () { var keyword = $('#txt_Keyword').val(); page.search({ keyword: keyword }); }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); //还原 $('#lr_revert').on('click', function () { var keyValue = $('#gridtable').jfGridValue('F_NewsId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认还原该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/RevertForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); }, initGrid: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageListRevert', headData: [ { label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' }, { label: '发布人员', name: 'F_CreateUserName', index: 'F_CreateUserName', width: 100, align: 'left' }, { label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' }, { label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center", formatter: function (cellvalue) { return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm'); } }, { label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center', formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', key: value, keyId: 'id', callback: function (_data) { callback(_data['name'] || value); } }); } }, { label: '阅读次数', name: 'F_PV', index: 'F_PV', width: 80, align: 'center' }, { label: "发布状态", name: "F_EnabledMark", index: "F_EnabledMark", width: 80, align: "center", autowidth: false, formatter: function (cellvalue) { if (cellvalue == 1) { return "已发布"; } else { return "未发布"; } } }, { label: "创建时间", name: "F_CreateDate", index: "F_CreateDate", width: 130, align: "center" } ], mainId: 'F_NewsId', isMultiselect: true, isPage: true, sidx: 'F_CreateDate', sord: 'desc' }); page.search(); }, search: function (param) { $('#gridtable').jfGridSet('reload', param); } }; // 保存数据后回调刷新 refreshGirdData = function () { page.search(); } page.init(); }