12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'exception/datacall/index' + location.search,
- add_url: '',
- edit_url: '',
- del_url: '',
- multi_url: 'exception/datacall/multi',
- table: 'data_call',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- sortOrder: 'asc',
- columns: [
- [
- {field: 'data_type', title: __('Data_type')},
- {field: 'institution', title: __('Institution')},
- {field: 'data_range', title: __('Data_range')},
- {field: 'datetime', title: __('Datetime'), operate:'RANGE', addclass:'datetimerange'},
- {field: 'times', title: __('Times')},
- {
- 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/datacall/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;
- });
|