123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'exception/interfacecall/index' + location.search,
- add_url: 'exception/interfacecall/add',
- edit_url: '',
- del_url: '',
- multi_url: 'exception/interfacecall/multi',
- table: 'interface_call',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- sortOrder: 'asc',
- columns: [
- [
- {field: 'name', title: __('Name')},
- {field: 'institution', title: __('Institution')},
- {field: 'times', title: __('Times')},
- {field: 'datetime', title: __('Datetime'), operate:'RANGE', addclass:'datetimerange'},
- {
- field: 'operate',
- title: __('Operate'),
- table: table,
- events: Table.api.events.operate,
- formatter: Table.api.formatter.operate,
- buttons: [
- {
- name : 'detail',
- title : '详情',
- text : '详情',
- extend : 'data-toggle="tooltip"',
- icon : 'fa fa-th-list',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'exception/interfacecall/edit',
- }
- ]
- }
- ]
- ]
- });
- // 为表格绑定事件
- 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;
- });
|