| | |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =$("#language").val() |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '标题', field: 'title', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '内容', field: 'content', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '发布者', field: 'createrName', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'创建时间':(language==2?'Creation time':'Waktu penciptaan'), field: 'createtime', align: 'center', valign: 'middle', sortable: true} |
| | | {title: '公告名称', field: 'name', visible: true,align: 'center', valign: 'middle'}, |
| | | {title: '发布时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle', }, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'upOrDown', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {0:"已下架",1:"已上架"}[data] |
| | | }}, |
| | | ]; |
| | | }; |
| | | |
| | |
| | | /** |
| | | * 点击添加通知 |
| | | */ |
| | | Notice.openAddNotice = function () { |
| | | Notice.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'添加':(language==2?'Add':'Tambahkan'), |
| | | area: ['800px', '500px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/notice/notice_add' |
| | | content: Feng.ctxPath + '/tNotice/notice_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'详情':(language==2?'details':'details'), |
| | | area: ['800px', '420px'], //宽高 |
| | | title: language==1?'编辑':(language==2?'details':'details'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/notice/notice_update/' + Notice.seItem.id |
| | | content: Feng.ctxPath + '/tNotice/notice_update/' + Notice.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | Notice.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'详情':(language==2?'details':'details'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tNotice/notice_info/' + Notice.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | Notice.updateType = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/updateType", function (data) { |
| | | if(language==1){ |
| | | Feng.success("操作成功!"); |
| | | } |
| | | Notice.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set("id", Notice.seItem.id); |
| | | ajax.set("state", e); |
| | | ajax.start(); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | |
| | | if (this.check()) { |
| | | |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/notice/delete", function (data) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/delete", function (data) { |
| | | if(language==1){ |
| | | Feng.success("删除成功!"); |
| | | }else if(language==2){ |
| | |
| | | Feng.error("Hapus gagal!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set("noticeId", Notice.seItem.id); |
| | | ajax.set("id", Notice.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | Feng.confirm("是否删除通知 " + Notice.seItem.title + "?", operation); |
| | | Feng.confirm("是否删除该公告? ", operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | */ |
| | | Notice.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | Notice.table.refresh({query: queryData}); |
| | | }; |
| | | Notice.research = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | Notice.search() |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = Notice.initColumn(); |
| | | var table = new BSTable(Notice.id, "/notice/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | var table = new BSTable(Notice.id, "/tNotice/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | Notice.table = table.init(); |
| | | }); |