Explorar el Código

20250423 朱教员意见汇总修改

贾小兵 hace 5 días
padre
commit
9936e4adac

+ 11 - 1
application/admin/controller/teacher/Collection.php

@@ -29,7 +29,7 @@ class Collection extends Backend
     protected $exam_model = null;
     protected $whereExtend = null;
 
-    protected $noNeedRight = ['adduser','edituser', 'viewuser'];
+    protected $noNeedRight = ['adduser','edituser', 'viewuser','selectpage'];
 
     public function _initialize()
     {
@@ -507,5 +507,15 @@ class Collection extends Backend
         return $arr;
     }
 
+    /**
+     * Selectpage搜索
+     *
+     * @internal
+     */
+    public function selectpage()
+    {
+        return parent::selectpage();
+    }
+
 
 }

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

@@ -62,11 +62,26 @@ class Exams extends Backend
         if ($this->request->request('keyField')) {
             return $this->selectpage();
         }
+        //查询最后一场考试id
+        $exam_collection_id = $this->model->where($this->whereExtend)->order('exam_id desc')->value('exam_collection_id');
+        //查询考试
+        $filter = $this->request->get("filter", '');
+        $filter = (array)json_decode($filter, true);
+        $op = $this->request->get("op", '');
+        $op = (array)json_decode($op, true);
+
+       if(isset($filter) &&!empty($filter['exam_collection_name'])){
+           unset($this->whereExtend['exam_collection_id']);
+           $this->request->get(['filter'=>json_encode($filter),'op'=>json_encode($op)]);
+       }else{
+           $this->whereExtend['exam_collection_id'] = $exam_collection_id;
+       }
         [$where, $sort, $order, $offset, $limit] = $this->buildparams();
         $list = $this->model
             ->where($where)->where($this->whereExtend)
             ->order($sort, $order)
             ->paginate($limit);
+
         //最高分 最低分 平均分
         $select = $this->model->where($where)->where($this->whereExtend)->field('count(*) as count,sum(total_score) as totalscore,min(total_score) as min,max(total_score) as max')->select();
         $pingfen  = '';

+ 6 - 1
application/admin/view/teacher/exams/index.html

@@ -1,4 +1,9 @@
-
+<style>
+    .commonsearch-table{
+        background: #ffeded;
+        padding-top:5px
+    }
+</style>
 <div class="panel panel-default panel-intro">
     {:build_heading()}
     <div class="panel-body">

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
public/assets/css/backend.min.css


+ 3 - 2
public/assets/css/skins/skin-black-blue.css

@@ -13,7 +13,8 @@
 }
 .skin-black-blue .main-header .navbar .nav > li > a {
   /*color: #666;*/
-  color: #ffffff;
+  /*color: #ffffff;*/
+  color: #f39c12;
 }
 .skin-black-blue .main-header .navbar .nav > li > a:hover,
 .skin-black-blue .main-header .navbar .nav > li > a:active,
@@ -24,7 +25,7 @@
 .skin-black-blue .main-header .navbar .nav > .active > a {
   background: rgba(0, 0, 0, 0.02);
   /*color: #333;*/
-  color: #ffffff;
+  color: #bffba8;
 }
 .skin-black-blue .main-header .navbar .nav-addtabs li > .close-tab {
   /*color: #333;*/

+ 9 - 2
public/assets/js/backend/teacher/exams.js

@@ -68,6 +68,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                 }
             });
 
+            //在普通搜索渲染后
+            table.on('post-common-search.bs.table', function (event, table) {
+                var form = $("form", table.$commonsearch);
+                $("input[name='exam_collection_name']", form).addClass("selectpage").data("source", "teacher/collection/selectpage").data('params',{'custom[exam_collection_type]':3}).data("primaryKey", "exam_collection_name").data("field", "exam_collection_name").data("orderBy", "exam_collection_id asc");
+                Form.events.cxselect(form);
+                Form.events.selectpage(form);
+            });
 
             // 初始化表格
             table.bootstrapTable({
@@ -113,8 +120,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                         {field: 'total_score', title: __('Total_score'),operate:false},
                         {field: 'exam_duration', title: __('考试时长(秒)'),operate: "between",visible:false},
                         {field: 'exam_duration_text', title: __('考试时长'),operate: false},
-                        {field: 'starttime', title: __('开始考试时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'endtime', title: __('交卷时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'starttime', title: __('开始考试时间'), formatter: Table.api.formatter.datetime,datetimeFormat: 'HH:mm:ss', operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'endtime', title: __('交卷时间'), formatter: Table.api.formatter.datetime, datetimeFormat: 'HH:mm:ss', operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         // {field: 'endtime', title: __('End_time'), formatter: Table.api.formatter.datetime, operate: false, 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},

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio