Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
yangdj 2 years ago
commit 3523cd3521

@ -28,6 +28,10 @@ public class CourseInfo extends BaseEntity{
@AutoID
private Long courseInfoId ;
// 全路径ID
private String courseInfoFullId;
//名称(课程名 或 章名 或 节名)
@ -333,4 +337,11 @@ public class CourseInfo extends BaseEntity{
public String toString() {
return JSONUtil.toJsonStr(this);
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
public String getCourseInfoFullId() {
return this.courseInfoFullId;
}
}

@ -108,6 +108,24 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
return ret;
}
/**
* ID
* @param courseInfo
* @return
*/
public String getCourseInfoFullId(CourseInfo courseInfo) {
Long courseInfoId = courseInfo.getCourseInfoId();
Long courseInfoParentId = courseInfo.getCourseInfoParentId();
if (courseInfoParentId != null && !courseInfoParentId.equals(courseInfoId)) {
CourseInfo parentCi = getById(courseInfoParentId);
return getCourseInfoFullId(parentCi) + "_" + courseInfoId;
}
return courseInfoId.toString();
}
public CourseInfo add(CourseInfoQuery courseInfoQuery){
@ -132,6 +150,13 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
}
}
// 更新全路径ID
String courseInfoFullId = getCourseInfoFullId(courseInfo);
CourseInfo model = new CourseInfo();
model.setCourseInfoId(courseInfo.getCourseInfoId());
model.setCourseInfoFullId(courseInfoFullId);
updateTemplate(model);
return courseInfo;
}

@ -1,6 +1,8 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.jlw.aliPay.utils.StringUtils;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.jlw.dao.CourseInfoDao;
@ -16,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static cn.jlw.util.ConvertM3U8.booleanMap;
@ -267,4 +270,25 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo>{
public List<ResourcesInfo> getValues (Object paras){
return sqlManager.select(SqlId.of("jlw.resourcesInfo.getResourcesInfoValues"),ResourcesInfo.class,paras);
}
/**
*
* @param resourcesInfoIds
* @param courseId
*/
public void copy(String resourcesInfoIds, Long courseId) {
ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery();
resourcesInfoQuery.setResourcesInfoIds(resourcesInfoIds);
List<ResourcesInfo> list = getValuesByQuery(resourcesInfoQuery);
List<ResourcesInfo> insertList = CollectionUtil.emptyIfNull(list).stream().map(item -> {
item.setCourseInfoId(courseId);
item.setResourcesInfoId(null);
return item;
}).collect(Collectors.toList());
if (ObjectUtil.isEmpty(insertList)) {
insertBatch(insertList);
}
}
}

@ -298,7 +298,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(ip_signin.name());
@ -330,7 +330,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(manual_signin.name());
@ -374,7 +374,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(code_signin.name());

@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -39,13 +41,13 @@ import static cn.hutool.core.util.ArrayUtil.join;
*/
@Controller
@Validated
public class ResourcesInfoController{
private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/jlw/resourcesInfo";
private static final String API = "/api/resourcesInfo";
@Autowired private ResourcesInfoService resourcesInfoService;
@Autowired private CourseInfoService courseInfoService;
@ -195,6 +197,22 @@ public class ResourcesInfoController{
}
}
/**
*
*
* @param resourcesInfoIds
* @param courseId
* @return
*/
@PostMapping(MODEL + "/copy.json")
@Function("resourcesInfo.add")
@ResponseBody
public JsonResult copy(@NotBlank(message = "资源IDs不能为空") String resourcesInfoIds, @NotNull(message = "课程ID不能为空") Long courseId){// courseId课程ID
resourcesInfoService.copy(resourcesInfoIds, courseId);
return JsonResult.success();
}
//批量设置章节
@PostMapping(MODEL + "/setCourseInfoId.json")
@Function("resourcesInfo.edit")
@ -283,6 +301,7 @@ public class ResourcesInfoController{
resourcesInfoService.deleteResourcesInfo(ids);
return JsonResult.success();
}
}

