|
|
|
@ -11,7 +11,7 @@ layui.define([ 'form', 'laydate', 'table','element','upload','resourcesInfoApi',
|
|
|
|
|
imgUrl:Common.ctxPath
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
layedit.build('resourcesInfoContent',{height: 200});
|
|
|
|
|
var courseInfoContent_ = layedit.build('resourcesInfoContent',{height: 400});
|
|
|
|
|
|
|
|
|
|
var view = {
|
|
|
|
|
init:function(){
|
|
|
|
@ -30,24 +30,40 @@ layui.define([ 'form', 'laydate', 'table','element','upload','resourcesInfoApi',
|
|
|
|
|
var ret = "";
|
|
|
|
|
if($.isEmpty(resourcesInfoId)){
|
|
|
|
|
var resourcesInfoJson = new Array();
|
|
|
|
|
$("#demoList tr").each(function (){
|
|
|
|
|
var fileName = $(this).find("input[name='fileName']").val();
|
|
|
|
|
var format = fileName.substr((~-fileName.lastIndexOf('.') >>> 0) + 2).toLowerCase();//获取文件后缀小写
|
|
|
|
|
// var resourcesInfoType = ''; //资源类型(详细见数据字典,resources_info_type)
|
|
|
|
|
// if('、avi、wmv、mpeg、mp4、mov、mkv、flv、f4v、m4v、rmvb、rm、3gp、dat、ts、mts、vob、'.indexOf("、"+format+"、") >= 0){
|
|
|
|
|
// resourcesInfoType = 1;
|
|
|
|
|
// }else if('、pdf、xls、xlsx、doc、docx、ppt、pptx、'.indexOf("、"+format+"、") >= 0){
|
|
|
|
|
// resourcesInfoType = 2;
|
|
|
|
|
// }else {
|
|
|
|
|
// resourcesInfoType = 3;
|
|
|
|
|
// }
|
|
|
|
|
if(resourcesInfoType == 4){
|
|
|
|
|
resourcesInfoJson.push({
|
|
|
|
|
courseInfoId:courseInfoId,
|
|
|
|
|
resourcesInfoContent:$(this).find("input[name='imgFile']").val(),
|
|
|
|
|
resourcesInfoName:fileName,
|
|
|
|
|
resourcesInfoContent:$("#addLine_dialog input[name='resourcesInfoContent']").val(),
|
|
|
|
|
resourcesInfoName:$("#addLine_dialog input[name='resourcesInfoName']").val(),
|
|
|
|
|
resourcesInfoType:resourcesInfoType
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}else if(resourcesInfoType == 5){
|
|
|
|
|
resourcesInfoJson.push({
|
|
|
|
|
courseInfoId:courseInfoId,
|
|
|
|
|
resourcesInfoContent:layedit.getContent(courseInfoContent_),
|
|
|
|
|
resourcesInfoName:$("#addPW_dialog input[name='resourcesInfoName']").val(),
|
|
|
|
|
resourcesInfoType:resourcesInfoType
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
$("#demoList tr").each(function (){
|
|
|
|
|
var fileName = $(this).find("input[name='fileName']").val();
|
|
|
|
|
var format = fileName.substr((~-fileName.lastIndexOf('.') >>> 0) + 2).toLowerCase();//获取文件后缀小写
|
|
|
|
|
// var resourcesInfoType = ''; //资源类型(详细见数据字典,resources_info_type)
|
|
|
|
|
// if('、avi、wmv、mpeg、mp4、mov、mkv、flv、f4v、m4v、rmvb、rm、3gp、dat、ts、mts、vob、'.indexOf("、"+format+"、") >= 0){
|
|
|
|
|
// resourcesInfoType = 1;
|
|
|
|
|
// }else if('、pdf、xls、xlsx、doc、docx、ppt、pptx、'.indexOf("、"+format+"、") >= 0){
|
|
|
|
|
// resourcesInfoType = 2;
|
|
|
|
|
// }else {
|
|
|
|
|
// resourcesInfoType = 3;
|
|
|
|
|
// }
|
|
|
|
|
resourcesInfoJson.push({
|
|
|
|
|
courseInfoId:courseInfoId,
|
|
|
|
|
resourcesInfoContent:$(this).find("input[name='imgFile']").val(),
|
|
|
|
|
resourcesInfoName:fileName,
|
|
|
|
|
resourcesInfoType:resourcesInfoType
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
ret = Common.postAjax("/jlw/resourcesInfo/addAll.json",{
|
|
|
|
|
resourcesInfoJson:JSON.stringify(resourcesInfoJson),
|
|
|
|
|
courseId:courseId,
|
|
|
|
|