diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentTeacherSystemUseLogAnalysisService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentTeacherSystemUseLogAnalysisService.java index 52063718..96d32035 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentTeacherSystemUseLogAnalysisService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentTeacherSystemUseLogAnalysisService.java @@ -28,6 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.beetl.sql.annotation.entity.EnumValue; import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.core.query.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -495,9 +496,9 @@ public class StudentTeacherSystemUseLogAnalysisService extends CoreBaseService time.getTime()){ - Assert.notNull(student, "未开始签到"); + Assert.notNull(null, "未开始签到"); } if (!Objects.isNull(endTime) && endTime.getTime() < time.getTime()){ - Assert.notNull(student, "未开始签到"); + Assert.notNull(null, "已结束签到"); } // 获取到真实的IP @@ -354,8 +355,23 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService time.getTime()){ - Assert.notNull(student, "未开始签到"); + Assert.notNull(null, "未开始签到"); } if (!Objects.isNull(endTime) && endTime.getTime() < time.getTime()){ - Assert.notNull(student, "未开始签到"); + Assert.notNull(null, "已结束签到"); } // 断言,验证码验证 @@ -447,8 +463,23 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService fileEntityList, Listlist, CoreUser coreUser){ @@ -754,7 +785,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseServicelist = courseLabelService.getValuesByQueryNotWithPermission(param); - list = list.stream() - .filter(courseLabel -> SetUtils.hashSet(coreUser.getOrgId(), 1L).contains(courseLabel.getOrgId()) || courseLabel.getOrgId() == null) - .collect(Collectors.toList()); +// list = list.stream() +// .filter(courseLabel -> SetUtils.hashSet(coreUser.getOrgId(), 1L).contains(courseLabel.getOrgId()) || courseLabel.getOrgId() == null) +// .collect(Collectors.toList()); return JsonResult.success(list); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java index b4a6f3af..51457ed5 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java @@ -187,7 +187,7 @@ public class TeacherOpenCourseController{ if (!coreUser.isAdmin()) { condition.setOrgId(coreUser.getOrgId()); } - condition.setTeacherOpenCourseStatus(1); +// condition.setTeacherOpenCourseStatus(1); teacherOpenCourseService.queryByCondition(page); return JsonResult.success(page); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/UniversitiesCollegesController.java b/web/src/main/java/com/ibeetl/jlw/web/UniversitiesCollegesController.java index f1b0b816..d308ed42 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/UniversitiesCollegesController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/UniversitiesCollegesController.java @@ -1,5 +1,6 @@ package com.ibeetl.jlw.web; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.jlw.Interceptor.SCoreUser; import cn.jlw.validate.ValidateConfig; @@ -161,6 +162,12 @@ public class UniversitiesCollegesController{ if(result.hasErrors()){ return JsonResult.failMessage(result); }else{ + if (ObjectUtil.isEmpty(createUserDTO.getUserCode())){ + return JsonResult.failMessage("用户名不能为空"); + } + if (createUserDTO.getUserCode().length() >12){ + return JsonResult.failMessage("用户名过长"); + } universitiesColleges.setAddTime(new Date()); universitiesColleges.setUniversitiesCollegesStatus(1); universitiesCollegesService.addAndCreateCoreUser(universitiesColleges, createUserDTO); diff --git a/web/src/main/java/com/ibeetl/jlw/web/UniversityFacultyController.java b/web/src/main/java/com/ibeetl/jlw/web/UniversityFacultyController.java index 942d9dfe..4deaa81e 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/UniversityFacultyController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/UniversityFacultyController.java @@ -1,5 +1,6 @@ package com.ibeetl.jlw.web; +import cn.hutool.core.util.ObjectUtil; import cn.jlw.Interceptor.SCoreUser; import cn.jlw.validate.ValidateConfig; import com.ibeetl.admin.core.annotation.Function; @@ -160,6 +161,13 @@ public class UniversityFacultyController extends BaseController { if(result.hasErrors()){ return JsonResult.failMessage(result); }else{ + if (ObjectUtil.isEmpty(universityFacultyQuery.getUniversitiesCollegesId())){ + return JsonResult.failMessage("请选择院校名称"); + } + + if (ObjectUtil.isEmpty(universityFacultyQuery.getUniversityFacultyName())){ + return JsonResult.failMessage("请输入院系名称"); + } UniversitiesColleges universitiesColleges = universitiesCollegesService.queryById(universityFacultyQuery.getUniversitiesCollegesId()); // 操作人 universityFacultyQuery.setUserId(coreUser.getId()); @@ -177,6 +185,13 @@ public class UniversityFacultyController extends BaseController { if(result.hasErrors()){ return JsonResult.failMessage(result); }else { + if (ObjectUtil.isEmpty(universityFacultyQuery.getUniversitiesCollegesId())){ + return JsonResult.failMessage("请选择院校名称"); + } + + if (ObjectUtil.isEmpty(universityFacultyQuery.getUniversityFacultyName())){ + return JsonResult.failMessage("请输入院系名称"); + } universityFacultyQuery.setUserId(null); universityFacultyQuery.setOrgId(null); String msg = universityFacultyService.edit(universityFacultyQuery); diff --git a/web/src/main/java/com/ibeetl/jlw/web/UniversitySystemController.java b/web/src/main/java/com/ibeetl/jlw/web/UniversitySystemController.java index 334dbafe..70c1b1d3 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/UniversitySystemController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/UniversitySystemController.java @@ -1,5 +1,6 @@ package com.ibeetl.jlw.web; +import cn.hutool.core.util.ObjectUtil; import cn.jlw.Interceptor.SCoreUser; import cn.jlw.validate.ValidateConfig; import com.ibeetl.admin.core.annotation.Function; @@ -183,6 +184,9 @@ public class UniversitySystemController extends BaseController { if(result.hasErrors()){ return JsonResult.failMessage(result); }else{ + if (ObjectUtil.isEmpty(universitySystemQuery.getUniversitySystemName())){ + return JsonResult.failMessage("请输入专业名称"); + } UniversityFaculty universityFaculty = facultyService.queryById(universitySystemQuery.getUniversityFacultyId()); // 操作人 universitySystemQuery.setUserId(coreUser.getId()); diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/CourseLabelQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/CourseLabelQuery.java index 4002c765..8f1b01b6 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/CourseLabelQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/CourseLabelQuery.java @@ -26,6 +26,8 @@ public class CourseLabelQuery extends PageParam { @Query(name = "查看自己和系统分配的") private Boolean seeSelf ; + private String orgIdPlural; + public Long getCourseLabelId(){ return courseLabelId; } @@ -89,4 +91,12 @@ public class CourseLabelQuery extends PageParam { public void setSeeSelf(Boolean seeSelf) { this.seeSelf = seeSelf; } + + public String getOrgIdPlural() { + return orgIdPlural; + } + + public void setOrgIdPlural(String orgIdPlural) { + this.orgIdPlural = orgIdPlural; + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/StudentQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/StudentQuery.java index 1b5823fd..2b4fb7f0 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/StudentQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/StudentQuery.java @@ -114,6 +114,8 @@ public class StudentQuery extends PageParam { private Integer log; private Long resourcesApplicationId; + private Long universityFacultyId; + /** * 日志中,查询条件,开始时间 */ @@ -543,4 +545,12 @@ public class StudentQuery extends PageParam { public void setStudentOrName(String studentOrName) { this.studentOrName = studentOrName; } + + public Long getUniversityFacultyId() { + return universityFacultyId; + } + + public void setUniversityFacultyId(Long universityFacultyId) { + this.universityFacultyId = universityFacultyId; + } } diff --git a/web/src/main/resources/sql/jlw/courseInfo.md b/web/src/main/resources/sql/jlw/courseInfo.md index 027333d3..98dfa7dd 100644 --- a/web/src/main/resources/sql/jlw/courseInfo.md +++ b/web/src/main/resources/sql/jlw/courseInfo.md @@ -907,7 +907,7 @@ getCourseSystemOAndUniversities AND ta.course_info_status = 1 AND a.course_label_status = 1 @if(!isEmpty(orgId)){ - AND ta.org_id = #orgId# + AND lb.org_id = #orgId# AND lb.use_type IN(1,2) @} ) diff --git a/web/src/main/resources/sql/jlw/courseLabel.md b/web/src/main/resources/sql/jlw/courseLabel.md index 0f74c8a4..523a76b7 100644 --- a/web/src/main/resources/sql/jlw/courseLabel.md +++ b/web/src/main/resources/sql/jlw/courseLabel.md @@ -103,4 +103,6 @@ getValuesByQueryNotWithPermission @if(!isEmpty(seeSelf) && seeSelf && !isEmpty(userId)){ and (t.add_type = 'ADMIN_ADD' or t.user_id = #userId#) @} - + @if(!isEmpty(seeSelf)){ + and FIND_IN_SET(t.org_id,#orgIdPlural#) + @} diff --git a/web/src/main/resources/sql/jlw/handsOn.md b/web/src/main/resources/sql/jlw/handsOn.md index 311b0402..6ee7f39e 100644 --- a/web/src/main/resources/sql/jlw/handsOn.md +++ b/web/src/main/resources/sql/jlw/handsOn.md @@ -72,7 +72,8 @@ queryByConditionMergeOpenCourseHandsOn t.course_info_id as system_course_info_id, (select course_info_name from course_info zc where zc.course_info_id = t.course_info_id and zc.course_info_status = 1 limit 1) as system_course_info_id_text, t.course_info_full_id, - t.data_type + t.data_type, + t.hands_on_status @} FROM ( @@ -87,7 +88,8 @@ queryByConditionMergeOpenCourseHandsOn c.`user_id`, a.course_info_id as system_course_info_id, a.course_info_full_id, - 'ADMIN_ADD' AS data_type + 'ADMIN_ADD' AS data_type, + c.hands_on_status FROM hands_on c LEFT JOIN course_info a ON c.course_child_node = a.course_info_id UNION ALL @@ -104,7 +106,8 @@ queryByConditionMergeOpenCourseHandsOn a.course_info_full_id,-- 判断关联课程是系统内置,还是院校添加的 CASE WHEN a.course_info_id IS NOT NULL THEN 'ADMIN_ADD' ELSE 'FACULTY_ADD' - END AS data_type + END AS data_type, + 1 as hands_on_status FROM teacher_open_course_hands_on c LEFT JOIN course_info a ON c.course_child_node = a.course_info_id diff --git a/web/src/main/resources/sql/jlw/questionLogSummary.md b/web/src/main/resources/sql/jlw/questionLogSummary.md index ab93e2d9..2e1bc422 100644 --- a/web/src/main/resources/sql/jlw/questionLogSummary.md +++ b/web/src/main/resources/sql/jlw/questionLogSummary.md @@ -592,6 +592,9 @@ getValuesByQueryNotWithPermission @if(!isEmpty(personId)){ and t.person_id =#personId# @} + @if(!isEmpty(studentId)){ + and t.person_id =#studentId# + @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} diff --git a/web/src/main/resources/sql/jlw/resourcesInfo.md b/web/src/main/resources/sql/jlw/resourcesInfo.md index 621a028b..47eaac24 100644 --- a/web/src/main/resources/sql/jlw/resourcesInfo.md +++ b/web/src/main/resources/sql/jlw/resourcesInfo.md @@ -181,7 +181,68 @@ getCurriculumResourceManagementList * 获取课程资源管理系统授权课+院校开课 SELECT @pageTag(){ - tt.* + tt.* + @} + FROM + ( + SELECT + t.add_type_text, + t.course_info_id, + t.course_info_name, + t.course_info_parent_name, + t.course_info_parent_id, + t.course_info_parent_parent_name, + t.course_info_parent_parent_id, + t.add_time, + t.order_index, + t.resources_info_content, + t.resources_info_files, + t.resources_info_id, + t.resources_info_name, + t.resources_info_type, + t.source_type + @if(!isEmpty(orgId)){ + , + IF(( + SELECT + a.org_id + FROM + universities_colleges_jurisdiction_curriculum_resources a + WHERE + a.org_id = #orgId# + AND a.use_type IN(1,2) + AND a.course_info_id = t.course_info_parent_parent_id + AND a.use_end_time > NOW() + ), + ( + SELECT + a.org_id + FROM + universities_colleges_jurisdiction_curriculum_resources a + WHERE + a.org_id = #orgId# + AND a.use_type IN(1,2) + AND a.course_info_id = t.course_info_parent_parent_id + AND a.use_end_time > NOW() + ), + ( + SELECT + a.org_id + FROM + teacher_open_course a + WHERE + a.teacher_open_course_status = 1 + AND a.teacher_open_course_id = t.course_info_parent_parent_id + )) AS org_id, + ( + SELECT + a.user_id + FROM + teacher_open_course a + WHERE + a.teacher_open_course_status = 1 + AND a.teacher_open_course_id = t.course_info_parent_parent_id + ) AS user_id @} FROM ( @@ -323,13 +384,11 @@ getCurriculumResourceManagementList lc.course_info_id) AS course_info_parent_parent_id, ta.add_time, ta.order_index, - ta.org_id, ta.resources_info_content, ta.resources_info_files, ta.resources_info_id, ta.resources_info_name, ta.resources_info_type, - ta.user_id, '2' AS source_type FROM resources_info ta @@ -341,7 +400,11 @@ getCurriculumResourceManagementList UNION ALL ( SELECT + @if(!isEmpty(orgId)){ + (SELECT a.teacher_name FROM teacher a WHERE a.user_id = tb.user_id) AS add_type_text, + @}else { lbd.`NAME` AS add_type_text, + @} tb.teacher_open_course_merge_course_info_id AS course_info_id, IF( ISNULL(( @@ -477,13 +540,11 @@ getCurriculumResourceManagementList lbc.teacher_open_course_id) AS course_info_parent_parent_id, tb.add_time, tb.order_index, - tb.org_id, tb.resources_info_content, tb.resources_info_files AS resources_info_files, tb.teacher_open_course_merge_resources_info_id AS resources_info_id, tb.resources_info_name, tb.resources_info_type, - tb.user_id, '1' AS source_type FROM teacher_open_course_merge_resources_info tb @@ -493,10 +554,8 @@ getCurriculumResourceManagementList LEFT JOIN core_org lbd ON lbd.`ID` = tb.org_id AND lbd.DEL_FLAG = 0 WHERE tb.resources_info_status = 1 - @if(!isEmpty(orgId)){ - and tb.org_id =#orgId# - @} ) + ) t ) tt WHERE 1=1 @if(!isEmpty(resourcesInfoType)) { @@ -520,4 +579,7 @@ getCurriculumResourceManagementList @if(!isEmpty(sourceType)) { AND tt.source_type = #sourceType# @} + @if(!isEmpty(orgId)){ + AND tt.org_id = #orgId# + @} ORDER BY tt.add_time DESC \ No newline at end of file diff --git a/web/src/main/resources/sql/jlw/student.md b/web/src/main/resources/sql/jlw/student.md index a3d5ebec..0929d028 100644 --- a/web/src/main/resources/sql/jlw/student.md +++ b/web/src/main/resources/sql/jlw/student.md @@ -131,6 +131,9 @@ queryByCondition @} @if(!isEmpty(studentOrName)){ and (t.student_sn like #'%'+studentOrName+'%'# or t.student_name like #'%'+studentOrName+'%'#) + @} + @if(!isEmpty(universityFacultyId)){ + and bb.university_faculty_id =#universityFacultyId# @} @if(!isEmpty(competitionId)){ -- 1只包含参赛学员 2不包含参赛学员 diff --git a/web/src/main/resources/static/js/jlw/courseInfo/add.js b/web/src/main/resources/static/js/jlw/courseInfo/add.js index 3f359964..ca862a2a 100644 --- a/web/src/main/resources/static/js/jlw/courseInfo/add.js +++ b/web/src/main/resources/static/js/jlw/courseInfo/add.js @@ -42,6 +42,14 @@ layui.define([ 'form', 'laydate', 'table','courseInfoApi',"layedit"], function(e // }else { // layer.msg(ret.msg); // } + layedit.set({ //富文本上传图片 + uploadImage: { + url: Common.ctxPath + "/jlw/file/update.do", + imgUrl:Common.ctxPath, + type: 'post' //默认post + } + }); + var courseInfoContent_ = layedit.build('courseInfoContent',{height:100}); //题干 var view = { init:function(){ 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 8ad3eacc..646f65b3 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/add.js +++ b/web/src/main/resources/static/js/jlw/handsOn/add.js @@ -14,6 +14,13 @@ layui.define(['form', 'laydate', 'table','laytpl','upload','layedit', 'handsOnAp } }); + var courseInfoParentId = $("select[name='courseInfoId']").val();//课程ID + var sourceType = $("select[name='courseInfoId']").find('option:selected').attr("status"); + var childValue = $("#courseChildNode").val(); + //反显章节下拉框(key,courseInfoParentId,courseInfoType,sourceType,resourcesQuestionIdsIsNotNull) + Lib.getCourseInfo($("select[name='courseChildNode']"),courseInfoParentId,2,sourceType,'',childValue); + form.render(); + window.loadList = function (){//重新加载实训任务列表 getListInfo(); } 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 724f25f0..215c4d1b 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/index.js +++ b/web/src/main/resources/static/js/jlw/handsOn/index.js @@ -54,18 +54,18 @@ layui.define(['form', 'laydate', 'table'], function (exports) { { field: 'systemCourseChildNodeText', title: '归属章节', align: "center" - }, - { - field: 'orgIdText', - title: '归属院校', align: "center" }, { field: 'addTime', title: '导入时间', align: "center", + }, { + field: 'orgIdText', + title: '案例来源', align: "center",hide:isAdmin?false:true }, { field: 'dataType', title: '案例来源', align: "center", + hide:isAdmin?true:false, templet: function (d) { return d.dataType == 'FACULTY_ADD' ? '院校添加' : (d.dataType == 'ADMIN_ADD' ? '系统内置': '') } @@ -80,18 +80,18 @@ layui.define(['form', 'laydate', 'table'], function (exports) { field: 'operation_', title: '操作', align: "center", - fixed: 'right', width: 260, templet: function (d) { var css = isAdmin? "" : "display: none;"; - var htm = '上架'; + var htm = '
上架'; htm += '下架'; // htm += '编辑'; - htm += ''+ (isAdmin?'编辑':'查看')+''; - htm += '添加任务'; - if(d.dataType == 'FACULTY_ADD'|| isAdmin){ + htm += ''+ ((d.dataType == 'FACULTY_ADD' && !isAdmin)||(d.dataType == 'ADMIN_ADD' && isAdmin)?'编辑':'查看')+''; + if((d.dataType == 'FACULTY_ADD' && !isAdmin)||(d.dataType == 'ADMIN_ADD' && isAdmin)){ + htm += '添加任务'; htm += '删除'; } + htm +='
'; return htm; } } @@ -154,6 +154,9 @@ layui.define(['form', 'laydate', 'table'], function (exports) { var data = obj.data; if (obj.event === 'edit') { var url = "/jlw/handsOn/add.do?handsOnId=" + data.handsOnId; + if(data.dataType == 'FACULTY_ADD'){ + url = "/jlw/teacherOpenCourseHandsOn/edit.do?resourcesInfoId=" + data.handsOnId; + } Common.openDlg(url, "实操管理>" + data.handsOnName + ">编辑"); } else if (obj.event === "result") { var url = "/jlw/handsOnAchievement/index2.do?handsOnId=" + data.handsOnId; @@ -203,7 +206,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }; //选择归属课程 并且根据选择的课程查询章节 resourcesQuestionIdsIsNotNull:查询题目不为空的章节 form.on('select(select_courseInfoIds)', function (obj) { - Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value, 1); + //Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value, 1); + + let sourceType = $("select[name='courseInfoId']").find('option:selected').attr("status"); + let courseInfoType = 2;//courseInfoType(2 章节,3 节) + Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value,courseInfoType,sourceType, 1); }); /*//选择归属课程 并且根据选择的课程查询章节 diff --git a/web/src/main/resources/static/js/jlw/resourcesInfo/add.js b/web/src/main/resources/static/js/jlw/resourcesInfo/add.js index 85e3a214..34833e57 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/add.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/add.js @@ -7,24 +7,25 @@ layui.define([ 'form', 'laydate', 'table','element','upload','resourcesInfoApi', var layedit = layui.layedit; var laytpl = layui.laytpl ; - var courseInfoContent_ = layedit.build('resourcesInfoContent',{height: 400}); - var courseId = $("select[name='courseInfoId_0']").val();//课程ID - var chapterId = $("select[name='courseInfoId_1']").val();//章ID - var courseInfoId = $("select[name='courseInfoId_2']").val();//节ID - var sourceType = $("select[name='courseInfoId_0']").find('option:selected').attr("status"); - var childValue = $("#courseInfoId_1").val(); - var childChildValue = $("#courseInfoId_2").val(); - layedit.set({ //富文本上传图片 uploadImage: { url: Common.ctxPath + "/jlw/file/update.do", - imgUrl:Common.ctxPath + imgUrl:Common.ctxPath, + type: 'post' //默认post } }); + var courseId = $("select[name='courseInfoId_0']").val();//课程ID + var sourceType = $("select[name='courseInfoId_0']").find('option:selected').attr("status"); + var childValue = $("#courseInfoId_1").val(); + var childChildValue = $("#courseInfoId_2").val(); + Lib.getCourseInfo($("select[name='courseInfoId_1']"),courseId,2,sourceType,'',childValue);//key,courseInfoParentId,courseInfoType,sourceType,resourcesQuestionIdsIsNotNull Lib.getCourseInfo($("select[name='courseInfoId_2']"),childValue,3,sourceType,'',childChildValue);//key,courseInfoParentId,courseInfoType,sourceType,resourcesQuestionIdsIsNotNull + var courseInfoContent_ = layedit.build('resourcesInfoContent',{height: 400}); + form.render(); + var view = { init:function(){ Lib.initGenrealForm($("#addForm"),form); @@ -33,6 +34,9 @@ layui.define([ 'form', 'laydate', 'table','element','upload','resourcesInfoApi', initSubmit:function(){ $("#addButton").click(function(){ form.on('submit(form)', function(){ + var courseId = $("select[name='courseInfoId_0']").val();//课程ID + var chapterId = $("select[name='courseInfoId_1']").val();//章ID + var courseInfoId = $("select[name='courseInfoId_2']").val();//节ID var resourcesInfoId = $("input[name='resourcesInfoId']").val(); var resourcesInfoType = $("select[name='resourcesInfoType']").val(); // 资源类型(详细见数据字典,resources_info_type) var sourceType = 2; 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 56b9f247..561f1d6d 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js @@ -39,7 +39,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { } currentAuthCourseInfoDetails.forEach(function(e,i){ - if(e.sourceType == 2){ + if(e.sourceType == 2 && isAdmin){ if(e.courseLabelType == '考证课程类'){ textualResearchCourseList.push(e); }else if(e.courseLabelType == '理论课程类'){ @@ -47,7 +47,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }else if(e.courseLabelType == '应用课程类'){ applicationCourseList.push(e); } - }else if(e.sourceType == 1){ + }else if(e.sourceType == 1&&!isAdmin){ openCourseList.push(e) } }); @@ -69,10 +69,10 @@ layui.define(['form', 'laydate', 'table'], function (exports) { } if(isAdmin){ - selectList += htmY + '' + htmK + '' + htmL + '' + htmO + '' + ""; + selectList += htmY + '' + htmK + '' + htmL + '' + ""; //console.log($("#isUser").val()) }else { - selectList+= htmL + '' + htmO + '' + ""; + selectList+= htmO + '' + ""; } /*$.each(courseLabelTypes, function (key, value) { @@ -114,67 +114,88 @@ layui.define(['form', 'laydate', 'table'], function (exports) { field: 'courseInfoParentParentName', title: '归属课程', templet: function (d) { - return selectList; //一级 + if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){ + return selectList; //一级 + }else { + return d.courseInfoParentParentName||""; + } } - }, - { + },{ field: 'courseInfoParentName', title: '归属章节', align: "center", templet: function (d) { - var htm = ""; + if (!$.isEmpty(d.courseInfoParentId)&&!$.isEmpty(d.courseInfoParentParentId)) { + if ($.isEmpty(selectMap[d.courseInfoParentParentId])) { + var h = htm; + var courseInfoChildtList = childCourseList(d.courseInfoParentParentId,2,d.sourceType); + if (!$.isEmpty(courseInfoChildtList)) { + courseInfoMap[d.courseInfoParentParentId] = courseInfoChildtList; + $.each(courseInfoChildtList, function (key, v) { + h += ""; + }); + } + selectMap[d.courseInfoParentParentId] = h + ""; + return h; + } else { + return selectMap[d.courseInfoParentParentId]; } - selectMap[d.courseInfoParentParentId] = h + ""; - return h; } else { - return selectMap[d.courseInfoParentParentId]; + return htm + ""; //二级 } - } else { - return htm + ""; //二级 + }else{ + var value = ''; + if(!$.isEmpty(d.courseInfoParentParentId)){ + value = d.courseInfoParentName||""; + } + return value; } - } }, { field: 'courseInfoName', title: '归属小节', align: "center", width: 200, templet: function (d) { - var htm = ""; + if (!$.isEmpty(d.courseInfoId)&&!$.isEmpty(d.courseInfoParentParentId)) { + if ($.isEmpty(selectMap[d.courseInfoParentId])) { + var h = htm; + var courseInfoChildtChildList = childCourseList(d.courseInfoParentId,3,d.sourceType); + if (!$.isEmpty(courseInfoChildtChildList)) { + zjMap[d.courseInfoParentId] = courseInfoChildtChildList; + $.each(courseInfoChildtChildList, function (key, v) { + h += ""; + }); + } + selectMap[d.courseInfoParentId] = h + ""; + return h; + } else { + return selectMap[d.courseInfoParentId]; } - selectMap[d.courseInfoParentId] = h + ""; - return h; + } else { - return selectMap[d.courseInfoParentId]; + return htm + ""; //三级 } - - } else { - return htm + ""; //三级 + }else{ + var value = ''; + if(!$.isEmpty(d.courseInfoParentParentId)){ + value = d.courseInfoName||""; + } + return value; } - } }, { - field: 'addTypeText', title: '来源', align: "center" + field: 'addTypeText', title: '来源', align: "center",hide:isAdmin?false:true + }, + { + field: 'sourceType', title: '来源', align: "center",hide:isAdmin?true:false, + templet:function (d) { + var htm = d.sourceType == 1?"院校添加":"系统内置"; + return htm; + } }, - /*{ - field: 'orgIdText', title: '上传院校', align: "center" - },*/ { field: 'resourcesInfoType', title: '资源类型', align: "center", templet: function (d) {//(1视频 2PPT 3PDF) var text = d.resourcesInfoType == 1 ? "视频" : d.resourcesInfoType == 2 ? "PPT" : d.resourcesInfoType == 3 ? "PDF" : d.resourcesInfoType == 4 ? "链接" : d.resourcesInfoType == 5 ? "图文" : '-'; @@ -183,16 +204,20 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, { field: 'userId', title: '操作', align: "center", field: 'right', templet: function (d) { - var htm = '编辑'; + var htm='
'; + if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){ + htm += '编辑'; + } // htm += '' + (d.resourcesInfoType == 3 ? '下载' : '预览') + ''; if(d.resourcesInfoType == 4){ htm += '预览'; }else { htm += '预览'; } - if(d.sourceType == 1 || isAdmin){ + if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){ htm += '删除'; } + htm += '
' return htm; } } diff --git a/web/src/main/resources/templates/common/courseInfoSelect.html b/web/src/main/resources/templates/common/courseInfoSelect.html index 88acf147..7f8f78a9 100644 --- a/web/src/main/resources/templates/common/courseInfoSelect.html +++ b/web/src/main/resources/templates/common/courseInfoSelect.html @@ -7,7 +7,7 @@ id 标签的ID值; isShowGroupName 显示分组名称(默认:true); defaultValue 默认值; - filterName 过滤的分类名称,多个逗号隔开;只支持【应用课程类】、【理论课程类】、【考证课程类】,showGroupName为false也会过滤数据。 + filterName 过滤的分类名称,多个逗号隔开;只支持【应用课程类】、【理论课程类】、【考证课程类】,【开课类】,showGroupName为false也会过滤数据。 isShowOpentCourse 显示开课课程 */ @@ -62,7 +62,7 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c * */ - // jq选择器 + // jq选择器 var ele = $('#${newId}'); // 过滤label var filterNames = '${filterName!""}'; @@ -131,7 +131,7 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c } if (isShowGroupNameHandler()) ele.append(''); } - if (filterNames.indexOf('开课课程类') >= 0 || filterNames === "") { + if (filterNames.indexOf('开课类') >= 0 || filterNames === "") { if (isShowGroupNameHandler()) ele.append(''); for (let currentAuthCourseInfoDetail of openCourseList) { var cid = currentAuthCourseInfoDetail.courseInfoId || '-1'; diff --git a/web/src/main/resources/templates/jlw/handsOn/add.html b/web/src/main/resources/templates/jlw/handsOn/add.html index 5d3fadcb..ef2bdb04 100644 --- a/web/src/main/resources/templates/jlw/handsOn/add.html +++ b/web/src/main/resources/templates/jlw/handsOn/add.html @@ -48,10 +48,10 @@ - + - + @@ -60,15 +60,10 @@
- - - - + -
@@ -106,6 +101,7 @@ ondrop="jQuery(this).removeClass('uploader-dragover');"> + diff --git a/web/src/main/resources/templates/jlw/resourcesInfo/index.html b/web/src/main/resources/templates/jlw/resourcesInfo/index.html index 4adb0e10..c79af54e 100644 --- a/web/src/main/resources/templates/jlw/resourcesInfo/index.html +++ b/web/src/main/resources/templates/jlw/resourcesInfo/index.html @@ -56,7 +56,7 @@ - + @@ -76,15 +76,21 @@ id="courseChildNodeNode" name="courseInfoId_2"/> -
+ + -
+ diff --git a/web/src/main/resources/templates/jlw/resourcesQuestion/add.html b/web/src/main/resources/templates/jlw/resourcesQuestion/add.html index d5a15d71..e7c3ff70 100644 --- a/web/src/main/resources/templates/jlw/resourcesQuestion/add.html +++ b/web/src/main/resources/templates/jlw/resourcesQuestion/add.html @@ -18,10 +18,10 @@ - + - +
diff --git a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html index 3bf3b7c7..83a0fce7 100644 --- a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html +++ b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html @@ -32,7 +32,7 @@ - + diff --git a/web/src/main/resources/templates/jlw/resourcesTraining/add.html b/web/src/main/resources/templates/jlw/resourcesTraining/add.html index c12c609b..9460f6ef 100644 --- a/web/src/main/resources/templates/jlw/resourcesTraining/add.html +++ b/web/src/main/resources/templates/jlw/resourcesTraining/add.html @@ -43,10 +43,10 @@ - + - + @@ -96,6 +96,7 @@ diff --git a/web/src/main/resources/templates/jlw/resourcesTraining/index.html b/web/src/main/resources/templates/jlw/resourcesTraining/index.html index e393eb4e..8c088b74 100644 --- a/web/src/main/resources/templates/jlw/resourcesTraining/index.html +++ b/web/src/main/resources/templates/jlw/resourcesTraining/index.html @@ -27,7 +27,7 @@ - +
diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html index 977a6f4b..0477a696 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html @@ -61,10 +61,10 @@ - + - +
diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html index 1a682304..5dcff102 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html @@ -28,7 +28,7 @@ - +