|
@@ -49,15 +49,44 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
// {field: 'task_id', title: __('Task_id')},
|
|
|
{field: 'limit_duration', title: __('Limit_duration')},
|
|
|
- {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
- {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
+ {field: 'start_time', title: __('Start_time'), operate:false, addclass:'datetimerange', autocomplete:false},
|
|
|
+ {field: 'end_time', title: __('End_time'), operate:false, addclass:'datetimerange', autocomplete:false},
|
|
|
// {field: 'create_user_id', title: __('Create_user_id')},
|
|
|
{field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
|
|
|
- {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
+ {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
|
// {field: 'update_by', title: __('Update_by'), operate: 'LIKE'},
|
|
|
// {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
// {field: 'remark', title: __('Remark'), 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}
|
|
|
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
|
|
+ // formatter: Table.api.formatter.operate
|
|
|
+ formatter: Table.api.formatter.buttons,
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '',
|
|
|
+ icon: 'fa fa-pencil',
|
|
|
+ title: '编辑',
|
|
|
+ classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
+ extend: 'data-area=\'["85%","85%"]\'',
|
|
|
+ url: 'teacher/collection/edit',
|
|
|
+ },{
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '',
|
|
|
+ icon: 'fa fa-trash',
|
|
|
+ title: '删除',
|
|
|
+ classname: 'btn btn-danger btn-xs btn-magic btn-ajax',
|
|
|
+ url: 'teacher/collection/del',
|
|
|
+ confirm: '确定要删除吗?',
|
|
|
+ success: function (data, ret) {
|
|
|
+ $(".btn-refresh").trigger("click");
|
|
|
+ },
|
|
|
+ error: function (data, ret) {
|
|
|
+ Layer.alert(ret.msg);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
]
|
|
|
]
|
|
|
});
|
|
@@ -66,41 +95,48 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Table.api.bindevent(table);
|
|
|
},
|
|
|
add: function () {
|
|
|
- Table.api.init({
|
|
|
- extend: {
|
|
|
- index_url: 'teacher/collection/index' + location.search,
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- var table = $("#table1");
|
|
|
+ // Table.api.init({
|
|
|
+ // extend: {
|
|
|
+ // index_url: 'department/admin/departadmintotal' + location.search,
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var table = $("#table1");
|
|
|
+ // // 初始化表格
|
|
|
+ // table.bootstrapTable({
|
|
|
+ // url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ // pk: 'id',
|
|
|
+ // sortName: 'id',
|
|
|
+ // fixedColumns: true,
|
|
|
+ // fixedRightNumber: 1,
|
|
|
+ // searchFormVisible:false,
|
|
|
+ // Search:false,
|
|
|
+ // columns: [
|
|
|
+ // [
|
|
|
+ // {checkbox: true},
|
|
|
+ // {field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ // {field: 'department_admin_count', title: __('全部人员数量'),operate: false},
|
|
|
+ // ]
|
|
|
+ // ]
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // // 为表格绑定事件
|
|
|
+ // Table.api.bindevent(table);
|
|
|
|
|
|
- // 初始化表格
|
|
|
- table.bootstrapTable({
|
|
|
- url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
- pk: 'exam_collection_id',
|
|
|
- sortName: 'exam_collection_id',
|
|
|
- fixedColumns: true,
|
|
|
- fixedRightNumber: 1,
|
|
|
- searchFormVisible:false,
|
|
|
- Search:false,
|
|
|
- columns: [
|
|
|
- [
|
|
|
- {checkbox: true},
|
|
|
- {field: 'exam_collection_name', title: __('区队名称'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
- {field: 'exam_collection_id', title: __('全部人员数量'),operate: false},
|
|
|
- ]
|
|
|
- ]
|
|
|
+ //全选
|
|
|
+ $("input[name='btSelectAll']").click(function () {
|
|
|
+ var ids = Table.api.selectedids(table);
|
|
|
+ console.log(ids);
|
|
|
+ $(".depart_ids").val(ids);
|
|
|
});
|
|
|
-
|
|
|
- // 为表格绑定事件
|
|
|
- Table.api.bindevent(table);
|
|
|
-
|
|
|
- var ids = Table.api.selectedids(table);
|
|
|
- $(".banjiid").val(ids);
|
|
|
-
|
|
|
- console.log(ids);
|
|
|
- // return;
|
|
|
-
|
|
|
+ //单个选择
|
|
|
+ // $("#table1>.selected>.bs-checkbox>input[name='btSelectItem']").click(function () {
|
|
|
+ // alert('111111')
|
|
|
+ // console.log('asdfasdf')
|
|
|
+ // console.log($("#table").bootstrapTable('getSelections'));
|
|
|
+ // console.log('asdfasdf')
|
|
|
+ // // var ids = Table.api.selectedids(table);
|
|
|
+ // // $(".banjiid").val(ids);
|
|
|
+ // });
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
edit: function () {
|
|
@@ -108,7 +144,39 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
},
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ index_url: 'department/admin/departadmintotal' + location.search,
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var table = $("#table1");
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'id',
|
|
|
+ sortName: 'id',
|
|
|
+ fixedColumns: true,
|
|
|
+ fixedRightNumber: 1,
|
|
|
+ searchFormVisible:false,
|
|
|
+ Search:false,
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {checkbox: true},
|
|
|
+ {field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ {field: 'department_admin_count', title: __('全部人员数量'),operate: false},
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ });
|
|
|
+
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+
|
|
|
|
|
|
+ $("input[name='btSelectAll']").click(function () {
|
|
|
+ var ids = Table.api.selectedids(table);
|
|
|
+ console.log(ids);
|
|
|
+ $(".depart_ids").val(ids);
|
|
|
+ });
|
|
|
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
}
|