12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'live_room_log/index' + location.search,
- add_url: 'live_room_log/add',
- edit_url: 'live_room_log/edit',
- del_url: 'live_room_log/del',
- multi_url: 'live_room_log/multi',
- import_url: 'live_room_log/import',
- table: 'live_room_log',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'open_time', title: __('Open_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'close_time', title: __('Close_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'session', title: __('Session'), operate: 'LIKE'},
- {field: 'like', title: __('Like')},
- {field: 'ccu', title: __('Ccu')},
- {field: 'uv', title: __('Uv')},
- {field: 'pv', title: __('Pv')},
- {field: 'goods_sales', title: __('Goods_sales')},
- {field: 'share_num', title: __('Share_num')},
- {field: 'follow_num', title: __('Follow_num')},
- {field: 'duration', title: __('Duration')},
- {field: 'user_id', title: __('User_id')},
- {field: 'room_id', title: __('Room_id')},
- {field: 'room_no', title: __('Room_no'), operate: 'LIKE'},
- // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|