|
@@ -0,0 +1,62 @@
|
|
|
|
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
+
|
|
|
|
+ var Controller = {
|
|
|
|
+ index: function () {
|
|
|
|
+ // 初始化表格参数配置
|
|
|
|
+ Table.api.init({
|
|
|
|
+ extend: {
|
|
|
|
+ index_url: 'dpgonghang/index' + location.search,
|
|
|
|
+ add_url: 'dpgonghang/add',
|
|
|
|
+ edit_url: 'dpgonghang/edit',
|
|
|
|
+ // del_url: 'dpgonghang/del',
|
|
|
|
+ multi_url: 'dpgonghang/multi',
|
|
|
|
+ import_url: 'dpgonghang/import',
|
|
|
|
+ table: 'dp_gonghang',
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var table = $("#table");
|
|
|
|
+
|
|
|
|
+ // 初始化表格
|
|
|
|
+ table.bootstrapTable({
|
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
|
+ pk: 'id',
|
|
|
|
+ sortName: 'id',
|
|
|
|
+ search: false, //列表搜索
|
|
|
|
+ commonSearch: false,//放大镜搜索
|
|
|
|
+ showToggle: false,//显示方式
|
|
|
|
+ showColumns: false,//字段勾选
|
|
|
|
+ showExport: false,//导出
|
|
|
|
+ columns: [
|
|
|
|
+ [
|
|
|
|
+ // {checkbox: true},
|
|
|
|
+ // {field: 'id', title: __('Id')},
|
|
|
|
+ {field: 'jkdars', title: __('Jkdars'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'whcss', title: __('Whcss'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'smxykcs', title: __('Smxykcs'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'hdmyd', title: __('Hdmyd'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'ddgz_djd', title: __('Ddgz_djd'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'ddgz_fwz', title: __('Ddgz_fwz'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'ddgz_wcpj', title: __('Ddgz_wcpj'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {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;
|
|
|
|
+});
|