|
@@ -2,6 +2,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
var Controller = {
|
|
|
index: function () {
|
|
|
+ $('.btn-edit').data('area',['55%','95%']);
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
@@ -29,29 +30,176 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
[
|
|
|
{checkbox: true},
|
|
|
{field: 'exam_id', title: __('Exam_id')},
|
|
|
- {field: 'exam_collection_id', title: __('Exam_collection_id')},
|
|
|
- {field: 'user_id', title: __('User_id')},
|
|
|
- {field: 'seat_id', title: __('Seat_id')},
|
|
|
+ {field: 'exam_collection_name', title: __('考试名称')},
|
|
|
+ {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
+ {field: 'user_username', title: __('学员学号')},
|
|
|
+ {field: 'user_nickname', title: __('学员姓名')},
|
|
|
+ {
|
|
|
+ field: 'user_depart_id',
|
|
|
+ title: __('Department'),
|
|
|
+ visible: false,
|
|
|
+ addclass: 'selectpage',
|
|
|
+ extend: 'data-source="department/index/index" data-field="name"',
|
|
|
+ operate: Config.groupIds !=8 ? 'in':false,
|
|
|
+ formatter: Table.api.formatter.search
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // field: 'dadmin',
|
|
|
+ // title: __('Department'),
|
|
|
+ // formatter: function (value, row, index) {
|
|
|
+ // if (value.length == 0)
|
|
|
+ // return '-' ;
|
|
|
+ // var department="";
|
|
|
+ // $.each(value,function(i,v){ //arrTmp数组数据
|
|
|
+ // if (v.department){
|
|
|
+ // department+=department?','+v.department.name:v.department.name;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return Table.api.formatter.flag.call(this, department, row, index);
|
|
|
+ // }, operate:false
|
|
|
+ // },
|
|
|
+ // {field: 'exam_collection_id', title: __('Exam_collection_id')},
|
|
|
+ // {field: 'user_id', title: __('User_id')},
|
|
|
+ // {field: 'seat_id', title: __('Seat_id')},
|
|
|
// {field: 'sim_id', title: __('Sim_id')},
|
|
|
- {field: 'exam_status', title: __('Exam_status')},
|
|
|
+ {field: 'exam_status', title: __('Exam_status'),searchList: {"0":"未登录","1":"已登录","2":"模拟器检查并下发故障中","3":"模拟器正常","4":"答题中","5":"已交卷","6":"计算成绩中","7":"获取到成绩报告","80":"教师标记缺考","81":"登录未开始答题","90":"模拟器异常结束"},formatter: Table.api.formatter.simexamstatus},
|
|
|
{field: 'total_score', title: __('Total_score')},
|
|
|
// {field: 'deduction_total_score', title: __('Deduction_total_score')},
|
|
|
- {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: 'login_time', title: __('Login_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
+ {field: 'starttime', title: __('Start_time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
|
|
+ {field: 'endtime', title: __('End_time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
|
|
+ // {field: 'login_time', title: __('Login_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
// {field: 'logout_time', title: __('Logout_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
// {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},
|
|
|
// {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=\'["55%","95%"]\'',
|
|
|
+ url: 'teacher/exams/edit',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
]
|
|
|
]
|
|
|
});
|
|
|
|
|
|
// 为表格绑定事件
|
|
|
Table.api.bindevent(table);
|
|
|
+
|
|
|
+ $(document).on('click', '.btn-view', function () {
|
|
|
+ var ids = Table.api.selectedids(table);
|
|
|
+ var title = '成绩详情';
|
|
|
+ Fast.api.open(Fast.api.fixurl("teacher/exams/view/ids/"+ids), title, { area: ["60%", "95%"] });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ persent: function () {
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ index_url: 'teacher/exams/persent' + location.search,
|
|
|
+ indexed_url: 'teacher/exams/index' + location.search,
|
|
|
+ table: 'teacher_exams',
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var table = $("#table");
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'exam_id',
|
|
|
+ sortName: 'exam_id',
|
|
|
+ toolbar: '#toolbar',
|
|
|
+ fixedColumns: true,
|
|
|
+ fixedRightNumber: 1,
|
|
|
+ searchFormVisible:false,
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ // {checkbox: true},
|
|
|
+ {field: '', title: __('更换件')},
|
|
|
+ {field: '', title: __('学员姓名')},
|
|
|
+ {field: '', title: __('状态')},
|
|
|
+ {field: 'endtime', title: __('申请时间'), formatter: Table.api.formatter.datetime, operate: false, addclass: 'datetimerange', sortable: true},
|
|
|
+ {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=\'["55%","95%"]\'',
|
|
|
+ // url: 'teacher/exams/edit',
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ });
|
|
|
+
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var table1 = $("#table1");
|
|
|
+ // 初始化表格
|
|
|
+ table1.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.indexed_url,
|
|
|
+ pk: 'exam_id',
|
|
|
+ sortName: 'exam_id',
|
|
|
+ toolbar: '#toolbar1',
|
|
|
+ fixedColumns: true,
|
|
|
+ fixedRightNumber: 1,
|
|
|
+ searchFormVisible:false,
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ // {checkbox: true},
|
|
|
+ {field: '', title: __('座号')},
|
|
|
+ {field: '', title: __('模拟器状态')},
|
|
|
+ {field: '', title: __('学员学号')},
|
|
|
+ {field: '', title: __('学员姓名')},
|
|
|
+ {field: '', title: __('考试状态')},
|
|
|
+ {field: '', title: __('考试成绩')},
|
|
|
+ {field: '', title: __('故障现象')},
|
|
|
+ {field: '', title: __('故障部位')},
|
|
|
+ {field: '', title: __('排除方法')},
|
|
|
+ {field: 'operate', title: __('Operate'), table: table1,
|
|
|
+ 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=\'["55%","95%"]\'',
|
|
|
+ // url: 'teacher/exams/edit',
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ });
|
|
|
+
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table1);
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
add: function () {
|
|
|
Controller.api.bindevent();
|