@ -12,6 +12,8 @@ import java.util.Date;
public class CourseInfoQuery extends PageParam {
@Query(name = "ID", display = false)
private Long courseInfoId;
@Query(name = "全路径ID", display = false)
private String courseInfoFullId;
@Query(name = "名称", display = true)
private String courseInfoName;
@Query(name = "课程缩略图", display = false)
@ -184,6 +186,7 @@ public class CourseInfoQuery extends PageParam {
public CourseInfo pojo(){
CourseInfo pojo = new CourseInfo();
pojo.setCourseInfoId(this.getCourseInfoId());
pojo.setCourseInfoFullId(this.getCourseInfoFullId());
pojo.setCourseInfoName(this.getCourseInfoName());
pojo.setCourseInfoThumbnail(this.getCourseInfoThumbnail());
pojo.setCourseLabelId(this.getCourseLabelId());
@ -308,4 +311,12 @@ public class CourseInfoQuery extends PageParam {
public void setCourseInfoIdPlural(String courseInfoIdPlural) {
this.courseInfoIdPlural = courseInfoIdPlural;
}
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
}

@ -40,6 +40,11 @@ public class ResourcesInfoQuery extends PageParam {
private String courseInfoIds;
private String orgIdPlural;
/**
*
*/
private String courseInfoFullId;
public Long getResourcesInfoId(){
return resourcesInfoId;
}
@ -154,4 +159,12 @@ public class ResourcesInfoQuery extends PageParam {
public String getOrgIdPlural() {
return orgIdPlural;
}
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
}

@ -1,11 +1,13 @@
package com.ibeetl.jlw.web.query;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog;
import com.ibeetl.jlw.enums.SignInTypeEnum;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
@ -22,8 +24,8 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
private Long teacherOpenCourseStudentSigninSettingId;
// 签到场次(时间)
private Date teacherOpenCourseStudentSigninSettingSessionTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String teacherOpenCourseStudentSigninSettingSessionTime;
@Query(name = "学生ID", display = false,type=Query.TYPE_DICT,dict="student.student_name.student_status=1")
private Long studentId;
@Query(name = "开课ID", display = false,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
@ -151,7 +153,7 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
pojo.setTeacherOpenCourseStudentSigninLogIp(this.getTeacherOpenCourseStudentSigninLogIp());
pojo.setTeacherOpenCourseStudentSigninLogTag(this.getTeacherOpenCourseStudentSigninLogTag());
pojo.setTeacherOpenCourseStudentSigninSettingId(this.getTeacherOpenCourseStudentSigninSettingId());
pojo.setTeacherOpenCourseStudentSigninSettingSessionTime(this.getTeacherOpenCourseStudentSigninSettingSessionTime());
pojo.setTeacherOpenCourseStudentSigninSettingSessionTime(DateUtil.parse(this.getTeacherOpenCourseStudentSigninSettingSessionTime()));
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
return pojo;
@ -216,11 +218,11 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
this.teacherOpenCourseStudentSigninSettingId = teacherOpenCourseStudentSigninSettingId;
}
public Date getTeacherOpenCourseStudentSigninSettingSessionTime() {
public String getTeacherOpenCourseStudentSigninSettingSessionTime() {
return teacherOpenCourseStudentSigninSettingSessionTime;
}
public void setTeacherOpenCourseStudentSigninSettingSessionTime(Date teacherOpenCourseStudentSigninSettingSessionTime) {
public void setTeacherOpenCourseStudentSigninSettingSessionTime(String teacherOpenCourseStudentSigninSettingSessionTime) {
this.teacherOpenCourseStudentSigninSettingSessionTime = (teacherOpenCourseStudentSigninSettingSessionTime);
}

@ -28,6 +28,9 @@ queryByCondition
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -107,6 +110,9 @@ queryByConditionQuery
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -331,6 +337,9 @@ getCourseInfoValues
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -491,6 +500,9 @@ getValues
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -556,6 +568,9 @@ getValuesQuery
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}

@ -39,6 +39,9 @@ queryByCondition
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id, #orgIdPlural#)
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@ -67,6 +70,7 @@ getValuesByQuery
select t.*
from resources_info t
left join course_info a on a.course_info_id = t.course_info_id
where 1=1
@if(!isEmpty(resourcesInfoIds)){
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
@ -95,6 +99,9 @@ getValuesByQuery
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(isEmpty(seeSelf) && !isEmpty(userId)){
and t.user_id =#userId#
@}

@ -7,6 +7,7 @@ queryByCondition
t.*
@}
from teacher_open_course_merge_student t
inner join student ta on ta.student_id = t.student_id and ta.student_status = 1
where 1=1
@//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("teacherOpenCourseMergeStudent.query")#
@ -40,6 +41,9 @@ queryByCondition
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentSnOrName)){
and concat(ta.student_name, ta.student_sn) like #'%'+studentSnOrName+'%'#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@ -55,6 +59,9 @@ queryByCondition
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(schoolClassIdPlural)){
and find_in_set(ta.class_id, #schoolClassIdPlural#)
@}
queryByConditionQuery

@ -15,16 +15,17 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
, trigger: 'click'
});
var data = [];
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/sessionDateList.json");
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/sessionDateList.json", {"teacherOpenCourseId": teacherOpenCourseId});
if(ret.code==0){
data = ret.data;
}
/*var getTpl = opTime_demo.innerHTML
var getTpl = opTime_demo.innerHTML
,view = document.getElementById('opTime_view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});*/
});
form.render();
var view ={
init:function(){
var that = this
@ -98,7 +99,7 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'],
},
{
field: 'teacherOpenCourseStudentSigninLogAddTime',
field: 'teacherOpenCourseStudentSigninSettingSessionTime',
title: '签到日期',
align: "center",
hideField: false,
@ -141,13 +142,13 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
}else{
}
})
});
//触发行单击事件
table.on('row(studentTable)', function(obj){
var param={
'teacherOpenCourseStudentSigninSettingId': teacherOpenCourseStudentSigninSettingId,
'teacherOpenCourseStudentSigninSettingSessionTime':$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
'studentSn':obj.data.studentInfo.studentSn
'studentId':obj.data.studentId
}
teacherOpenCourseStudentSigninLogTable.reload({
@ -165,6 +166,7 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
console.log($("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val())
var data = $("#searchForm").serializeJson();
teacherOpenCourseStudentSigninLogTable.reload({
where: data,
@ -273,10 +275,11 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
function getParam_s(){
var param = {
"teacherOpenCourseStudentSigninSettingSessionTime":$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
"classId":$("#studentForm select[name='classId']").val(),
"studentOrName":$("#studentForm input[name='studentOrName']").val(),
'teacherOpenCourseId':teacherOpenCourseId
"schoolClassIdPlural":$("#studentForm select[name='classId']").val(),
"studentSnOrName":$("#studentForm input[name='studentOrName']").val(),
'teacherOpenCourseId':teacherOpenCourseId
};
return param
}
exports('index',view);

@ -88,7 +88,7 @@
<label class="layui-form-label" style="width: 80px">归属课程:</label>
<div class="layui-input-block" style="margin-left: -80px;">
<layui:simpleDictSelect style='layui-input-block'
type="course_info.course_info_name.course_info_status=1,course_info_type=1,find_in_set(course_label_id,(select group_concat(course_label_id) from course_label where course_label_status = 1))"
type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find_in_set(course_label_id,(select group_concat(course_label_id) from course_label where course_label_status = 1))"
id="courseInfoIds" name="courseInfoId_1"
layFilter="select_courseInfoIds"/>
</div>
@ -135,7 +135,7 @@
<div class="layui-form-item">
<label class="layui-form-label" style="width: 80px">内容:</label>
<div class="layui-input-inline" style="width: 60% !important;min-width: 500px;">
<textarea id="resourcesInfoFiles" name="resourcesInfoFiles" style="display:none;"></textarea>
<textarea id="resourcesInfoContent" name="resourcesInfoContent" style="display:none;"></textarea>
</div>
</div>
</div>
@ -180,15 +180,16 @@
//拖拽上传
upload.render({
elem: '#resourcesUpload'
,url: Common.ctxPath + '/jlw/file/update.do' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
,url: Common.ctxPath + '/jlw/file/update.do'
,done: function(res){
layer.msg('上传成功');
layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', Common.ctxPath + res.data.src);
}
});
var uploadInst = upload.render({
elem: '#test1' //绑定元素
elem: '#test1' //上传图文
, url: Common.ctxPath + '/jlw/file/update.do'
,accept:'file'
, done: function (res) {
//上传完毕回调
layer.msg('上传成功');
@ -199,104 +200,110 @@
});
var courseInfoTable = function () {
var ret = Common.getAjax("/jlw/courseInfo/getCourseResources.json", {courseInfoId: courseInfoParentId});
var data = ret.data;
if (ret.code == 0) {
ret.data.forEach(item => {
item.resourcesInfo.forEach(function (e, i) {
e.courseInfoParentId = e.courseInfoId;
e.courseInfoId = 0;
e.courseInfoName = e.resourcesInfoName;
data.push(e);
})
});
}
treetable.render({
elem: '#courseInfoTable',
height: Lib.getTableHeight(1),
cellMinWidth: 100,
data: data,
treeColIndex: 0, //树形图标显示在第几列
treeSpid: courseInfoParentId, //最上级的父级id
treeIdName: 'courseInfoId', //id字段的名称
treePidName: 'courseInfoParentId', //父级节点字段
treeDefaultClose: true, //是否默认折叠
treeLinkage: true //父级展开时是否自动展开所有子级
, limit: 1000
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
return {
"code": res.status, //解析接口状态
"msg": res.message, //解析提示文本
"count": res.total, //解析数据长度
"data": res.rows.item //解析数据列表
};
}
, cols: [[ // 表头
{
field: 'LAY_TABLE_INDEX',
title: '序号',
align: "center",
},
{
field: 'courseInfoName',
title: '目录名称',
},
{
field: 'resourcesInfoType',
title: '资源类型',
align: "center",
templet: function (d) {
//资源类型(1视频 2PPT 3PDF 4链接 5图片)
var css = '';
var value = "";
if (d.resourcesInfoType === 1) {
value = "视频";
css = "shiping";
} else if (d.resourcesInfoType === 2) {
value = "PPT";
css = "ppt";
} else if (d.resourcesInfoType === 3) {
value = "PDF";
css = "pdf";
} else if (d.resourcesInfoType === 4) {
value = "链接";
css = "lianjie";
} else if (d.resourcesInfoType === 5) {
value = "图片";
css = "tupian";
}
return '<span class=' + css + '>' + value + '</span>';
layer.load(1);
var data=[];
setTimeout(function () {
var ret = Common.getAjax("/jlw/courseInfo/getCourseResources.json", {courseInfoId: courseInfoParentId});
data = ret.data;
if(ret.code == 0){
data.forEach(item => {
item.resourcesInfo.forEach(function (e, i) {
e.courseInfoParentId = e.courseInfoId;
e.courseInfoId = 0;
e.courseInfoName = e.resourcesInfoName;
data.push(e);
})
});
treetable.render({
elem: '#courseInfoTable',
height: Lib.getTableHeight(1),
cellMinWidth: 100,
data: data,
treeColIndex: 0, //树形图标显示在第几列
treeSpid: courseInfoParentId, //最上级的父级id
treeIdName: 'courseInfoId', //id字段的名称
treePidName: 'courseInfoParentId', //父级节点字段
treeDefaultClose: true, //是否默认折叠
treeLinkage: true //父级展开时是否自动展开所有子级
, limit: 1000
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
return {
"code": res.status, //解析接口状态
"msg": res.message, //解析提示文本
"count": res.total, //解析数据长度
"data": res.rows.item //解析数据列表
};
}
},
{
field: 'courseInfoId',
title: '操作',
align: "center",
templet: function (d) {
var htm = '';
if (d.courseInfoType === 2) {
htm += '<a class="layui-table-link" lay-event="add">添加子章节</a>';
} else if (d.courseInfoType === 3) {
htm += '<a class="layui-table-link" lay-event="updataResources">上传资源</a>';
htm += '<a class="layui-table-link" lay-event="addLine">添加链接</a>';
htm += '<a class="layui-table-link" lay-event="addPW">添加图文</a>';
}
if (!$.isEmpty(d.resourcesInfoType)) {
htm += '<a class="layui-table-link" lay-event="look">查看</a>';
htm += '<a class="layui-table-link" lay-event="update">上传</a>';
, cols: [[ // 表头
{
field: 'LAY_TABLE_INDEX',
title: '序号',
align: "center",
},
{
field: 'courseInfoName',
title: '目录名称',
},
{
field: 'resourcesInfoType',
title: '资源类型',
width:120,
align: "center",
templet: function (d) {
//资源类型(1视频 2PPT 3PDF 4链接 5图片)
var css = '';
var value = "";
if (d.resourcesInfoType === 1) {
value = "视频";
css = "shiping";
} else if (d.resourcesInfoType === 2) {
value = "PPT";
css = "ppt";
} else if (d.resourcesInfoType === 3) {
value = "PDF";
css = "pdf";
} else if (d.resourcesInfoType === 4) {
value = "链接";
css = "lianjie";
} else if (d.resourcesInfoType === 5) {
value = "图片";
css = "tupian";
}
return '<span class=' + css + '>' + value + '</span>';
}
},
{
field: 'courseInfoId',
title: '操作',
align: "center",
templet: function (d) {
var htm = '';
if (d.courseInfoType === 2) {
htm += '<a class="layui-table-link" lay-event="add">添加子章节</a>';
} else if (d.courseInfoType === 3) {
htm += '<a class="layui-table-link" lay-event="updataResources">上传资源</a>';
htm += '<a class="layui-table-link" lay-event="addLine">添加链接</a>';
htm += '<a class="layui-table-link" lay-event="addPW">添加图文</a>';
}
if (!$.isEmpty(d.resourcesInfoType)) {
htm += '<a class="layui-table-link" lay-event="look">查看</a>';
htm += '<a class="layui-table-link" lay-event="update">上传</a>';
}
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>';
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
htm += '<a class="layui-table-link" lay-event="move">拖动</a>';
if (!$.isEmpty(d.resourcesInfoType)) {
htm += '<a class="layui-table-link" lay-event="moveUp">上移</a>';
htm += '<a class="layui-table-link" lay-event="moveDown">下移</a>';
}
return htm;
}
}
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>';
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
htm += '<a class="layui-table-link" lay-event="move">拖动</a>';
if (!$.isEmpty(d.resourcesInfoType)) {
htm += '<a class="layui-table-link" lay-event="moveUp">上移</a>';
htm += '<a class="layui-table-link" lay-event="moveDown">下移</a>';
}
return htm;
}
}
]]
});
]]
});
layer.closeAll();
}
}, 10);
};
courseInfoTable();
/*新增章目录*/
@ -335,16 +342,15 @@
};
addOpen("",'子章节名称',"",param);
}else if (obj.event === 'updataResources') {//上传资源
var that = this;
updataResourcesOpen();
}else if (obj.event === 'addLine') {//添加链接
addLine();
addLine(data.courseInfoId);
} else if (obj.event === 'addPW') {//添加图文
addPW();
addPW(data.courseInfoId);
}else if (obj.event === 'look') {//查看
Lib.downloadFile(data);
}else if (obj.event === 'update') {//上传
updataResourcesOpenLocal();
updataResourcesOpen();
}else if(obj.event === 'edit'){
var title="章节目录";
var param = {};
@ -571,7 +577,7 @@
/*资源表格搜索*/
function searchList() {
var param = {
"courseInfoId": $("#edit_dialog select[name='courseInfoId_1']").val(),
"courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(),
"resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val()
};
resourcesTable.reload({
@ -583,7 +589,7 @@
}
/*添加链接*/
function addLine() {
function addLine(courseInfoId) {
layer.open({
type: 1,
title: "添加链接",
@ -591,7 +597,6 @@
btn: ['保存', '关闭'],
content: $("#addLine_dialog"),
success: function (layero, index) {
}, yes: function (index) {
var resourcesInfoName = $("#addLine_dialog input[name='resourcesInfoName']").val();
var resourcesInfoContent = $("#addLine_dialog input[name='resourcesInfoContent']").val();
@ -611,30 +616,41 @@
});
return;
}
var param = {resourcesInfoName: resourcesInfoName, resourcesInfoContent: resourcesInfoContent,resourcesInfoType:4};
Common.info("保存成功!!");
console.log(param)
layer.close(index);
return;
var ret = Common.postAjax("/jlw/courseInfo/edit.json", param);
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
}, function () {
if (ret.code == 0) {
layer.close(index);
}
var param = {
'resourcesInfoName': resourcesInfoName,
'resourcesInfoContent': resourcesInfoContent,
'resourcesInfoType':4,
'courseInfoId':courseInfoId
};
layer.load(0,{
shadeClose: false,
shade: [0.5]
});
setTimeout(function () {
var ret = Common.postAjax("/jlw/resourcesInfo/add.json", param);
layer.close();
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
},function () {
if (ret.code == 0) {
courseInfoTable();
layer.close(index);
}
});
}, 50);
}, btn2: function (index, layero) {
layer.close(index);
}
});
}
var courseInfoContent_ = layedit.build('resourcesInfoFiles', {height: 200}); //题干
var courseInfoContent_ = layedit.build('resourcesInfoContent', {height: 200}); //题干
/*添加图文*/
function addPW() {
function addPW(courseInfoId) {
layer.open({
type: 1,
title: "添加图文",
@ -645,30 +661,40 @@
}, yes: function (index) {
var resourcesInfoName = $("#addPW_dialog input[name='resourcesInfoName']").val();
var resourcesInfoFiles = layedit.getContent(courseInfoContent_);
var resourcesInfoContent = layedit.getContent(courseInfoContent_);
if ($.isEmpty(resourcesInfoName)) {
layer.msg("请输入资源名称!", {
layer.msg("请输入图文名称!", {
offset: ['50%'],
icon: 2,
time: 2000 //2秒关闭如果不配置默认是3秒
});
return;
}
var param = {resourcesInfoName: resourcesInfoName, resourcesInfoFiles: resourcesInfoFiles};
Common.info("保存成功!!");
console.log(param)
layer.close(index);
return;
var ret = Common.postAjax("/jlw/courseInfo/edit.json", param);
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
}, function () {
if (ret.code == 0) {
layer.close(index);
}
var param = {
'resourcesInfoName': resourcesInfoName,
'resourcesInfoContent': resourcesInfoContent,
'resourcesInfoType':5,
'courseInfoId':courseInfoId
};
layer.load(0,{
shadeClose: false,
shade: [0.5]
});
setTimeout(function () {
var ret = Common.postAjax("/jlw/resourcesInfo/add.json", param);
layer.close();
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
}, function () {
if (ret.code == 0) {
layer.close(index)
courseInfoTable();
}
});
}, 10);
}, btn2: function (index, layero) {
layer.close(index);
}

@ -29,12 +29,7 @@
<div class="layui-inline">
<label class="layui-form-label">日期筛选</label>
<div class="layui-input-inline">
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="" id="opTime_view">
<option value="">请选择</option>
<option value="2022-07-07">2022-07-07</option>
<option value="2022-08-07">2022-08-07</option>
<option value="2022-09-07">2022-09-07</option>
</select>
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="" id="opTime_view"> </select>
<!--<input type="text" name="" placeholder="teacherOpenCourseStudentSigninSettingSessionTime"
autocomplete="off" class="layui-input" id="test5">-->
</div>
@ -63,7 +58,12 @@
</div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/>
<!--#} -->
<script id="opTime_demo" type="text/html">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item}}">{{item}}</option>
{{# }); }}
</script>
<!--<script type="text/html" id="toolbar_teacherOpenCourseStudentSigninLog">
<div class="layui-btn-container">
<div class="layui-btn-group" >

Loading…
Cancel
Save