diff --git a/admin-core/src/main/resources/static/plugins/simple-uploader/public/app.js b/admin-core/src/main/resources/static/plugins/simple-uploader/public/app.js index 013cbf19..055e6286 100644 --- a/admin-core/src/main/resources/static/plugins/simple-uploader/public/app.js +++ b/admin-core/src/main/resources/static/plugins/simple-uploader/public/app.js @@ -26,7 +26,7 @@ r.assignBrowse($('.uploader-browse')[0]); r.assignBrowse($('.uploader-browse-folder')[0], true); r.assignBrowse($('.uploader-browse-image')[0], false, false, {accept: 'image/*'}); - + r.assignBrowse($('.uploader-browse-pvwpm')[0], false, false, {accept: ['.ppt', '.pptx', '.doc', '.docx', '.pdf', '.mp4']}); // Handle file add event r.on('filesAdded', function (files, fileList) { // Show progress bar 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 856069e6..97a35cf7 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/add.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/add.js @@ -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, diff --git a/web/src/main/resources/templates/jlw/resourcesInfo/add.html b/web/src/main/resources/templates/jlw/resourcesInfo/add.html index 2d8729c6..5a817ae9 100644 --- a/web/src/main/resources/templates/jlw/resourcesInfo/add.html +++ b/web/src/main/resources/templates/jlw/resourcesInfo/add.html @@ -75,9 +75,11 @@ ondrop="jQuery(this).removeClass('uploader-dragover');"> - + @@ -115,8 +117,7 @@
- +
@@ -145,10 +146,8 @@
-
-
- -
+
+