|
@@ -1,8 +1,6 @@
|
|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
var Controller = {
|
|
|
index: function () {
|
|
|
- $('.btn-add').data('area',['85%','85%']);
|
|
|
- $('.btn-edit').data('area',['85%','85%']);
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
@@ -32,8 +30,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
{checkbox: true},
|
|
|
{field: 'exam_collection_id', title: __('编号'),operate: false},
|
|
|
{field: 'exam_collection_name', title: __('Exam_collection_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
- {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
- {field: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
|
|
|
+ // {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
+ // {field: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
|
|
|
{
|
|
|
field: 'exam_collection_state',searchList:{"2":"打开","3":"关闭"},
|
|
|
title: __('Exam_collection_state'),
|
|
@@ -48,7 +46,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
// {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: 'qudui_count', title: __('区队数量'), operate: false},
|
|
|
+ // {field: 'qudui_count', title: __('区队数量'), operate: false},
|
|
|
{field: 'xueyuan_count', title: __('应考人数'), operate: false},
|
|
|
{field: 'yikao_count', title: __('已考人数'), operate: false},
|
|
|
{field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
@@ -65,7 +63,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
icon: 'fa fa-pencil',
|
|
|
title: '编辑',
|
|
|
classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
- extend: 'data-area=\'["85%","85%"]\'',
|
|
|
+ // extend: 'data-area=\'["85%","85%"]\'',
|
|
|
url: 'teacher/collection/edit',
|
|
|
},
|
|
|
{
|
|
@@ -84,6 +82,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
},
|
|
|
{
|
|
|
name: 'dispatch',
|
|
|
+ text: '查看学员',
|
|
|
+ icon: 'fa fa-eye',
|
|
|
+ title: '查看学员',
|
|
|
+ classname: 'btn btn-warning btn-xs btn-magic btn-dialog',
|
|
|
+ extend: 'data-area=\'["85%","85%"]\'',
|
|
|
+ url: 'teacher/collection/viewuser',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '添加学员',
|
|
|
+ icon: 'fa fa-plus',
|
|
|
+ title: '添加学员',
|
|
|
+ classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
+ extend: 'data-area=\'["85%","85%"]\'',
|
|
|
+ url: 'teacher/collection/adduser',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '删除学员',
|
|
|
+ icon: 'fa fa-pencil',
|
|
|
+ title: '删除学员',
|
|
|
+ classname: 'btn btn-info btn-xs btn-magic btn-dialog',
|
|
|
+ extend: 'data-area=\'["75%","75%"]\'',
|
|
|
+ url: 'teacher/collection/edituser',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'dispatch',
|
|
|
text: '删除',
|
|
|
icon: 'fa fa-trash',
|
|
|
title: '删除',
|
|
@@ -119,6 +144,54 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ viewuser: function () {
|
|
|
+ // 初始化表格参数配置
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ index_url: 'teacher/collection/viewuser/ids/' +Config.ids+ location.search,
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var table = $("#table");
|
|
|
+ var multiple = true;
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'task_id',
|
|
|
+ sortName: 'task_id',
|
|
|
+ fixedColumns: true,
|
|
|
+ fixedRightNumber: 1,
|
|
|
+ singleSelect : true,
|
|
|
+ searchFormVisible:true,
|
|
|
+ search: false,
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ // {checkbox: true},
|
|
|
+ // {field: 'task_id', title: __('Task_id'),operate: false},
|
|
|
+ {field: 'user_nickname', title: __('学员'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
+ {field: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
|
|
|
+ {field: 'fault_names', title: __('故障内容'),formatter: Table.api.formatter.faultname,operate: false},
|
|
|
+ {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
|
+ // {
|
|
|
+ // field: 'operate', title: __('Operate'), width: 85, events: {
|
|
|
+ // 'click .btn-chooseone': function (e, value, row, index) {
|
|
|
+ // Fast.api.close({url: row.url, multiple: multiple,task_id:row.task_id,task_name:row.name,fault_name:row.fault_name});
|
|
|
+ // },
|
|
|
+ // }, formatter: function () {
|
|
|
+ // return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
task: function () {
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
@@ -245,19 +318,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
$("button[name=commonSearch]").css('display','none');
|
|
|
},
|
|
|
add: function () {
|
|
|
+ Controller.api.bindevent1();
|
|
|
+ },
|
|
|
+ adduser: function () {
|
|
|
+ Controller.api.bindevent2();
|
|
|
+ },
|
|
|
+ edituser: function () {
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
edit: function () {
|
|
|
- Controller.api.bindevent();
|
|
|
+ Controller.api.bindevent1();
|
|
|
},
|
|
|
api: {
|
|
|
- bindevent: function () {
|
|
|
+ bindevent1: function () {
|
|
|
+ Form.api.bindevent($("form[role=form]"));
|
|
|
+ },
|
|
|
+ bindevent2: function () {
|
|
|
var rel_Ids = [];
|
|
|
var qudui_total = 0;
|
|
|
var xueyuan_total = 0;
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
- index_url: 'department/admin/departadmintotal' + location.search,
|
|
|
+ // index_url: 'department/admin/departadmintotal' + location.search,
|
|
|
+ index_url: 'auth/admin/admintotal' + location.search,
|
|
|
}
|
|
|
});
|
|
|
var table = $("#table1");
|
|
@@ -269,47 +352,40 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
fixedColumns: true,
|
|
|
fixedRightNumber: 1,
|
|
|
searchFormVisible:false,
|
|
|
- pagination:false,
|
|
|
+ // pagination:false,
|
|
|
Search:false,
|
|
|
columns: [
|
|
|
[
|
|
|
{checkbox: true,
|
|
|
formatter: function(value,row,index){
|
|
|
- // console.log(row.id+'####'+Config.row_info.depart_ids)
|
|
|
- if(Config.row_info != undefined && Config.row_info.depart_ids.indexOf(row.id)>-1){
|
|
|
+ if(Config.user_ids != undefined && Config.user_ids.indexOf(row.id)>-1){
|
|
|
rel_Ids.push(row.id);
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
- {field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
- {field: 'department_admin_count', title: __('全部人员数量'),operate: false},
|
|
|
+ {field: 'department_text', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ {field: 'nickname', title: __('姓名'),operate: false},
|
|
|
]
|
|
|
],
|
|
|
onLoadSuccess: function(data) {
|
|
|
$.each(data.rows, function(index, row) {
|
|
|
- if(Config.row_info != undefined && Config.row_info.depart_ids.indexOf(row.id)>-1){
|
|
|
- qudui_total = qudui_total+1;
|
|
|
- xueyuan_total = xueyuan_total+row.department_admin_count;
|
|
|
+ if(Config.user_ids != undefined && Config.user_ids.indexOf(row.id)>-1){
|
|
|
+ xueyuan_total = xueyuan_total+1;
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- $(".qudui_total").html(qudui_total);
|
|
|
$(".xueyuan_total").html(xueyuan_total);
|
|
|
- $(".qudui_input").val(qudui_total);
|
|
|
$(".xueyuan_input").val(xueyuan_total);
|
|
|
},
|
|
|
// 点击每一个单选框时触发的操作
|
|
|
onCheck:function(row){
|
|
|
rel_Ids.push(row.id);
|
|
|
- qudui_total = qudui_total+1;
|
|
|
- xueyuan_total = xueyuan_total+row.department_admin_count;
|
|
|
+ xueyuan_total = xueyuan_total+1;
|
|
|
|
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
|
- $(".qudui_total").html(qudui_total);
|
|
|
$(".xueyuan_total").html(xueyuan_total);
|
|
|
- $(".qudui_input").val(qudui_total);
|
|
|
$(".xueyuan_input").val(xueyuan_total);
|
|
|
},
|
|
|
// 取消每一个单选框时对应的操作;
|
|
@@ -318,13 +394,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
if(index > -1) {
|
|
|
rel_Ids.splice(index, 1);
|
|
|
}
|
|
|
- qudui_total = qudui_total-1;
|
|
|
- xueyuan_total = xueyuan_total-row.department_admin_count;
|
|
|
+ xueyuan_total = xueyuan_total-1;
|
|
|
|
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
|
- $(".qudui_total").html(qudui_total);
|
|
|
$(".xueyuan_total").html(xueyuan_total);
|
|
|
- $(".qudui_input").val(qudui_total);
|
|
|
$(".xueyuan_input").val(xueyuan_total);
|
|
|
}
|
|
|
});
|
|
@@ -332,47 +405,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
// 为表格绑定事件
|
|
|
Table.api.bindevent(table);
|
|
|
|
|
|
- //点击每一行
|
|
|
- // table.on('click-row.bs.table', function (e, row, element) {
|
|
|
- // console.log(rel_Ids)
|
|
|
- // // console.log('row')
|
|
|
- // if(!$.inArray(row.id,rel_Ids)){
|
|
|
- // if(Config.row_info.starttime>0){
|
|
|
- // Layer.alert('考试正在进行中,只可增加区队不可取消区队');
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // arr = $.grep(rel_Ids, function(value) {
|
|
|
- // return value != row["id"];
|
|
|
- // });
|
|
|
- // rel_Ids = arr;
|
|
|
- // qudui_total = qudui_total-1;
|
|
|
- // xueyuan_total = xueyuan_total-row.department_admin_count;
|
|
|
- // }else if(rel_Ids.indexOf(row.id)>-1){
|
|
|
- // if(Config.row_info.starttime>0){
|
|
|
- // Layer.alert('考试正在进行中,只可增加区队不可取消区队');
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // var index = rel_Ids.indexOf(row.id);
|
|
|
- // if(index > -1) {
|
|
|
- // rel_Ids.splice(index, 1);
|
|
|
- // }
|
|
|
- // qudui_total = qudui_total-1;
|
|
|
- // xueyuan_total = xueyuan_total-row.department_admin_count;
|
|
|
- // }else{
|
|
|
- // qudui_total = qudui_total+1;
|
|
|
- // xueyuan_total = xueyuan_total+row.department_admin_count;
|
|
|
- // rel_Ids.push(row.id);
|
|
|
- // }
|
|
|
- // console.log(qudui_total);
|
|
|
- // console.log(xueyuan_total);
|
|
|
- // $(".depart_ids").val(rel_Ids.join());
|
|
|
- // $(".qudui_total").html(qudui_total);
|
|
|
- // $(".xueyuan_total").html(xueyuan_total);
|
|
|
- // $(".qudui_input").val(qudui_total);
|
|
|
- // $(".xueyuan_input").val(xueyuan_total);
|
|
|
- // });
|
|
|
-
|
|
|
-
|
|
|
$(document).on('change', '#c-question_setting_method', function () {
|
|
|
if($(this).val()==1){
|
|
|
$(".btn-sm,.btn-task").css('display','none');
|
|
@@ -447,7 +479,74 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
$("button[name=commonSearch]").css('display','none');
|
|
|
$("input[name='btSelectAll']").css('display','none');
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
+ },
|
|
|
+ bindevent: function () {
|
|
|
+ var rel_Ids = [];
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ // index_url: 'department/admin/departadmintotal' + location.search,
|
|
|
+ index_url: 'auth/admin/admintotal' + location.search,
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var table = $("#table1");
|
|
|
+
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'id',
|
|
|
+ sortName: 'id',
|
|
|
+ fixedColumns: true,
|
|
|
+ fixedRightNumber: 1,
|
|
|
+ searchFormVisible:false,
|
|
|
+ // pagination:false,
|
|
|
+ Search:false,
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {checkbox: true,
|
|
|
+ formatter: function(value,row,index){
|
|
|
+ if(Config.user_ids != undefined && Config.user_ids.indexOf(row.id)>-1){
|
|
|
+ // rel_Ids.push(row.id);
|
|
|
+ return true;
|
|
|
+ }else{
|
|
|
+ return {disabled : true}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {field: 'id', title: __('ID'),operate: false},
|
|
|
+ {field: 'department_text', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ {field: 'nickname', title: __('姓名'),operate: false},
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ onLoadSuccess: function(data) {
|
|
|
+ // $.each(data.rows, function(index, row) {
|
|
|
+ // if(Config.user_ids != undefined && Config.user_ids.indexOf(row.id)>-1){
|
|
|
+ // xueyuan_total = xueyuan_total+1;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ // 点击每一个单选框时触发的操作
|
|
|
+ onCheck:function(row){
|
|
|
+ var index = rel_Ids.indexOf(row.id);
|
|
|
+ if(index > -1) {
|
|
|
+ rel_Ids.splice(index, 1);
|
|
|
+ };
|
|
|
+ $(".depart_id").val(rel_Ids.join());
|
|
|
+ },
|
|
|
+ // 取消每一个单选框时对应的操作;
|
|
|
+ onUncheck:function(row){
|
|
|
+ rel_Ids.push(row.id);
|
|
|
+ $(".depart_id").val(rel_Ids.join());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+
|
|
|
+ $("button[name=commonSearch]").css('display','none');
|
|
|
+ $("input[name='btSelectAll']").css('display','none');
|
|
|
+ Form.api.bindevent($("form[role=form]"));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
return Controller;
|