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 @@ +
+
+ +
+ +
+
+ +
+ +