From 09762a0553c745725d4f15c5ae0d66e64e406a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Sat, 15 Jul 2023 21:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E6=93=8D-=E4=BF=AE?= =?UTF-8?q?=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/jlw/handsOn/index.js | 80 ++++++++++++++++--- .../js/jlw/handsOnSimulationTasks/add.js | 20 ++--- .../static/js/jlw/resourcesInfo/index.js | 17 +++- .../add.js | 11 ++- .../jlw/courseInfo/courseConfigureNew.html | 3 +- 5 files changed, 104 insertions(+), 27 deletions(-) diff --git a/web/src/main/resources/static/js/jlw/handsOn/index.js b/web/src/main/resources/static/js/jlw/handsOn/index.js index fba7fff8..8c23dfa6 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/index.js +++ b/web/src/main/resources/static/js/jlw/handsOn/index.js @@ -133,11 +133,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) { /*btnDrown.addClass("button-disabled"); btnUp.addClass("button-disabled");*/ btnDell.addClass("button-disabled"); - Common.info("禁止 '删除' 院校添加的课程实训案例"); + //Common.info("禁止 '删除' 院校添加的课程实训案例"); } if(!isAdmin&& handsOn.dataType == "ADMIN_ADD"){ btnDell.addClass("button-disabled"); - Common.info("禁止 '删除' 系统内置的课程实训案例"); + //Common.info("禁止 '删除' 系统内置的课程实训案例"); } } else { var isFalse = true; @@ -204,7 +204,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { if(isFalse && !isAdmin){ Common.openConfirm("确认要删除这些教师开课-课程实训?",function(){ var ids = Common.concatBatchId(data,"handsOnId"); - Common.post("/jlw/teacherOpenCourseHandsOn/delete.json",{"ids":ids},function(){ + Common.post("/jlw/teacherOpenCourseHandsOn/manageDelete.json",{"ids":ids},function(){ Common.info("删除成功"); dataReload(); }) @@ -213,7 +213,36 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, up: function () { var data = Common.getMoreDataFromTable(table, "handsOnTable"); - var dataType = ""; + var adminIds = ""; + var facultyIds = ""; + if(!$.isEmpty(data) || data.length > 0){ + data.forEach(function (value, index) { + if(value.dataType == "ADMIN_ADD"){ + adminIds += value.handsOnId + ","; + }else if(value.dataType == "FACULTY_ADD"){ + facultyIds += value.handsOnId + ","; + } + }); + } + Common.openConfirm("确认要上架这些教师开课-课程实训?",function(){ + if(!$.isEmpty(adminIds)){ + adminIds = adminIds.slice(0, -1); + Common.post('/jlw/handsOn/batchEdit.json', + {handsOnIdPlural: adminIds, handsOnStatus: 1},function(){ + Common.info("上架成功"); + dataReload(); + }); + } + if(!$.isEmpty(facultyIds)){ + facultyIds = facultyIds.slice(0, -1); + Common.post("/jlw/teacherOpenCourseHandsOn/editStatus.json", + {ids: facultyIds, status: 1},function(){ + Common.info("上架成功"); + dataReload(); + }) + } + }) + /*var dataType = ""; var isFalse = true; if(!$.isEmpty(data) || data.length > 0){ data.forEach(function (value, index) { @@ -233,11 +262,40 @@ layui.define(['form', 'laydate', 'table'], function (exports) { if(isFalse){ var ids = Common.concatBatchId(data, "handsOnId"); upDrown(1, ids, dataType); - } + }*/ }, drown: function () { var data = Common.getMoreDataFromTable(table, "handsOnTable"); - var dataType = ""; + var adminIds = ""; + var facultyIds = ""; + if(!$.isEmpty(data) || data.length > 0){ + data.forEach(function (value, index) { + if(value.dataType == "ADMIN_ADD"){ + adminIds += value.handsOnId + ","; + }else if(value.dataType == "FACULTY_ADD"){ + facultyIds += value.handsOnId + ","; + } + }); + } + Common.openConfirm("确认要上架这些教师开课-课程实训?",function(){ + if(!$.isEmpty(adminIds)){ + adminIds = adminIds.slice(0, -1); + Common.post('/jlw/handsOn/batchEdit.json', + {handsOnIdPlural: adminIds, handsOnStatus: 2},function(){ + Common.info("下架成功"); + dataReload(); + }); + } + if(!$.isEmpty(facultyIds)){ + facultyIds = facultyIds.slice(0, -1); + Common.post("/jlw/teacherOpenCourseHandsOn/editStatus.json", + {ids: facultyIds, status: 2},function(){ + Common.info("下架成功"); + dataReload(); + }) + } + }) + /*var dataType = ""; var isFalse = true; if(!$.isEmpty(data)){ data.forEach(function (value, index) { @@ -257,7 +315,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { if(isFalse){ var ids = Common.concatBatchId(data, "handsOnId"); upDrown(2, ids,dataType); - } + }*/ } } //触发事件 @@ -300,11 +358,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) { } else if (obj.event === "addTask") {//添加任务 // var url = "/jlw/handsOn/add.do?handsOnId=" + data.handsOnId+'&sign=1'; // Common.openDlg(url, "课程实训案例管理>新增课程实训案例>添加实训任务"); - var courseInfoId = data.dataType === 'FACULTY_ADD'?data.teacherOpenCourseId:data.systemCourseInfoId; - - var url; + var courseInfoId = data.dataType === 'FACULTY_ADD'?data.teacherOpenCourseId:data.courseInfoId; + var url = ""; if(isAdmin){ - url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId; + //课程id任务的理论测试题目选择 + url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId + "&courseInfoId="+courseInfoId; }else { url = "/jlw/teacherOpenCourseHandsOnSimulationTasks/add.do?handsOnId="+ data.handsOnId+'&teacherOpenCourseId='+courseInfoId; } 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 c58a4547..84a042b3 100644 --- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js @@ -230,7 +230,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT , btn: ['保存','关闭'] ,success:function () { resourcesQuestionTable(); - Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds); + Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds,2,2); } , yes: function (index, layero) { var ret = Common.getAjax('/jlw/handsOnSimulationTasks/getObjectiveProblem.do?problemIds='+resourcesQuestionIds); @@ -256,10 +256,11 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT btn.on('click', function () { resourcesQuestionTable1.reload({ where: { - 'courseInfoParentId':courseInfoIds, - 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), + 'courseInfoId_0':courseInfoIds, + 'courseInfoId_1':$("#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() + 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val(), + 'addTypeText': "超级管理员" }, }); }); @@ -300,10 +301,11 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT resourcesQuestionIds = []; $("#countQ").html(0); var param = { - 'courseInfoParentId':courseInfoIds, - 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), + 'courseInfoId_0':courseInfoIds, + 'courseInfoId_1':$("#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() + 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val(), + 'addTypeText' : "超级管理员" }; resourcesQuestionTable1.reload({ where: param, @@ -326,10 +328,10 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT method: 'post', even: true, size: "sms", - url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口 + url: Common.ctxPath + '/jlw/resourcesQuestion/testItemManageList.json' // 数据接口 , page: Lib.tablePage // 开启分页 , limit: 8 - , where: {"courseInfoParentId": courseInfoIds,'addType':addType} + , where: {"courseInfoId_0": courseInfoIds,'addTypeText':"超级管理员"} ,cols: [[ // 表头 { type: 'checkbox', align: "center" diff --git a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js index c71b1542..8e6ea118 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js @@ -306,7 +306,8 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }); return; } - deleteInfo(ids); + + deleteInfo(ids, data[0].sourceType); }, bindingCourseInfo: function () {//批量绑定课程 var checkStatus = table.checkStatus('resourcesInfoTable') @@ -338,7 +339,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { var url = "/jlw/resourcesInfo/add.do?resourcesInfoId=" + data.resourcesInfoId; Common.openDlg(url, "资源管理/编辑资源"); } else if (obj.event === "del") { - deleteInfo(data.resourcesInfoId); + deleteInfo(data.resourcesInfoId, data.sourceType); } else if (obj.event === "previewPage") { Lib.downloadFile(data); }else if(obj.event === "look"){ @@ -349,9 +350,17 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }) } - function deleteInfo(ids) { + function deleteInfo(ids, sourceType) { + var url = ""; + var param = {ids: ids}; + if(sourceType == "2"){ + url = "/jlw/resourcesInfo/deleteCourseSystemOAndUniversities.json"; + }else if(sourceType == "1"){ + param.status = 0; + url = '/jlw/teacherOpenCourseMergeResourcesQuestion/editStatus.json'; + } layer.confirm('是否确定删除数据?', function (index) { - var ret = Common.postAjax("/jlw/resourcesInfo/deleteCourseSystemOAndUniversities.json", {ids: ids}); + var ret = Common.postAjax(url, param); layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, { offset: ['50%'], icon: ret.code == 0 ? 1 : 2, diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js index 390263b8..14f42c0c 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js @@ -228,7 +228,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas Lib.getCourseInfo($("select[name='courseInfoId_1']"), teacherOpenCourseId,2,1); } , yes: function (index, layero) { - var ret = Common.getAjax('/jlw/handsOnSimulationTasks/getObjectiveProblem.do?problemIds='+resourcesQuestionIds); + var ret = Common.getAjax('/jlw/teacherOpenCourseHandsOnSimulationTasks/getObjectiveProblem.do?problemIds='+resourcesQuestionIds); if (ret.length > 0){ var getTpl = kgtTable_demo.innerHTML ,view = document.getElementById('kgtTable_view'); @@ -272,7 +272,6 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas } } } else { - console.log(obj.data) if (!$.isEmpty(resourcesQuestionIds)) { resourcesQuestionIds += "," + obj.data.teacherOpenCourseMergeResourcesQuestionId; } else { @@ -442,7 +441,11 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas param.tasksFile = JSON.stringify(tasksFile); }else if (taskType == 3){ //理论测评 var tableQuestionData = []; + var isFalse = false; $("#kgtTable_view .infoTr").each(function (){ + if($(this).find("input[name='questionScore']").val() == 0){ + isFalse = true; + } tableQuestionData.push({ questionType:$(this).find(".questionType").text(), questionTypeName:$(this).find(".questionTypeName").text(), @@ -456,6 +459,10 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas Common.info("请选择客观题"); return; } + if (isFalse){ + Common.info("请输入分值"); + return; + } param.taskList = resourcesQuestionIds; param.taskScore = $(".questionTotalInfo").text(); //分值 param.handsOnTaskProblemVo = JSON.stringify(tableQuestionData); diff --git a/web/src/main/resources/templates/jlw/courseInfo/courseConfigureNew.html b/web/src/main/resources/templates/jlw/courseInfo/courseConfigureNew.html index 9cd5dfce..b9c52ef0 100644 --- a/web/src/main/resources/templates/jlw/courseInfo/courseConfigureNew.html +++ b/web/src/main/resources/templates/jlw/courseInfo/courseConfigureNew.html @@ -745,7 +745,8 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find cellMinWidth: 100, method: 'post', even: true, - url: Common.ctxPath + '/jlw/resourcesInfo/list.json' // 数据接口 + //url: Common.ctxPath + '/jlw/resourcesInfo/list.json' // 数据接口 + url: Common.ctxPath + '/jlw/resourcesInfo/resourcesList.json' // 数据接口 , page: Lib.tablePage // 开启分页 , limit: 10, cols: [[ // 表头