|
@@ -17,7 +17,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
});
|
|
});
|
|
|
|
|
|
var table = $("#table");
|
|
var table = $("#table");
|
|
-
|
|
|
|
// 初始化表格
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
@@ -31,14 +30,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
columns: [
|
|
columns: [
|
|
[
|
|
[
|
|
{checkbox: true},
|
|
{checkbox: true},
|
|
- {field: 'exam_collection_id', title: __('编号')},
|
|
|
|
|
|
+ {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: '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: '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: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
|
|
- {field: 'exam_collection_type', title: __('Exam_collection_type'),operate: false,formatter: function (value, row, index) {
|
|
|
|
- return '考试';
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
field: 'exam_collection_state',searchList:{"2":"打开","3":"关闭"},
|
|
field: 'exam_collection_state',searchList:{"2":"打开","3":"关闭"},
|
|
title: __('Exam_collection_state'),
|
|
title: __('Exam_collection_state'),
|
|
@@ -49,8 +44,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
// {field: 'task_id', title: __('Task_id')},
|
|
// {field: 'task_id', title: __('Task_id')},
|
|
{field: 'limit_duration', title: __('Limit_duration')},
|
|
{field: 'limit_duration', title: __('Limit_duration')},
|
|
- {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: '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_user_id', title: __('Create_user_id')},
|
|
{field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
|
|
{field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
|
|
{field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
{field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
@@ -115,6 +110,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
url: "teacher/collection/start/ids/"+ids,
|
|
url: "teacher/collection/start/ids/"+ids,
|
|
type: "post",
|
|
type: "post",
|
|
}, function () {
|
|
}, function () {
|
|
|
|
+ Layer.alert('开始成功');
|
|
table.bootstrapTable('refresh');
|
|
table.bootstrapTable('refresh');
|
|
Layer.close(index);
|
|
Layer.close(index);
|
|
});
|
|
});
|
|
@@ -139,24 +135,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
fixedRightNumber: 1,
|
|
fixedRightNumber: 1,
|
|
singleSelect : true,
|
|
singleSelect : true,
|
|
searchFormVisible:true,
|
|
searchFormVisible:true,
|
|
|
|
+ search: false,
|
|
columns: [
|
|
columns: [
|
|
[
|
|
[
|
|
{checkbox: true},
|
|
{checkbox: true},
|
|
- {field: 'task_id', title: __('Task_id')},
|
|
|
|
- {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
|
- // {field: 'task_type', title: __('Task_type'),operate: false,formatter: function (value, row, index) {
|
|
|
|
- // return '教师创建';
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
|
|
+ {field: 'task_id', title: __('Task_id'),operate: false},
|
|
{field: 'name', title: __('任务名称'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
{field: 'name', title: __('任务名称'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
- {field: 'xianxiang_count', title: __('故障现象数量'),operate: false},
|
|
|
|
- {field: 'buwei_count', title: __('故障部位数量'),operate: false},
|
|
|
|
- {field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
|
|
|
|
|
|
+ {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
|
+ {field: 'fault_name', title: __('故障内容'),formatter: Table.api.formatter.faultname},
|
|
{field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
{field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
|
|
{
|
|
{
|
|
field: 'operate', title: __('Operate'), width: 85, events: {
|
|
field: 'operate', title: __('Operate'), width: 85, events: {
|
|
'click .btn-chooseone': function (e, value, row, index) {
|
|
'click .btn-chooseone': function (e, value, row, index) {
|
|
- Fast.api.close({url: row.url, multiple: multiple,task_id:row.task_id});
|
|
|
|
|
|
+ Fast.api.close({url: row.url, multiple: multiple,task_id:row.task_id,task_name:row.name});
|
|
},
|
|
},
|
|
}, formatter: function () {
|
|
}, formatter: function () {
|
|
return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
|
|
return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
|
|
@@ -185,22 +176,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
sortName: 'fault_id',
|
|
sortName: 'fault_id',
|
|
fixedColumns: true,
|
|
fixedColumns: true,
|
|
fixedRightNumber: 1,
|
|
fixedRightNumber: 1,
|
|
- searchFormVisible:true,
|
|
|
|
|
|
+ searchFormVisible:false,
|
|
|
|
+ showExport:false,
|
|
|
|
+ search:false,
|
|
columns: [
|
|
columns: [
|
|
[
|
|
[
|
|
{checkbox: true},
|
|
{checkbox: true},
|
|
{field: 'sim_type', title: __('模拟器类型'),operate:false,searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
{field: 'sim_type', title: __('模拟器类型'),operate:false,searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
- {field: 'parent_name', title: __('故障现象'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
- {field: 'name', title: __('故障部位'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
- {
|
|
|
|
- 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.fault_id});
|
|
|
|
- },
|
|
|
|
- }, formatter: function () {
|
|
|
|
- return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // {field: 'parent_name', title: __('故障现象'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ {field: 'name', title: __('故障内容'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
+ // {
|
|
|
|
+ // 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.fault_id});
|
|
|
|
+ // },
|
|
|
|
+ // }, formatter: function () {
|
|
|
|
+ // return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
]
|
|
]
|
|
]
|
|
]
|
|
});
|
|
});
|
|
@@ -210,10 +203,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
// 选中多个
|
|
// 选中多个
|
|
$(document).on("click", ".btn-choose-multi", function () {
|
|
$(document).on("click", ".btn-choose-multi", function () {
|
|
var ids = Table.api.selectedids(table);
|
|
var ids = Table.api.selectedids(table);
|
|
- Fast.api.close({url: '', multiple: multiple, task_id:ids});
|
|
|
|
|
|
+ if(ids.length!=3){
|
|
|
|
+ Layer.alert('故障内容只允许选择3个');
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ var taskname = [];
|
|
|
|
+ var datas = $("#table").bootstrapTable('getSelections');
|
|
|
|
+ $.each(datas,function (index,val) {
|
|
|
|
+ taskname.push(val.name)
|
|
|
|
+ })
|
|
|
|
+ Fast.api.close({url: '', multiple: multiple, task_id:ids,task_name:taskname});
|
|
});
|
|
});
|
|
- },
|
|
|
|
|
|
|
|
|
|
+ $("button[name=commonSearch]").css('display','none');
|
|
|
|
+ },
|
|
add: function () {
|
|
add: function () {
|
|
Controller.api.bindevent();
|
|
Controller.api.bindevent();
|
|
},
|
|
},
|
|
@@ -223,6 +226,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
api: {
|
|
api: {
|
|
bindevent: function () {
|
|
bindevent: function () {
|
|
var rel_Ids = [];
|
|
var rel_Ids = [];
|
|
|
|
+ var qudui_total = 0;
|
|
|
|
+ var xueyuan_total = 0;
|
|
Table.api.init({
|
|
Table.api.init({
|
|
extend: {
|
|
extend: {
|
|
index_url: 'department/admin/departadmintotal' + location.search,
|
|
index_url: 'department/admin/departadmintotal' + location.search,
|
|
@@ -253,7 +258,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
{field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
{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_admin_count', 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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ $(".qudui_total").html(qudui_total);
|
|
|
|
+ $(".xueyuan_total").html(xueyuan_total);
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
|
|
// 为表格绑定事件
|
|
// 为表格绑定事件
|
|
@@ -268,28 +284,44 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
return value != row["id"];
|
|
return value != row["id"];
|
|
});
|
|
});
|
|
rel_Ids = arr;
|
|
rel_Ids = arr;
|
|
|
|
+ qudui_total = qudui_total-1;
|
|
|
|
+ xueyuan_total = xueyuan_total-row.department_admin_count;
|
|
}else if(rel_Ids.indexOf(row.id)>-1){
|
|
}else if(rel_Ids.indexOf(row.id)>-1){
|
|
var index = rel_Ids.indexOf(row.id);
|
|
var index = rel_Ids.indexOf(row.id);
|
|
- if (index > -1) {
|
|
|
|
|
|
+ if(index > -1) {
|
|
rel_Ids.splice(index, 1);
|
|
rel_Ids.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
+ qudui_total = qudui_total-1;
|
|
|
|
+ xueyuan_total = xueyuan_total-row.department_admin_count;
|
|
}else{
|
|
}else{
|
|
|
|
+ qudui_total = qudui_total+1;
|
|
|
|
+ xueyuan_total = xueyuan_total+row.department_admin_count;
|
|
rel_Ids.push(row.id);
|
|
rel_Ids.push(row.id);
|
|
}
|
|
}
|
|
|
|
+ console.log(qudui_total);
|
|
|
|
+ console.log(xueyuan_total);
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
|
|
+ $(".qudui_total").html(qudui_total);
|
|
|
|
+ $(".xueyuan_total").html(xueyuan_total);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$(document).on('change', '#c-question_setting_method', function () {
|
|
$(document).on('change', '#c-question_setting_method', function () {
|
|
if($(this).val()==1){
|
|
if($(this).val()==1){
|
|
$(".btn-sm,.btn-task").css('display','none');
|
|
$(".btn-sm,.btn-task").css('display','none');
|
|
}else if($(this).val()==2){
|
|
}else if($(this).val()==2){
|
|
- $(".btn-sm").css('display','block');
|
|
|
|
|
|
+ $(".btn-sm").show();
|
|
$(".btn-task").css('display','none');
|
|
$(".btn-task").css('display','none');
|
|
}else if($(this).val()==3){
|
|
}else if($(this).val()==3){
|
|
$(".btn-sm").css('display','none');
|
|
$(".btn-sm").css('display','none');
|
|
- $(".btn-task").css('display','block');
|
|
|
|
|
|
+ $(".btn-task").show();
|
|
}
|
|
}
|
|
$(".question_ids").val(0);
|
|
$(".question_ids").val(0);
|
|
|
|
+ $(".task_id").val(0);
|
|
|
|
+ $("#c-task_name").val('');
|
|
|
|
+ $("#c-question_name").val('');
|
|
|
|
+ $(".tasks,.questions").css('display','none')
|
|
});
|
|
});
|
|
//考题
|
|
//考题
|
|
$(document).on('click', '.btn-sm', function () {
|
|
$(document).on('click', '.btn-sm', function () {
|
|
@@ -305,9 +337,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
moveOut: false,
|
|
moveOut: false,
|
|
offset: ['40px'],
|
|
offset: ['40px'],
|
|
callback: function(value) {
|
|
callback: function(value) {
|
|
- console.log(value)
|
|
|
|
if (value.task_id) {
|
|
if (value.task_id) {
|
|
|
|
+ $(".questions").css('display','block')
|
|
$(".question_ids").val(value.task_id);
|
|
$(".question_ids").val(value.task_id);
|
|
|
|
+ $("#c-question_name").val(value.task_name);
|
|
|
|
+ $(".tasks").css('display','none')
|
|
|
|
+ $(".task_id").val(0);
|
|
|
|
+ $("#c-task_name").val('');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -321,13 +357,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
}
|
|
}
|
|
var title = '选择任务';
|
|
var title = '选择任务';
|
|
parent.Fast.api.open(Fast.api.fixurl("teacher/collection/task/type/"+simtype), title, {
|
|
parent.Fast.api.open(Fast.api.fixurl("teacher/collection/task/type/"+simtype), title, {
|
|
- area: ["85%", "85%"],
|
|
|
|
|
|
+ area: ["65%", "70%"],
|
|
maxmin: true,
|
|
maxmin: true,
|
|
moveOut: false,
|
|
moveOut: false,
|
|
offset: ['40px'],
|
|
offset: ['40px'],
|
|
callback: function(value) {
|
|
callback: function(value) {
|
|
if (value.task_id) {
|
|
if (value.task_id) {
|
|
- $(".question_ids").val(value.task_id);
|
|
|
|
|
|
+ $(".tasks").css('display','block')
|
|
|
|
+ $(".task_id").val(value.task_id);
|
|
|
|
+ $("#c-task_name").val(value.task_name);
|
|
|
|
+ $(".questions").css('display','none')
|
|
|
|
+ $(".question_ids").val(0);
|
|
|
|
+ $("#c-question_name").val('');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -337,6 +378,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
// console.log(ids);
|
|
// console.log(ids);
|
|
// $(".depart_ids").val(ids);
|
|
// $(".depart_ids").val(ids);
|
|
// });
|
|
// });
|
|
|
|
+ $("button[name=commonSearch]").css('display','none');
|
|
$("input[name='btSelectAll']").css('display','none');
|
|
$("input[name='btSelectAll']").css('display','none');
|
|
Form.api.bindevent($("form[role=form]"));
|
|
Form.api.bindevent($("form[role=form]"));
|
|
}
|
|
}
|