62 lines
2.8 KiB
JavaScript
62 lines
2.8 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
// 初始化表格参数配置
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'wdsxh/message/message_notification/index' + location.search,
|
|
multi_url: 'wdsxh/message/message_notification/multi',
|
|
import_url: 'wdsxh/message/message_notification/import',
|
|
table: 'wdsxh_message_notification',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
columns: [
|
|
[
|
|
{field: 'id', title: __('Id')},
|
|
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent'},
|
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
|
buttons:[
|
|
{
|
|
name: 'list',
|
|
text: __('发送列表'),
|
|
title: __('发送列表'),
|
|
classname: 'btn btn-xs btn-info btn-dialog',
|
|
icon: 'fa fa-list',
|
|
extend: 'data-area=["100%","100%"]',
|
|
url: 'wdsxh/message/message_notification_member_id?notification_id={id}',
|
|
callback: function (data) {
|
|
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
|
},
|
|
visible: function (row) {
|
|
//返回true时按钮显示,返回false隐藏
|
|
return true;
|
|
}
|
|
},
|
|
]
|
|
}
|
|
]
|
|
]
|
|
});
|
|
|
|
// 为表格绑定事件
|
|
Table.api.bindevent(table);
|
|
},
|
|
api: {
|
|
bindevent: function () {
|
|
Form.api.bindevent($("form[role=form]"));
|
|
}
|
|
}
|
|
};
|
|
return Controller;
|
|
});
|