diff --git a/admin-core/src/main/resources/static/js/common.js b/admin-core/src/main/resources/static/js/common.js index a6485fbc..5d52d627 100644 --- a/admin-core/src/main/resources/static/js/common.js +++ b/admin-core/src/main/resources/static/js/common.js @@ -342,8 +342,24 @@ var Common = { } }, - getNowDate: function (date, pattern) {//获取当前时间 - var d = new Date(); + getNowDate: function (day) {//获取当前时间 + // 获取当前时间 + let curDate = (new Date()).getTime(); + // 将换算时间单位换算成毫秒 + let changeDay = day * 24 * 3600 * 1000; + let pastResult = curDate + changeDay; // 换算的时间(毫秒单位) + + // 日期函数,定义起点为半年前 + let pastDate = new Date(pastResult), + pastYear = pastDate.getFullYear(), + pastMonth = pastDate.getMonth() + 1, + pastDay = pastDate.getDate(); + if(pastMonth<10) pastMonth="0"+pastMonth; + + if(pastDay<10) pastDay="0"+pastDay; + let time = pastYear + '-' + pastMonth + '-' + pastDay; + return time; + /*var d = new Date(); var year = d.getFullYear(); //获取年 @@ -373,9 +389,10 @@ var Common = { var Tools = document.getElementById("Main"); - var da = year + "-" +month+ "-" + days + " " + "00:00:00"; + var da = year + "-" +month+ "-" + days;*/ + //var da = year + "-" +month+ "-" + days + " " + "00:00:00"; //var da=year+" 年 "+month+" 月 "+days+" 日 "+week[day]+" "+hour+" : "+minute+" :"+second - return da; + //return da; }, /** * ajax初始化 diff --git a/web/src/main/java/com/ibeetl/jlw/web/HandsOnSimulationTasksController.java b/web/src/main/java/com/ibeetl/jlw/web/HandsOnSimulationTasksController.java index bf42649f..f2e9e121 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/HandsOnSimulationTasksController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/HandsOnSimulationTasksController.java @@ -99,7 +99,7 @@ public class HandsOnSimulationTasksController{ @GetMapping(MODEL + "/add.do") @Function("handsOnSimulationTasks.add") - public ModelAndView add(Long taskId, Long handsOnId) { + public ModelAndView add(Long taskId, Long handsOnId,Long courseInfoId) { ModelAndView view = new ModelAndView("/jlw/handsOnSimulationTasks/add.html"); if(null != taskId){ HandsOnSimulationTasks handsOnSimulationTasks = handsOnSimulationTasksService.queryById(taskId); @@ -110,6 +110,7 @@ public class HandsOnSimulationTasksController{ handsOnSimulationTasks.setHandsOnId(handsOnId); view.addObject("handsOnSimulationTasks", handsOnSimulationTasks); } + view.addObject("courseInfoId", courseInfoId); return view; } diff --git a/web/src/main/resources/application-local.properties b/web/src/main/resources/application-local.properties index 1c1a307a..69f56020 100644 --- a/web/src/main/resources/application-local.properties +++ b/web/src/main/resources/application-local.properties @@ -24,7 +24,7 @@ spring.datasource.dynamic.hikari.connection-test-query=SELECT 1 spring.datasource.dynamic.datasource.master.driverClassName=com.mysql.cj.jdbc.Driver spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:3306/tzcj?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true spring.datasource.dynamic.datasource.master.username=root -spring.datasource.dynamic.datasource.master.password=root +spring.datasource.dynamic.datasource.master.password=shuchuang123@. spring.datasource.dynamic.datasource.master.hikari.max-lifetime=60000 # ds2 diff --git a/web/src/main/resources/static/js/jlw/handsOn/add.js b/web/src/main/resources/static/js/jlw/handsOn/add.js index 39de9274..783d2853 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/add.js +++ b/web/src/main/resources/static/js/jlw/handsOn/add.js @@ -13,6 +13,7 @@ layui.define(['form', 'laydate', 'table','upload','layedit', 'handsOnApi'], func } }); var handsOnId = $("input[name='handsOnId']").val(); + var courseInfoId_ = $("input[name='courseInfoId_']").val(); if(!$.isEmpty(handsOnId)){ var ret = Common.getAjax("/jlw/handsOn/view.json",{handsOnId:handsOnId}); if(ret.code == 0){ @@ -153,7 +154,7 @@ layui.define(['form', 'laydate', 'table','upload','layedit', 'handsOnApi'], func $("#addForm input[name='handsOnId']").val(handsOnId) } } - var url = "/jlw/handsOnSimulationTasks/add.do?handsOnId="+handsOnId; + var url = "/jlw/handsOnSimulationTasks/add.do?handsOnId="+handsOnId+'&courseInfoId='+courseInfoId_; Common.openDlg(url,"实训任务管理>新增"); }); //实训任务编辑 diff --git a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js index 51ab85fc..176f93f0 100644 --- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js @@ -1,11 +1,20 @@ -layui.define([ 'form', 'laydate', 'table','element','handsOnSimulationTasksApi', 'upload', 'layedit'], function(exports) { +layui.define([ 'form', 'laydate', 'table','element','handsOnSimulationTasksApi', 'upload', 'layedit','layer','table'], function(exports) { var form = layui.form; var handsOnSimulationTasksApi = layui.handsOnSimulationTasksApi; var index = layui.index; var element = layui.element, upload = layui.upload, layedit = layui.layedit element.render(); + var layer = layui.layer; + var table = layui.table; var one = layedit.build('test-editor1'); //建立编辑器 var editor = null; + var resourcesQuestionTable =null; + var resourcesQuestionTable1 = null; + var selectResourcesQuestion = []; + var resourcesQuestionIds = ""; //选中题目id + + var courseInfoIds = $("input[name=courseInfoId_1]").val(); + // setTimeout(function (){ // editor.init(); // // $("#test-editor .editormd-preview").width("50%"); @@ -119,6 +128,142 @@ layui.define([ 'form', 'laydate', 'table','element','handsOnSimulationTasksApi', }); } }); + + $('#manualProblemSetting1').click(function () {//手动出题 + layer.open({ + type: 1 + , title: '选择题库' + ,fixed:false//固定页面后,弹出框随着滚动 + , shadeClose: true + , scrollbar: true//滚动条 + , content: $("#resourcesQuestionTable_demo") + , btn: ['保存','关闭'] + ,success:function () { + resourcesQuestionTable(); + Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds); + } + , yes: function (index, layero) { + layer.close(index); + $('#resourcesQuestionTable_demo').hide(); + } + , btn2: function (index, layero) { + layer.close(index); + $('#resourcesQuestionTable_demo').hide(); + } + }); + }); +///jlw/teacherOpenCourseHandsOnSimulationTasks/getObjectiveProblem.do?problemIds= + var btn = $("#searchFormQuestion"); + btn.on('click', function () { + resourcesQuestionTable1.reload({ + where: { + 'courseInfoParentId':courseInfoIds, + 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), + "questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").val(), + 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val() + }, + }); + }); + table.on('checkbox(resourcesQuestionTable)', function(obj){ //test 是 table 标签对应的 lay-filter 属性 + if (obj.checked) { //选中 + if (obj.type == "all") {//全选 + var checkStatus = table.checkStatus('resourcesQuestionTable').data; + for (var i = 0; i < checkStatus.length; i++) { + if (("," + resourcesQuestionIds + ",").indexOf(checkStatus[i].resourcesQuestionId) < 0) { + if (!$.isEmpty(resourcesQuestionIds)) { + resourcesQuestionIds += "," + checkStatus[i].resourcesQuestionId; + } else { + resourcesQuestionIds = checkStatus[i].resourcesQuestionId; + } + } + } + } else { + if (!$.isEmpty(resourcesQuestionIds)) { + resourcesQuestionIds += "," + obj.data.resourcesQuestionId; + } else { + resourcesQuestionIds = obj.data.resourcesQuestionId; + } + } + } else {//取消全选 + if (obj.type == "all") {//全选 + var checkStatus = table.cache["resourcesQuestionTable"]; + for (var i = 0; i < checkStatus.length; i++) { + resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, checkStatus[i].resourcesQuestionId); + } + } else { + resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, obj.data.resourcesQuestionId); + } + } + + $("#countQ").html(resourcesQuestionIds.split(',').length) + }); + $("#del").click(function () {//清除已选 + resourcesQuestionIds = []; + $("#countQ").html(0); + var param = { + 'courseInfoParentId':courseInfoIds, + 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), + "questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").val(), + 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val() + }; + resourcesQuestionTable1.reload({ + where: param, + page: { + curr: 1 + } + }); + }); + resourcesQuestionTable= function(){ + resourcesQuestionTable1=table.render({ + elem: '#resourcesQuestionTable', + cellMinWidth: 100, + method: 'post', + even: true, + size: "sms", + url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口 + , page: Lib.tablePage // 开启分页 + , limit: 4 + , where: {"courseInfoParentId": courseInfoIds} + ,cols: [[ // 表头 + { + type: 'checkbox', align: "center" + }, + { + field: 'questionStem', width: 320, + title: '题干', align: "center" + }, + { + field: 'questionType', align: "center", width: 80, + title: '题型', templet: function (d) {//(1单选 2多选 3判断 4填空 5分析) + return d.questionType == 1 ? '单选' : d.questionType == 2 ? '多选' : d.questionType == 3 ? '判断' : '-'; + } + }, + { + field: 'courseInfoParentName', + title: '归属课程', align: "center" + }, + { + field: 'courseInfoName', + title: '归属章节', align: "center" + } + ]],done: function(res, curr, count){ + //循环所有数据,找出对应关系,设置checkbox选中状态 + for (var i = 0; i < res.data.length; i++) { + for (var j = 0; j < resourcesQuestionIds.split(',').length; j++) { + if (res.data[i].resourcesQuestionId == resourcesQuestionIds.split(',')[j]) { + //这里才是真正的有效勾选 + res.data[i]["LAY_CHECKED"] = 'true'; + //找到对应数据改变勾选样式,呈现出选中效果 + var index = res.data[i]['LAY_TABLE_INDEX']; + $('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true); + $('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked'); + } + } + } + } + + }); + } var view = { init:function(){ Lib.initGenrealForm($("#addForm"),form); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseChatLog/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseChatLog/index.js index d4dcce20..cd5f2578 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseChatLog/index.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseChatLog/index.js @@ -175,7 +175,6 @@ layui.define([ 'form', 'laydate', 'table','laytpl' ], function(exports) { }); }); } else if (obj.event === "details") { - console.log(data) if(data.chatLogSendType =='normal'){ var url = "/jlw/teacherOpenCourseChatLog/indexInfoNor.do?teacherOpenCourseId="+teacherOpenCourseId; Common.openDlg(url,"讨论详情"); diff --git a/web/src/main/resources/static/js/jlw/universitiesColleges/add.js b/web/src/main/resources/static/js/jlw/universitiesColleges/add.js index 26612b17..cd43d1ac 100644 --- a/web/src/main/resources/static/js/jlw/universitiesColleges/add.js +++ b/web/src/main/resources/static/js/jlw/universitiesColleges/add.js @@ -16,6 +16,7 @@ layui.define([ 'form', 'laydate', 'table','universitiesCollegesApi'], function(e $("#addButton").click(function(){ form.on('submit(form)', function(){ var universitiesCollegesId = $("input[name='universitiesCollegesId']").val(); + if($.isEmpty(universitiesCollegesId)){ universitiesCollegesApi.addUniversitiesColleges($('#addForm'),function(){ Common.info("添加成功"); diff --git a/web/src/main/resources/templates/jlw/handsOn/add.html b/web/src/main/resources/templates/jlw/handsOn/add.html index 712085f6..4e433fe0 100644 --- a/web/src/main/resources/templates/jlw/handsOn/add.html +++ b/web/src/main/resources/templates/jlw/handsOn/add.html @@ -213,6 +213,7 @@ + diff --git a/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html b/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html index f8aad7d4..466f1c49 100644 --- a/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html +++ b/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html @@ -10,6 +10,22 @@ background: #e9e9e9; padding: 14px; } + + #first label { + width: 70px; + } + + #first .layui-input-block { + margin-left: 100px; + } + + #second label { + width: 42px; + } + + #second .layui-input-block { + margin-left: 72px; + }
- +
- +
@@ -444,7 +462,40 @@
+ + + +