课程实操-修改bug

beetlsql3-dev
姚丹ab 2 years ago
parent a9004b0505
commit 09762a0553

@ -133,11 +133,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
/*btnDrown.addClass("button-disabled"); /*btnDrown.addClass("button-disabled");
btnUp.addClass("button-disabled");*/ btnUp.addClass("button-disabled");*/
btnDell.addClass("button-disabled"); btnDell.addClass("button-disabled");
Common.info("禁止 '删除' 院校添加的课程实训案例"); //Common.info("禁止 '删除' 院校添加的课程实训案例");
} }
if(!isAdmin&& handsOn.dataType == "ADMIN_ADD"){ if(!isAdmin&& handsOn.dataType == "ADMIN_ADD"){
btnDell.addClass("button-disabled"); btnDell.addClass("button-disabled");
Common.info("禁止 '删除' 系统内置的课程实训案例"); //Common.info("禁止 '删除' 系统内置的课程实训案例");
} }
} else { } else {
var isFalse = true; var isFalse = true;
@ -204,7 +204,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
if(isFalse && !isAdmin){ if(isFalse && !isAdmin){
Common.openConfirm("确认要删除这些教师开课-课程实训?",function(){ Common.openConfirm("确认要删除这些教师开课-课程实训?",function(){
var ids = Common.concatBatchId(data,"handsOnId"); 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("删除成功"); Common.info("删除成功");
dataReload(); dataReload();
}) })
@ -213,7 +213,36 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
}, },
up: function () { up: function () {
var data = Common.getMoreDataFromTable(table, "handsOnTable"); 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; var isFalse = true;
if(!$.isEmpty(data) || data.length > 0){ if(!$.isEmpty(data) || data.length > 0){
data.forEach(function (value, index) { data.forEach(function (value, index) {
@ -233,11 +262,40 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
if(isFalse){ if(isFalse){
var ids = Common.concatBatchId(data, "handsOnId"); var ids = Common.concatBatchId(data, "handsOnId");
upDrown(1, ids, dataType); upDrown(1, ids, dataType);
} }*/
}, },
drown: function () { drown: function () {
var data = Common.getMoreDataFromTable(table, "handsOnTable"); 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; var isFalse = true;
if(!$.isEmpty(data)){ if(!$.isEmpty(data)){
data.forEach(function (value, index) { data.forEach(function (value, index) {
@ -257,7 +315,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
if(isFalse){ if(isFalse){
var ids = Common.concatBatchId(data, "handsOnId"); var ids = Common.concatBatchId(data, "handsOnId");
upDrown(2, ids,dataType); upDrown(2, ids,dataType);
} }*/
} }
} }
//触发事件 //触发事件
@ -300,11 +358,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
} else if (obj.event === "addTask") {//添加任务 } else if (obj.event === "addTask") {//添加任务
// var url = "/jlw/handsOn/add.do?handsOnId=" + data.handsOnId+'&sign=1'; // var url = "/jlw/handsOn/add.do?handsOnId=" + data.handsOnId+'&sign=1';
// Common.openDlg(url, "课程实训案例管理>新增课程实训案例>添加实训任务"); // Common.openDlg(url, "课程实训案例管理>新增课程实训案例>添加实训任务");
var courseInfoId = data.dataType === 'FACULTY_ADD'?data.teacherOpenCourseId:data.systemCourseInfoId; var courseInfoId = data.dataType === 'FACULTY_ADD'?data.teacherOpenCourseId:data.courseInfoId;
var url = "";
var url;
if(isAdmin){ if(isAdmin){
url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId; //课程id任务的理论测试题目选择
url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId + "&courseInfoId="+courseInfoId;
}else { }else {
url = "/jlw/teacherOpenCourseHandsOnSimulationTasks/add.do?handsOnId="+ data.handsOnId+'&teacherOpenCourseId='+courseInfoId; url = "/jlw/teacherOpenCourseHandsOnSimulationTasks/add.do?handsOnId="+ data.handsOnId+'&teacherOpenCourseId='+courseInfoId;
} }

@ -230,7 +230,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
, btn: ['保存','关闭'] , btn: ['保存','关闭']
,success:function () { ,success:function () {
resourcesQuestionTable(); resourcesQuestionTable();
Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds); Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds,2,2);
} }
, yes: function (index, layero) { , yes: function (index, layero) {
var ret = Common.getAjax('/jlw/handsOnSimulationTasks/getObjectiveProblem.do?problemIds='+resourcesQuestionIds); 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 () { btn.on('click', function () {
resourcesQuestionTable1.reload({ resourcesQuestionTable1.reload({
where: { where: {
'courseInfoParentId':courseInfoIds, 'courseInfoId_0':courseInfoIds,
'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), 'courseInfoId_1':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(),
"questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").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 = []; resourcesQuestionIds = [];
$("#countQ").html(0); $("#countQ").html(0);
var param = { var param = {
'courseInfoParentId':courseInfoIds, 'courseInfoId_0':courseInfoIds,
'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(), 'courseInfoId_1':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(),
"questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").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({ resourcesQuestionTable1.reload({
where: param, where: param,
@ -326,10 +328,10 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
method: 'post', method: 'post',
even: true, even: true,
size: "sms", size: "sms",
url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口 url: Common.ctxPath + '/jlw/resourcesQuestion/testItemManageList.json' // 数据接口
, page: Lib.tablePage // 开启分页 , page: Lib.tablePage // 开启分页
, limit: 8 , limit: 8
, where: {"courseInfoParentId": courseInfoIds,'addType':addType} , where: {"courseInfoId_0": courseInfoIds,'addTypeText':"超级管理员"}
,cols: [[ // 表头 ,cols: [[ // 表头
{ {
type: 'checkbox', align: "center" type: 'checkbox', align: "center"

@ -306,7 +306,8 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
}); });
return; return;
} }
deleteInfo(ids);
deleteInfo(ids, data[0].sourceType);
}, },
bindingCourseInfo: function () {//批量绑定课程 bindingCourseInfo: function () {//批量绑定课程
var checkStatus = table.checkStatus('resourcesInfoTable') 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; var url = "/jlw/resourcesInfo/add.do?resourcesInfoId=" + data.resourcesInfoId;
Common.openDlg(url, "资源管理/编辑资源"); Common.openDlg(url, "资源管理/编辑资源");
} else if (obj.event === "del") { } else if (obj.event === "del") {
deleteInfo(data.resourcesInfoId); deleteInfo(data.resourcesInfoId, data.sourceType);
} else if (obj.event === "previewPage") { } else if (obj.event === "previewPage") {
Lib.downloadFile(data); Lib.downloadFile(data);
}else if(obj.event === "look"){ }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) { 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, { layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
offset: ['50%'], offset: ['50%'],
icon: ret.code == 0 ? 1 : 2, icon: ret.code == 0 ? 1 : 2,

@ -228,7 +228,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
Lib.getCourseInfo($("select[name='courseInfoId_1']"), teacherOpenCourseId,2,1); Lib.getCourseInfo($("select[name='courseInfoId_1']"), teacherOpenCourseId,2,1);
} }
, yes: function (index, layero) { , 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){ if (ret.length > 0){
var getTpl = kgtTable_demo.innerHTML var getTpl = kgtTable_demo.innerHTML
,view = document.getElementById('kgtTable_view'); ,view = document.getElementById('kgtTable_view');
@ -272,7 +272,6 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
} }
} }
} else { } else {
console.log(obj.data)
if (!$.isEmpty(resourcesQuestionIds)) { if (!$.isEmpty(resourcesQuestionIds)) {
resourcesQuestionIds += "," + obj.data.teacherOpenCourseMergeResourcesQuestionId; resourcesQuestionIds += "," + obj.data.teacherOpenCourseMergeResourcesQuestionId;
} else { } else {
@ -442,7 +441,11 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
param.tasksFile = JSON.stringify(tasksFile); param.tasksFile = JSON.stringify(tasksFile);
}else if (taskType == 3){ //理论测评 }else if (taskType == 3){ //理论测评
var tableQuestionData = []; var tableQuestionData = [];
var isFalse = false;
$("#kgtTable_view .infoTr").each(function (){ $("#kgtTable_view .infoTr").each(function (){
if($(this).find("input[name='questionScore']").val() == 0){
isFalse = true;
}
tableQuestionData.push({ tableQuestionData.push({
questionType:$(this).find(".questionType").text(), questionType:$(this).find(".questionType").text(),
questionTypeName:$(this).find(".questionTypeName").text(), questionTypeName:$(this).find(".questionTypeName").text(),
@ -456,6 +459,10 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
Common.info("请选择客观题"); Common.info("请选择客观题");
return; return;
} }
if (isFalse){
Common.info("请输入分值");
return;
}
param.taskList = resourcesQuestionIds; param.taskList = resourcesQuestionIds;
param.taskScore = $(".questionTotalInfo").text(); //分值 param.taskScore = $(".questionTotalInfo").text(); //分值
param.handsOnTaskProblemVo = JSON.stringify(tableQuestionData); param.handsOnTaskProblemVo = JSON.stringify(tableQuestionData);

@ -745,7 +745,8 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
cellMinWidth: 100, cellMinWidth: 100,
method: 'post', method: 'post',
even: true, 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 // 开启分页 , page: Lib.tablePage // 开启分页
, limit: 10, , limit: 10,
cols: [[ // 表头 cols: [[ // 表头

Loading…
Cancel
Save