|
@@ -95,6 +95,103 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
// 为表格绑定事件
|
|
// 为表格绑定事件
|
|
Table.api.bindevent(table);
|
|
Table.api.bindevent(table);
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ task: function () {
|
|
|
|
+ // 初始化表格参数配置
|
|
|
|
+ Table.api.init({
|
|
|
|
+ extend: {
|
|
|
|
+ index_url: 'teacher/collection/task/type/' +Config.sim_type+ 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,
|
|
|
|
+ columns: [
|
|
|
|
+ [
|
|
|
|
+ {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: '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: '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});
|
|
|
|
+ },
|
|
|
|
+ }, 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);
|
|
|
|
+ },
|
|
|
|
+ faults: function () {
|
|
|
|
+ // 初始化表格参数配置
|
|
|
|
+ Table.api.init({
|
|
|
|
+ extend: {
|
|
|
|
+ index_url: 'teacher/collection/faults/type/'+Config.sim_type + location.search,
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var table = $("#table");
|
|
|
|
+ var multiple = true;
|
|
|
|
+ // 初始化表格
|
|
|
|
+ table.bootstrapTable({
|
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
|
+ pk: 'fault_id',
|
|
|
|
+ sortName: 'fault_id',
|
|
|
|
+ fixedColumns: true,
|
|
|
|
+ fixedRightNumber: 1,
|
|
|
|
+ searchFormVisible:true,
|
|
|
|
+ columns: [
|
|
|
|
+ [
|
|
|
|
+ {checkbox: true},
|
|
|
|
+ {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>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ ]
|
|
|
|
+ });
|
|
|
|
+ // 为表格绑定事件
|
|
|
|
+ Table.api.bindevent(table);
|
|
|
|
+
|
|
|
|
+ // 选中多个
|
|
|
|
+ $(document).on("click", ".btn-choose-multi", function () {
|
|
|
|
+ var ids = Table.api.selectedids(table);
|
|
|
|
+ Fast.api.close({url: '', multiple: multiple, task_id:ids});
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
add: function () {
|
|
add: function () {
|
|
Controller.api.bindevent();
|
|
Controller.api.bindevent();
|
|
},
|
|
},
|
|
@@ -160,12 +257,65 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
$(".depart_ids").val(rel_Ids.join());
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ $(document).on('change', '#c-question_setting_method', function () {
|
|
|
|
+ if($(this).val()==1){
|
|
|
|
+ $(".btn-sm,.btn-task").css('display','none');
|
|
|
|
+ }else if($(this).val()==2){
|
|
|
|
+ $(".btn-sm").css('display','block');
|
|
|
|
+ $(".btn-task").css('display','none');
|
|
|
|
+ }else if($(this).val()==3){
|
|
|
|
+ $(".btn-sm").css('display','none');
|
|
|
|
+ $(".btn-task").css('display','block');
|
|
|
|
+ }
|
|
|
|
+ $(".question_ids").val(0);
|
|
|
|
+ });
|
|
|
|
+ //考题
|
|
|
|
+ $(document).on('click', '.btn-sm', function () {
|
|
|
|
+ var simtype = $("#c-sim_type").val();
|
|
|
|
+ if(!simtype){
|
|
|
|
+ Layer.alert('请选择模拟器类型');
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ var title = '选择考题';
|
|
|
|
+ Fast.api.open(Fast.api.fixurl("teacher/collection/faults/type/"+simtype), title, {
|
|
|
|
+ area: ["85%", "85%"],
|
|
|
|
+ maxmin: true,
|
|
|
|
+ moveOut: false,
|
|
|
|
+ offset: ['40px'],
|
|
|
|
+ callback: function(value) {
|
|
|
|
+ console.log(value)
|
|
|
|
+ if (value.task_id) {
|
|
|
|
+ $(".question_ids").val(value.task_id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ //任务
|
|
|
|
+ $(document).on('click', '.btn-task', function () {
|
|
|
|
+ var simtype = $("#c-sim_type").val();
|
|
|
|
+ if(!simtype){
|
|
|
|
+ Layer.alert('请选择模拟器类型');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ var title = '选择任务';
|
|
|
|
+ parent.Fast.api.open(Fast.api.fixurl("teacher/collection/task/type/"+simtype), title, {
|
|
|
|
+ area: ["85%", "85%"],
|
|
|
|
+ maxmin: true,
|
|
|
|
+ moveOut: false,
|
|
|
|
+ offset: ['40px'],
|
|
|
|
+ callback: function(value) {
|
|
|
|
+ if (value.task_id) {
|
|
|
|
+ $(".question_ids").val(value.task_id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
// $("input[name='btSelectAll']").click(function () {
|
|
// $("input[name='btSelectAll']").click(function () {
|
|
// var ids = Table.api.selectedids(table);
|
|
// var ids = Table.api.selectedids(table);
|
|
// console.log(ids);
|
|
// console.log(ids);
|
|
// $(".depart_ids").val(ids);
|
|
// $(".depart_ids").val(ids);
|
|
// });
|
|
// });
|
|
- $("input[name='btSelectAll']").css('display','none')
|
|
|
|
|
|
+ $("input[name='btSelectAll']").css('display','none');
|
|
Form.api.bindevent($("form[role=form]"));
|
|
Form.api.bindevent($("form[role=form]"));
|
|
}
|
|
}
|
|
}
|
|
}
|