123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'wechat/routine_qrcode/index' + location.search,
- add_url: 'wechat/routine_qrcode/add',
- edit_url: 'wechat/routine_qrcode/edit',
- del_url: 'wechat/routine_qrcode/del',
- multi_url: 'wechat/routine_qrcode/multi',
- import_url: 'wechat/routine_qrcode/import',
- table: 'routine_qrcode',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'third_type', title: __('Third_type'), operate: 'LIKE'},
- {field: 'third_id', title: __('Third_id')},
- {field: 'status', title: __('Status')},
- {field: 'add_time', title: __('Add_time'), operate: 'LIKE'},
- {field: 'page', title: __('Page'), operate: 'LIKE'},
- {field: 'qrcode_url', title: __('Qrcode_url'), operate: 'LIKE', formatter: Table.api.formatter.url},
- {field: 'url_time', title: __('Url_time'), 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}
- ]
- ]
- });
- // 为表格绑定事件
- 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;
- });
|