From c6131c400df3b61b1ac5017ac667b31fc95b6009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Wed, 1 Feb 2023 12:05:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/jlw/teacherOpenCourseChatLog/index.js | 1 - .../indexInfoNor.html | 3 ++- .../indexInfoSpe.html | 26 ++++++------------- .../indexInfoStu.html | 7 ++--- .../jlw/universitiesColleges/add.html | 10 +++---- 5 files changed, 19 insertions(+), 28 deletions(-) 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/templates/jlw/teacherOpenCourseChatLog/indexInfoNor.html b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoNor.html index cc2c7f75..75f59bf5 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoNor.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoNor.html @@ -153,6 +153,7 @@ param.chatContent = '

'+$("#chatContentNew").val()+'

'; var url = '/api/teacherOpenCourseChatLog/add.do'; var ret = Common.postJSON(url,JSON.stringify(param)); + console.log(ret,'dd') layer.msg(ret.code == 0 ? "成功回复!" : ret.msg, { offset: ['50%'], icon: ret.code == 0 ? 1 : 2, @@ -209,7 +210,7 @@ '
' + (!$.isEmpty(data.children[j].studentIdText) ? data.children[j].studentIdText : '') + '
' + ' ' + '
' + (!$.isEmpty(data.children[j].chatContent) ? data.children[j].chatContent : '') + - '
' + + '
' + '
' + (!$.isEmpty(data.children[j].teacherOpenCourseChatLogAddTime) ? data.children[j].teacherOpenCourseChatLogAddTime : '') + '
' + '
' + ' 回复' + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoSpe.html b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoSpe.html index 2cd119d2..780ea119 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoSpe.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoSpe.html @@ -72,35 +72,25 @@ cols: [[ {type:'numbers',title:'序号'}, { - field: 'code', title: '提问时间', align: "center" + field: 'teacherOpenCourseChatLogAddTime', title: '提问时间', align: "center" }, { - field: 'name', title: '提问学生', align: "center" + field: 'studentIdText', title: '提问学生', align: "center" }, { - field: 'name', title: '提问方式', align: "center" + field: 'chatLogSendTypeText', title: '提问方式', align: "center" }, { - field: 'code', title: '用户编号', align: "center", - hide: "${isSignRole.get()!''}" != 2 ? false : true + field: 'schoolClassIdsText', title: '所属班级', align: "center" }, { - field: 'universitiesCollegesName', title: '所属院校', align: "center", - hide: "${isSignRole.get()!''}" != 2 ? false : true + field: 'chatContent', title: '提问内容', align: "center",width:'30%' }, { - field: 'universitiesCollegesProvince', title: '所属省份', align: "center", - hide: "${isSignRole.get()!''}" != 2 ? false: true, - }, - { - field: 'className', title: '所属班级', align: "center" - }, - { - field: 'platform', title: '提问内容', align: "center", - }, - { - field: 'loginTime', title: '学生回答', align: "center", + field: 'universitiesCollegesContactsEmail', title: '学生回答', align: "center", }, + /* header.put("chatContent", "提问内容"); + header.put("universitiesCollegesContactsEmail", "学生回答");*/ { field: 'logoutTime', title: '登记得分', align: "center", } diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoStu.html b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoStu.html index f2aa896a..52ee04a3 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoStu.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseChatLog/indexInfoStu.html @@ -106,12 +106,13 @@ layui.use(['form','laydate','table','laytpl'], function(){ cols : [ [ // 表头 {type:'numbers',title:'序号'}, { - field: 'studentName', + field: 'studentIdText', title: '姓名', align: "center", hideField: false, templet:function (d) { - var htm ='
'+d.studentName+'
'; + var htm = + '
'+d.studentIdText+'
'; return htm; } }, @@ -215,7 +216,7 @@ layui.use(['form','laydate','table','laytpl'], function(){ }else if(obj.event === "look"){ layer.open({ title: '回复消息' - ,content: data.questionScore + ,content: data.chatContent }); } }) diff --git a/web/src/main/resources/templates/jlw/universitiesColleges/add.html b/web/src/main/resources/templates/jlw/universitiesColleges/add.html index e639cc8e..c7ab83e0 100644 --- a/web/src/main/resources/templates/jlw/universitiesColleges/add.html +++ b/web/src/main/resources/templates/jlw/universitiesColleges/add.html @@ -11,13 +11,13 @@
- +
- @@ -50,7 +50,7 @@
- +
@@ -98,7 +98,7 @@
- +
@@ -108,7 +108,7 @@
- +
From 16a3f87fe9eb86765e5f4b8111312bff94ec8215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Wed, 1 Feb 2023 13:32:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/jlw/universitiesColleges/add.js | 1 + .../templates/jlw/schoolClass/add.html | 17 ++++++++++------- .../resources/templates/jlw/student/add.html | 10 ++++++---- .../resources/templates/jlw/teacher/add.html | 10 +++++----- .../templates/jlw/universitiesColleges/add.html | 4 ++-- 5 files changed, 24 insertions(+), 18 deletions(-) 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/schoolClass/add.html b/web/src/main/resources/templates/jlw/schoolClass/add.html index 75e3195e..38d30015 100644 --- a/web/src/main/resources/templates/jlw/schoolClass/add.html +++ b/web/src/main/resources/templates/jlw/schoolClass/add.html @@ -24,8 +24,9 @@
- +
@@ -33,10 +34,11 @@
+
+ id="universitySystemId" name="universitySystemId" lay-verify="required"/>
@@ -48,8 +50,9 @@
- +
@@ -59,7 +62,7 @@
- +
@@ -70,7 +73,7 @@
- +
diff --git a/web/src/main/resources/templates/jlw/student/add.html b/web/src/main/resources/templates/jlw/student/add.html index e129c8d5..2273128e 100644 --- a/web/src/main/resources/templates/jlw/student/add.html +++ b/web/src/main/resources/templates/jlw/student/add.html @@ -13,6 +13,7 @@
@@ -25,7 +26,8 @@
+ id="universitySystemId" name="universitySystemId" layFilter="select_universitySystemId" + lay-verify="required"/>
@@ -39,7 +41,7 @@
@@ -66,7 +68,7 @@
- +
@@ -76,7 +78,7 @@
- +
diff --git a/web/src/main/resources/templates/jlw/teacher/add.html b/web/src/main/resources/templates/jlw/teacher/add.html index ef983944..4fc1cb16 100644 --- a/web/src/main/resources/templates/jlw/teacher/add.html +++ b/web/src/main/resources/templates/jlw/teacher/add.html @@ -27,7 +27,7 @@
@@ -38,7 +38,7 @@
-
@@ -54,7 +54,7 @@
@@ -93,7 +93,7 @@
- +
@@ -113,7 +113,7 @@
- +
diff --git a/web/src/main/resources/templates/jlw/universitiesColleges/add.html b/web/src/main/resources/templates/jlw/universitiesColleges/add.html index c7ab83e0..fd24ef9a 100644 --- a/web/src/main/resources/templates/jlw/universitiesColleges/add.html +++ b/web/src/main/resources/templates/jlw/universitiesColleges/add.html @@ -56,13 +56,13 @@
- +
- +
From 9fef6ca2a0cbd8cd9f55d1ac603b80c686c85dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Thu, 2 Feb 2023 01:34:41 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8C=BA=E9=97=B4=E7=BB=9F=E8=AE=A1=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/js/common.js | 25 +++++++++-- .../resources/application-local.properties | 2 +- .../jlw/teacher/statisticalReport.html | 30 ++----------- .../templates/jlw/teacher/studentLogin.html | 28 ++---------- .../jlw/teacher/studentUsageLog.html | 45 ++----------------- 5 files changed, 33 insertions(+), 97 deletions(-) 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/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/templates/jlw/teacher/statisticalReport.html b/web/src/main/resources/templates/jlw/teacher/statisticalReport.html index 3b5f9bc0..9b147197 100644 --- a/web/src/main/resources/templates/jlw/teacher/statisticalReport.html +++ b/web/src/main/resources/templates/jlw/teacher/statisticalReport.html @@ -61,34 +61,9 @@ elem: '#test5' , type: 'date' , range: '~' + , value: [Common.getNowDate(-365 / 2) +' ~ '+Common.getNowDate(1)] , trigger: 'click' }); - function getDate() { - window.setTimeout(function () { - window.requestAnimationFrame(getDate) - }, 1000 / 2); - var d = new Date(); - var year = d.getFullYear(); //获取年 - var month = d.getMonth() + 1; //获取月,从 Date 对象返回月份 (0 ~ 11),故在此处+1 - var day = d.getDay(); //获取日 - var days = d.getDate(); //获取日期 - var hour = d.getHours(); //获取小时 - var minute = d.getMinutes(); //获取分钟 - var second = d.getSeconds(); //获取秒 - if (month < 10) month = "0" + month; - if (days < 10) days = "0" + days; - if (hour < 10) hour = "0" + hour; - if (minute < 10) minute = "0" + minute; - if (second < 10) second = "0" + second; - var week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六") - var Tools = document.getElementById("Main"); - var da = year + "-" + (month - 1) + "-" + days + " " + "00:00:00"; - if(month === "01"){ - da = (year-1) + "-" +12+ "-" + days + " " + "00:00:00"; - } - //var da=year+" 年 "+month+" 月 "+days+" 日 "+week[day]+" "+hour+" : "+minute+" :"+second - return da; - } teacherTable = table.render({ elem : '#teacherTable', height : Lib.getTableHeight(), @@ -98,7 +73,8 @@ method : 'get', size:"lg", url : Common.ctxPath + '/jlw/student/studentLogAnalysisList.json' // 数据接口 - , where: {'loginStartTime': getDate(), 'loginEndTime': Common.getNowDate()} + ,where:getParam() + //, where: {'loginStartTime': getDate(), 'loginEndTime': Common.getNowDate()} ,page : Lib.tablePage // 开启分页 ,limit : 10, cols : [ [ // 表头 diff --git a/web/src/main/resources/templates/jlw/teacher/studentLogin.html b/web/src/main/resources/templates/jlw/teacher/studentLogin.html index f030e9d6..d8238f0f 100644 --- a/web/src/main/resources/templates/jlw/teacher/studentLogin.html +++ b/web/src/main/resources/templates/jlw/teacher/studentLogin.html @@ -92,36 +92,15 @@ var laydate = layui.laydate; var table = layui.table; var teacherTable = null; + laydate.render({ elem: '#test5' , type: 'date' , range: '~' + , value: [Common.getNowDate(-365 / 2) +' ~ '+Common.getNowDate(1)] , trigger: 'click' }); - function getDate() { - var d = new Date(); - var year = d.getFullYear(); //获取年 - var month = d.getMonth()+1; //获取月,从 Date 对象返回月份 (0 ~ 11),故在此处+1 - var day = d.getDay(); //获取日 - var days = d.getDate(); //获取日期 - var hour = d.getHours(); //获取小时 - var minute = d.getMinutes(); //获取分钟 - var second = d.getSeconds(); //获取秒 - if (month < 10) month = "0" + month; - if (days < 10) days = "0" + days; - if (hour < 10) hour = "0" + hour; - if (minute < 10) minute = "0" + minute; - if (second < 10) second = "0" + second; - var week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六") - var Tools = document.getElementById("Main"); - var da = year + "-" + (month - 1) + "-" + days + " " + "00:00:00"; - if(month === "01"){ - da = (year-1) + "-" +12+ "-" + days + " " + "00:00:00"; - } - //var da=year+" 年 "+month+" 月 "+days+" 日 "+week[day]+" "+hour+" : "+minute+" :"+second - return da; - } teacherTable = table.render({ elem : '#teacherTable', height : Lib.getTableHeight(), @@ -131,7 +110,8 @@ size:"lg", method : 'get', url: Common.ctxPath + '/jlw/student/studentLoginLogList.json' // 数据接口 - , where: {'loginStartTime': getDate(),'loginEndTime':Common.getNowDate()} + ,where:getParam() + //, where: {'loginStartTime': getDate(),'loginEndTime':Common.getNowDate()} // , where: {'loginTime':getDate()} ,page : Lib.tablePage // 开启分页 ,limit : 10, diff --git a/web/src/main/resources/templates/jlw/teacher/studentUsageLog.html b/web/src/main/resources/templates/jlw/teacher/studentUsageLog.html index 40cf4272..20cf5507 100644 --- a/web/src/main/resources/templates/jlw/teacher/studentUsageLog.html +++ b/web/src/main/resources/templates/jlw/teacher/studentUsageLog.html @@ -81,53 +81,15 @@ var table = layui.table; var teacherTable = null; var laydate = layui.laydate; + //日期时间选择器 laydate.render({ elem: '#test5' , type: 'date' , range: '~' + , value: [Common.getNowDate(-365 / 2) +' ~ '+Common.getNowDate(1)] , trigger: 'click' }); - - function getDate(){ - - var d=new Date(); - - var year=d.getFullYear(); //获取年 - - var month=d.getMonth()+1; //获取月,从 Date 对象返回月份 (0 ~ 11),故在此处+1 - - var day=d.getDay(); //获取日 - - var days=d.getDate(); //获取日期 - - var hour=d.getHours(); //获取小时 - - var minute=d.getMinutes(); //获取分钟 - - var second=d.getSeconds(); //获取秒 - - if(month<10) month="0"+month; - - if(days<10) days="0"+days; - - if(hour<10) hour="0"+hour; - - if(minute<10) minute="0"+minute; - - if(second<10) second="0"+second; - - var week=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六") - - var Tools=document.getElementById("Main"); - - var da=year+"-"+(month-1)+"-"+days+" " +"00:00:00"; - if(month === "01"){ - da = (year-1) + "-" +12+ "-" + days + " " + "00:00:00"; - } - //var da=year+" 年 "+month+" 月 "+days+" 日 "+week[day]+" "+hour+" : "+minute+" :"+second - return da; - } teacherTable = table.render({ elem : '#teacherTable', height : Lib.getTableHeight(), @@ -137,7 +99,8 @@ method: 'get', size:"lg", url: Common.ctxPath + '/jlw/student/studentUseLogList.json' // 数据接口 - , where: {'loginStartTime': getDate(),'loginEndTime':Common.getNowDate()} + , where: getParam() + //, where: {'loginStartTime': getDate(),'loginEndTime':Common.getNowDate()} // , where: {'loginTime':getDate()} ,page : Lib.tablePage // 开启分页 ,limit : 10, From e239a714465f7933510cfc087db6d04a1d450eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Sat, 4 Feb 2023 01:02:14 +0800 Subject: [PATCH 4/4] a --- .../web/HandsOnSimulationTasksController.java | 3 +- .../resources/static/js/jlw/handsOn/add.js | 3 +- .../js/jlw/handsOnSimulationTasks/add.js | 147 +++++++++++++++++- .../resources/templates/jlw/handsOn/add.html | 1 + .../jlw/handsOnSimulationTasks/add.html | 55 ++++++- 5 files changed, 204 insertions(+), 5 deletions(-) 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/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/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 @@
+ + + +