diff --git a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js index c092b962..c691f469 100644 --- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js @@ -86,7 +86,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT ,choose: function(obj){ $("#mp4Info").append('
\n' + '\n' + - '\n' + + '\n' + '\n' + '
\n' + '
\n' + @@ -131,14 +131,14 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT elem: '#upload-normalPPT' ,url: Common.ctxPath +'/jlw/file/update.do' ,accept:'file' - ,exts:'ppt|pps|pptx|ppsx|pot|ppa' + ,exts:'ppt|pps|pptx|ppsx|pot|ppa|pdf' , progress: function(value) { element.progress('progressBarPPT',value + '%'); } ,choose: function(obj){ $("#pptInfo").append('
\n' + '\n' + - '\n' + + '\n' + '\n' + '
\n' + '
\n' + @@ -191,9 +191,9 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT choose: function(obj){ $("#fileInfo").append('
\n' + '\n' + - '\n' + + '\n' + '\n' + - '
\n' + + '
\n' + '
\n' + '
\n' + 'X\n' + diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourse/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourse/index.js index 9db00dce..cef1dccb 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourse/index.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourse/index.js @@ -192,6 +192,12 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }); }); } else if (obj.event == "toPaike") { + var teacherOpenCourseScheduleSessionTagTable = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionTag/list.json').data;//开课节次数据表格 + var teacherOpenCourseScheduleSessionClassTable = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionClass/list.json').data; + if(teacherOpenCourseScheduleSessionTagTable.length <=0 || teacherOpenCourseScheduleSessionClassTable.length<=0){ + Common.info("课次未设置 / 排课教室未设置,请先点击 ' 初始化排课条件设置 '进行设置"); + return; + } var url = "/jlw/teacherOpenCourseScheduleSession/add.do?teacherOpenCourseId=" + data.teacherOpenCourseId; Common.openDlg(url, "排课列表>" + data.teacherOpenCourseTitle + ">编辑"); } else if (obj.event == "enable") { diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js index f64e289b..d55bb001 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js @@ -21,6 +21,10 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas var selectResourcesQuestion = []; var tableData4 = []; var resourcesQuestionIds = ""; //选中题目id + var resourcesInfoTable = [];//资源库的table + var resourcesInfoShowTable = []//选中视频资源后展示的table + var resourcesInfoShowPPTTable = [];//选中PPT资源后展示的table + var checkStatusData = [];//资源选中data var teacherOpenCourseId = $("input[name=teacherOpenCourseId]").val(); var typeInfo = $("#taskTypeInfo input[name='taskType']:checked").val(); //当前操作的类型 @@ -74,7 +78,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas '\n' + '\n' + '\n' + - '
\n' + + '
\n' + '
\n' + '
\n' + 'X\n' + @@ -116,7 +120,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas elem: '#upload-normalPPT' ,url: Common.ctxPath +'/jlw/file/update.do' ,accept:'file' - ,exts:'ppt|pps|pptx|ppsx|pot|ppa' + ,exts:'ppt|pps|pptx|ppsx|pot|ppa|pdf' , progress: function(value) { element.progress('progressBarPPT',value + '%'); } @@ -125,11 +129,12 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas '\n' + '\n' + '\n' + - '
\n' + - '
\n' + + '
\n' + + '
\n' + '
\n' + 'X\n' + '
'); + element.init();//进度条更新 }, before: function(obj) { obj.preview(function(index, file, result) { @@ -177,11 +182,12 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas '\n' + '\n' + '\n' + - '
\n' + - '
\n' + + '
\n' + + '
\n' + '
\n' + 'X\n' + '
'); + element.init();//进度条更新 }, before: function(obj) { obj.preview(function(index, file, result) { @@ -537,6 +543,8 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas editor.setToolbarAutoFixed(false); } } + resourcesInfoShowTable.reload({data:[]}); + resourcesInfoShowPPTTable.reload({data:[]}); // $("input[name='taskTitle']").val(""); // $("input[name='taskScore']").val(""); // $("input[name='taskOrder']").val(""); @@ -602,5 +610,222 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas getScoreInfo(); }); } + + //视频资源库button + $("#videoClick").click(function (obj) { + updataResourcesOpenRe(1); + }); + + //PPT资源库button + $("#pptClick").click(function (obj) { + updataResourcesOpenRe(2); + }); + + /*资源库上传弹出框*/ + function updataResourcesOpenRe(resourcesInfoType) { + checkStatusData = []; + layer.open({ + type: 1, + title: "资源库上传", + shadeClose: true, + btn: ['保存', '关闭'], + btnAlign: 'c', + area: ['820px', '600px'], + content: $("#edit_dialog"), + success: function (layero, index) { + loadResourcesInfo(resourcesInfoType); + $(".search").unbind(); + $(".search").click(function () {searchList(resourcesInfoType);}); //搜索 + table.reload('resourcesInfoTable');//刷新table + }, yes: function (index) { + var checkStatus = table.checkStatus("resourcesInfoTable"); //获取选中行状态 + var dataNew = checkStatus.data, ids = Common.concatBatchId(dataNew, "resourcesInfoId"); //获取选中行数据 + if(resourcesInfoType == 1){ + resourcesInfoShowInfo(dataNew) + }else if(resourcesInfoType == 2){ + resourcesInfoShowPPTInfo(dataNew) + } + + form.render() + layer.close(index); + }, btn2: function (index, layero) { + layer.close(index); + } + }); + } + + //资源库表格 + function loadResourcesInfo(resourcesInfoType) { + $("#edit_dialog input[name='resourcesInfoName']").val(""); + resourcesInfoTable = table.render({ + elem: '#resourcesInfoTable', + height: Lib.getTableHeight(), + cellMinWidth: 100, + method: 'post', + even: true, + //url: Common.ctxPath + '/jlw/resourcesInfo/list.json' // 数据接口 + url: Common.ctxPath + '/jlw/resourcesInfo/resourcesList.json' // 数据接口 + , where: getParamRe(resourcesInfoType) + , page: Lib.tablePage // 开启分页 + , limit: 10, + cols: [[ // 表头 + { + type: 'checkbox' + }, + { + field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;" + }, + { + field: 'courseInfoParentParentName', title: '归属课程', align: "center", width: 150 + }, + { + field: 'resourcesInfoType', width: 150, 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 ? "图文" : '-'; + return '' + text + ''; + } + }, + { + field: 'userId', + title: '操作', + width: 80, + align: "center", + templet: function (d) { + var htm = ''; + return htm; + } + } + ]] + }); + table.on('tool(resourcesInfoTable)', function (obj) { + var data = obj.data; + if (obj.event === 'previewPage') { //预览 + Lib.downloadFile(data); + } + }); + table.on('checkbox(resourcesInfoTable)', function(obj){ + checkStatusData = table.checkStatus("resourcesInfoTable").data; + var htm = "已选中:"; + var resourcesInfoTable = obj.data; + if(obj.checked){ + htm += checkStatusData.length; + //按钮逻辑Lib.buttonEnable() + }else{ + htm += checkStatusData.length; + } + $("#checkNumber").html(htm) + }) + } + + function resourcesInfoShowInfo(data) { + resourcesInfoShowTable = table.render({ + elem: '#resourcesInfoShowTable', + height: Lib.getTableHeight(), + cellMinWidth: 100, + method: 'post', + even: true, + data:data, + cols: [[ // 表头 + { + field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;" + }, + { + field: 'courseInfoParentParentName', title: '归属课程', align: "center", width: 150 + }, + { + field: 'resourcesInfoType', width: 150, 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 ? "图文" : '-'; + return '' + text + ''; + } + }, + { + field: 'userId', + title: '操作', + width: 160, + align: "center", + templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + ]] + }); + table.on('tool(resourcesInfoShowTable)', function (obj) { + var data = obj.data; + if (obj.event === 'previewPage') { //预览 + Lib.downloadFile(data); + }else if(obj.event === 'del'){ + checkStatusData.splice(data, 1); // 删除 + resourcesInfoShowTable.reload({data:checkStatusData}); + } + }); + };function resourcesInfoShowPPTInfo(data) { + resourcesInfoShowPPTTable = table.render({ + elem: '#resourcesInfoShowPPTTable', + height: Lib.getTableHeight(), + cellMinWidth: 100, + method: 'post', + even: true, + data:data, + cols: [[ // 表头 + { + field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;" + }, + { + field: 'courseInfoParentParentName', title: '归属课程', align: "center", width: 150 + }, + { + field: 'resourcesInfoType', width: 150, 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 ? "图文" : '-'; + return '' + text + ''; + } + }, + { + field: 'userId', + title: '操作', + width: 160, + align: "center", + templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + ]] + }); + table.on('tool(resourcesInfoShowPPTTable)', function (obj) { + var data = obj.data; + if (obj.event === 'previewPage') { //预览 + Lib.downloadFile(data); + }else if(obj.event === 'del'){ + checkStatusData.splice(data, 1); // 删除 + resourcesInfoShowPPTTable.reload({data:checkStatusData}); + } + }); + } + + + + /*资源表格搜索*/ + /*资源表格搜索*/ + function searchList(resourcesInfoType) { + resourcesInfoTable.reload({ + where: getParamRe(resourcesInfoType), + page: { + curr: 1 + } + }); + } + + /*资源库搜索条件*/ + function getParamRe(resourcesInfoType){ + var param = { + "courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(), + "resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val(), + "resourcesInfoType":resourcesInfoType + }; + return param; + } + exports('add',view); }); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js index 49ac676c..98e9be05 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js @@ -166,6 +166,12 @@ layui.define(['form', 'laydate', 'table', 'laytpl'], function (exports) { initToolBar: function () { toolbar = { add: function () { + var teacherOpenCourseScheduleSessionTagTable = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionTag/list.json').data;//开课节次数据表格 + var teacherOpenCourseScheduleSessionClassTable = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionClass/list.json').data; + if(teacherOpenCourseScheduleSessionTagTable.length <=0 || teacherOpenCourseScheduleSessionClassTable.length<=0){ + Common.info("课次未设置 / 排课教室未设置,请先点击 ' 初始化排课条件设置 '进行设置"); + return; + } var url = "/jlw/teacherOpenCourseScheduleSession/add.do"; Common.openDlg(url, "排课管理>新增排课"); }, diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html index 5abbfae0..b3c3adaa 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html @@ -117,7 +117,10 @@
添加视频
- +
+ + +
@@ -139,6 +142,9 @@
+
+
+
@@ -195,7 +201,10 @@
添加文档
- +
+ + +
@@ -218,6 +227,9 @@
+
+
+
@@ -644,6 +656,7 @@ type="button" id="addButton" lay-submit="" lay-filter="form">确定
+