123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'jiancejoblog/index' + location.search,
- add_url: 'jiancejoblog/add',
- edit_url: 'jiancejoblog/edit',
- del_url: 'jiancejoblog/del',
- multi_url: 'jiancejoblog/multi',
- import_url: 'jiancejoblog/import',
- table: 'jiance_joblog',
- }
- });
- 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: 'jiance_id', title: __('Jiance_id')},
- {field: 'jiance.bianhao', title: __('Jiance.bianhao'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'project_id', title: __('Project_id')},
- {field: 'project.title', title: __('Project.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'worker_id', title: __('Worker_id')},
- {field: 'worker.truename', title: __('Worker.truename'), operate: 'LIKE'},
- {field: 'worker.gonghao', title: __('Worker.gonghao'), operate: 'LIKE'},
- {field: 'worker.mobile', title: __('Worker.mobile'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'weizhi', title: __('Weizhi'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'number', title: __('Number')},
- {field: 'hege_status', title: __('Hege_status'), searchList: {"1":__('Hege_status 1'),"2":__('Hege_status 2'),"3":__('Hege_status 3')}, formatter: Table.api.formatter.status},
- {field: 'result', title: __('Result'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- {field: 'createtime', title: __('Createtime'), 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;
- });
|