|
@@ -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 () {
|