浏览代码

20250311 修正优化代码

贾小兵 2 月之前
父节点
当前提交
8b332716b7

+ 0 - 1
application/admin/controller/department/Index.php

@@ -64,7 +64,6 @@ class Index extends Backend
             } else {
                 $list = $this->departmentList;
             }
-
             $list = array_values($list);
 
 

+ 15 - 0
application/admin/controller/teacher/Task.php

@@ -23,6 +23,7 @@ class Task extends Backend
      */
     protected $model = null;
 
+    protected $noNeedLogin = ['selectlist'];
     public function _initialize()
     {
         parent::_initialize();
@@ -169,4 +170,18 @@ class Task extends Backend
 
     //删除的时候,同步删除好几个表
 
+    /**
+     * 全部3个故障内容的训练任务
+     * @return void
+     */
+    public function selectlist()
+    {
+        $where = [];
+        $where['fault_total'] = 3;
+        $res = $this->model->where($where)->select();
+        foreach ($res as $kk=> $vv) {
+            $options[$vv['task_id']] = $vv['name'];
+        }
+        return json($options);
+    }
 }

+ 1 - 1
extend/fast/Tree.php

@@ -26,7 +26,7 @@ class Tree
      * @var array
      */
     public $icon = array('│', '├', '└');
-    public $nbsp = " ";
+    public $nbsp = " ";//" ";
     public $pidname = 'pid';
 
     public function __construct($options = [])

+ 22 - 10
public/assets/js/backend/teacher/exams.js

@@ -26,10 +26,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                 $(".min_total").text(data.defen.min);
 
                 var task_tr = '';
-                console.log(data.tongji.one_static.length+'###')
+                // console.log(data.tongji.one_static.length+'###')
                 for (i=0;i<data.tongji.one_static.length;++i){
                     var one_data = data.tongji.one_static[i];
-                    console.log(one_data+[i]);
+                    // console.log(one_data+[i]);
                     var epercent = '';
                     if(one_data.epercent!='undefined' && one_data.epercent != undefined){
                         epercent = one_data.epercent;
@@ -87,15 +87,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                         // {field: 'exam_status', title: __('Exam_status'),searchList: {"0":"未登录","1":"已登录","2":"模拟器检查并下发故障中","3":"模拟器正常","4":"答题中","5":"已交卷","6":"计算成绩中","7":"获取到成绩报告","80":"教师标记缺考","81":"登录未开始答题","90":"模拟器异常结束"},formatter: Table.api.formatter.simexamstatus},
                         {field: 'exam_collection_name', title: __('考试名称'),operate: 'like'},
                         {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
-                        // {
-                        //     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: 'user_depart_id',
+                            title: __('区队'),
+                            visible: false,
+                            addclass: 'selectpage',
+                            extend: 'data-source="department/index/index" data-field="name"',
+                            operate: Config.groupIds !=8 ? 'in':false,
+                            formatter:function (value, row, index) {
+                                console.log(value+'#@#@#')
+                                return value.toString().replace(/(&|&amp;)nbsp;/g, '&nbsp;');
+                            }
+                            // formatter: Table.api.formatter.search
+                        },
+                        // {field: 'name', title: __('Name'), align: 'left', formatter:function (value, row, index) {
+                        //         return value.toString().replace(/(&|&amp;)nbsp;/g, '&nbsp;');
+                        //     }
                         // },
+                        {field: 'task_id', title: __('训练任务'),visible:false,
+                            operate:'=',
+                            searchList: $.getJSON("teacher/task/selectlist")
+                        },
                         {field: 'total_score', title: __('Total_score'),operate:false},
                         // {field: 'deduction_total_score', title: __('Deduction_total_score')},
                         {field: 'starttime', title: __('开始考试时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},