From a7e564a4044b0a0190369949032466d1dad1694f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com>
Date: Wed, 7 Dec 2022 01:08:44 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E9=A2=98=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../js/jlw/generalQuestionSetting/add.js | 60 ++++++++++++-------
.../jlw/generalQuestionSetting/add.html | 46 ++++++++++++++
2 files changed, 86 insertions(+), 20 deletions(-)
diff --git a/web/src/main/resources/static/js/jlw/generalQuestionSetting/add.js b/web/src/main/resources/static/js/jlw/generalQuestionSetting/add.js
index 78d9afff..04be8ff3 100644
--- a/web/src/main/resources/static/js/jlw/generalQuestionSetting/add.js
+++ b/web/src/main/resources/static/js/jlw/generalQuestionSetting/add.js
@@ -10,6 +10,7 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
var classData = Common.getAjax('/jlw/schoolClass/getValues.json').data;//上课班级多选框data
var xmSeValue = $("#generalQuestionSettingSchoolClassIds").data('value');
+ var courseInfoIds = '';
var xmSeInitValue = [];
if(!$.isEmpty(xmSeValue)){
@@ -53,20 +54,32 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
});
$('#manualProblemSetting').click(function () {//手动出题
+ courseInfoIds = $("#courseInfoIds").find("option:selected").val();
+ if ($.isEmpty(courseInfoIds)) {
+ Common.info("请选择需要设置的课程");
+ return;
+ }
layer.open({
- type: 1,
- title: '在线调试'
+ type: 1
+ , title: '选择题库'
,offset: ['100px', '150px']
- ,content: '
'
+ , shadeClose: true
+ , scrollbar: false
+ , content: $("#resourcesQuestionTable_demo")
, btn: ['保存', '关闭']
,success:function () {
resourcesQuestionTable();
}
- ,yes:function () {
-
+ , yes: function (index, layero) {
+ layer.close(index);
+ $('#resourcesQuestionTable_demo').hide();
+ }
+ , btn2: function (index, layero) {
+ $('#resourcesQuestionTable_demo').hide();
+ layer.close(index);
}
- ,btn2:function () {
-
+ , end: function () {
+ $('#resourcesQuestionTable_demo').hide();
}
});
});
@@ -76,6 +89,7 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
var view = {
init:function(){
this.initTable();
+ this.initSearchForm();
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
@@ -84,8 +98,9 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
elem: '#questionTypeGroupInfoTable',
cellMinWidth: 100,
method: 'post',
- url: Common.ctxPath + '/jlw/resourcesQuestion/questionTypeGroupInfo.json?courseInfoId=1232' // 数据接口
- //, page: Lib.tablePage // 开启分页
+ url: Common.ctxPath + '/jlw/resourcesQuestion/questionTypeGroupInfo.json' // 数据接口
+ , limit: Number.MAX_VALUE
+ , page: false
/*,toolbar: '#toolbar_generalQuestionSetting' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
//, limit: 10,
@@ -103,9 +118,6 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
field: 'totalCount',
title: '总数量',
align: "center",
- temple:function (d) {
- console.log(d)
- }
},
{
field: 'questionNum',
@@ -137,7 +149,8 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
size: "sms",
url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口
, page: Lib.tablePage // 开启分页
- , limit: 4,
+ , limit: 4
+ , where: {"courseInfoId": courseInfoIds},
cols: [[ // 表头
{
type: 'checkbox', align: "center"
@@ -159,19 +172,26 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
{
field: 'courseInfoName',
title: '归属章节', align: "center"
- },
- {
- field: 'userId', title: '操作', align: "center", width: 220, templet: function (d) {
- // TODO 上下架前端逻辑待开发
- return '查看';
- }
}
-
]]
});
}
},
+ initSearchForm: function () {
+ /*var btn = $("#searchForm");
+ btn.on('click', function () {
+ questionTypeGroupInfoTable.reload({
+ where: {"courseId":$("#courseInfoIds").find("option:selected").val()},
+ });
+ });*/
+ form.on('select(select_courseInfoIds)', function (data) {
+ courseInfoIds = data.value;
+ questionTypeGroupInfoTable.reload({
+ where: {"courseId": data.value},
+ });
+ });
+ },
initSubmit:function(){
$("#addButton").click(function(){
form.on('submit(form)', function(){
diff --git a/web/src/main/resources/templates/jlw/generalQuestionSetting/add.html b/web/src/main/resources/templates/jlw/generalQuestionSetting/add.html
index 4a387253..2b0df673 100644
--- a/web/src/main/resources/templates/jlw/generalQuestionSetting/add.html
+++ b/web/src/main/resources/templates/jlw/generalQuestionSetting/add.html
@@ -93,10 +93,25 @@
+
+
+