Browse Source

考试下拉部门选人,完成

lizhen_gitee 7 months ago
parent
commit
fa7348d06f

+ 1 - 0
application/admin/lang/zh-cn/exam/paper.php

@@ -22,4 +22,5 @@ return [
     'End_time'        => '使用结束时间',
     'Is_only_room'    => '仅用于考场',
     'Limit_count'     => '每人限制考试次数',
+    'User_ids'        => '可参与人员',
 ];

+ 46 - 41
public/assets/js/backend/exam/paper.js

@@ -235,7 +235,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             Controller.api.bindTime()
         },
         selectuser: function () {
-            Controller.api.bindevent();
+            Controller.apisu.bindevent();
         },
         nograde: function () {
             Controller.api.bindevent()
@@ -247,46 +247,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             Controller.api.renderCountScore()
             Controller.api.bindTime()
         },
-        api: {
-            bindevent: function () {
-                Form.api.bindevent($("form[role=form]"), function () {
-                }, function () {
-                }, function () {
-                    let mode = $('input[name="row[mode]"]:checked').val()
-                    console.log('submit mode', mode)
-                    if (mode === 'FIX') {
-                        $('#valid').click()
-                        return valid_result;
-                    } else {
-                        let configs = $('#c-configs').val()
-                        console.log('configs', configs)
-                        if (!configs) {
-                            Layer.alert('请配置试卷出题规则')
-                            return false
-                        }
-
-                        let quantity = $('.span_quantity').text()
-                        if (quantity !== $('#c-quantity').val()) {
-                            Layer.alert('试卷出题规则的选取题数与试卷题目数量不一致')
-                            return false
-                        }
-
-                        let total_score = $('.span_total_score').text()
-                        if (total_score !== $('#c-total_score').val()) {
-                            Layer.alert('试卷出题规则的总分与试卷总分不一致')
-                            return false
-                        }
-
-                        let limit_time_hour = $('#c-limit_time_hour').val()
-                        let limit_time_minute = $('#c-limit_time_minute').val()
-                        let limit_time = (limit_time_hour ? limit_time_hour : 0) * 3600 + (limit_time_minute ? limit_time_minute : 0) * 60
-                        $('#c-limit_time').val(limit_time)
-                    }
-
-                    return true
-                });
-            },
 
+        apisu: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"), null, null, function () {
                     if ($("#treeview").length > 0) {
@@ -298,7 +260,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
                 //渲染权限节点树
                 //销毁已有的节点树
                 $("#treeview").jstree("destroy");
-                Controller.api.rendertree(nodeData);
+                Controller.apisu.rendertree(nodeData);
                 //全选和展开
                 $(document).on("click", "#checkall", function () {
                     $("#treeview").jstree($(this).prop("checked") ? "check_all" : "uncheck_all");
@@ -337,6 +299,49 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
                         }
                     });
             },
+        },
+
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"), function () {
+                }, function () {
+                }, function () {
+                    let mode = $('input[name="row[mode]"]:checked').val()
+                    console.log('submit mode', mode)
+                    if (mode === 'FIX') {
+                        $('#valid').click()
+                        return valid_result;
+                    } else {
+                        let configs = $('#c-configs').val()
+                        console.log('configs', configs)
+                        if (!configs) {
+                            Layer.alert('请配置试卷出题规则')
+                            return false
+                        }
+
+                        let quantity = $('.span_quantity').text()
+                        if (quantity !== $('#c-quantity').val()) {
+                            Layer.alert('试卷出题规则的选取题数与试卷题目数量不一致')
+                            return false
+                        }
+
+                        let total_score = $('.span_total_score').text()
+                        if (total_score !== $('#c-total_score').val()) {
+                            Layer.alert('试卷出题规则的总分与试卷总分不一致')
+                            return false
+                        }
+
+                        let limit_time_hour = $('#c-limit_time_hour').val()
+                        let limit_time_minute = $('#c-limit_time_minute').val()
+                        let limit_time = (limit_time_hour ? limit_time_hour : 0) * 3600 + (limit_time_minute ? limit_time_minute : 0) * 60
+                        $('#c-limit_time').val(limit_time)
+                    }
+
+                    return true
+                });
+            },
+
+
 
             // 选题模式设置
             bindConfigs: function () {

+ 7 - 4
public/assets/js/backend/trainactive.js

@@ -195,7 +195,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             Controller.api.bindevent();
         },
         selectuser: function () {
-            Controller.api.bindevent();
+            Controller.apisu.bindevent();
         },
         qrcode: function () {
             Controller.api.bindevent();
@@ -207,9 +207,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             Controller.api.bindevent();
         },
         api: {
-            /*bindevent: function () {
+            bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));
-            }*/
+            }
+        },
+        apisu: {
+
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"), null, null, function () {
                     if ($("#treeview").length > 0) {
@@ -221,7 +224,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
                 //渲染权限节点树
                 //销毁已有的节点树
                 $("#treeview").jstree("destroy");
-                Controller.api.rendertree(nodeData);
+                Controller.apisu.rendertree(nodeData);
                 //全选和展开
                 $(document).on("click", "#checkall", function () {
                     $("#treeview").jstree($(this).prop("checked") ? "check_all" : "uncheck_all");