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 6c31b7c5..aeef52d7 100644 --- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js @@ -572,8 +572,10 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT } if(obj.value == "2"||obj.value == "1"){ if(!$.isEmpty(resourcesInfoShowTable) || !$.isEmpty(resourcesInfoShowPPTTable)){ - resourcesInfoShowTable.reload({data:[]}); - resourcesInfoShowPPTTable.reload({data:[]}); + /*resourcesInfoShowTable.reload({data:[]}); + resourcesInfoShowPPTTable.reload({data:[]});*/ + resourcesInfoShowTable = []; + resourcesInfoShowPPTTable = []; } } @@ -647,7 +649,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT }else{ tableData4 = []; } - console.log(tableData4) + var getTpl = tableData4_demo.innerHTML ,view = document.getElementById('tableData4_view'); laytpl(getTpl).render({list:tableData4}, function(html){ @@ -663,11 +665,11 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT //PPT资源库button $("#pptClick").click(function (obj) { - updataResourcesOpenRe(2); + updataResourcesOpenRe('','2,3'); }); /*资源库上传弹出框*/ - function updataResourcesOpenRe(resourcesInfoType) { + function updataResourcesOpenRe(resourcesInfoType,resourcesInfoTypePlural) { checkStatusData = []; layer.open({ type: 1, @@ -678,16 +680,16 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT area: ['820px', '600px'], content: $("#edit_dialog"), success: function (layero, index) { - loadResourcesInfo(resourcesInfoType); + loadResourcesInfo(resourcesInfoType,resourcesInfoTypePlural); $(".search").unbind(); - $(".search").click(function () {searchList(resourcesInfoType);}); //搜索 + $(".search").click(function () {searchList(resourcesInfoType,resourcesInfoTypePlural);}); //搜索 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){ + }else if(resourcesInfoTypePlural == '2,3'){ resourcesInfoShowPPTInfo(dataNew) } @@ -700,7 +702,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT } //资源库表格 - function loadResourcesInfo(resourcesInfoType) { + function loadResourcesInfo(resourcesInfoType,resourcesInfoTypePlural) { $("#edit_dialog input[name='resourcesInfoName']").val(""); resourcesInfoTable = table.render({ elem: '#resourcesInfoTable', @@ -710,7 +712,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT even: true, //url: Common.ctxPath + '/jlw/resourcesInfo/list.json' // 数据接口 url: Common.ctxPath + '/jlw/resourcesInfo/resourcesList.json' // 数据接口 - , where: getParamRe(resourcesInfoType) + , where: getParamRe(resourcesInfoType,resourcesInfoTypePlural) , page: Lib.tablePage // 开启分页 , limit: 10, cols: [[ // 表头 @@ -853,9 +855,9 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT /*资源表格搜索*/ /*资源表格搜索*/ - function searchList(resourcesInfoType) { + function searchList(resourcesInfoType,resourcesInfoTypePlural) { resourcesInfoTable.reload({ - where: getParamRe(resourcesInfoType), + where: getParamRe(resourcesInfoType,resourcesInfoTypePlural), page: { curr: 1 } @@ -863,11 +865,13 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT } /*资源库搜索条件*/ - function getParamRe(resourcesInfoType){ + function getParamRe(resourcesInfoType,resourcesInfoTypePlural){ var param = { - "courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(), - "resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val(), - "resourcesInfoType":resourcesInfoType + "courseInfoId_0": $("#edit_dialog select[name='courseInfoId_0']").val(), + "resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val(), + "resourcesInfoType":resourcesInfoType, + "resourcesInfoTypePlural":resourcesInfoTypePlural + }; return param; } 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 e3b8f1bd..03a5e3c7 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js @@ -630,11 +630,11 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas //PPT资源库button $("#pptClick").click(function (obj) { - updataResourcesOpenRe(); + updataResourcesOpenRe('','2,3'); }); /*资源库上传弹出框*/ - function updataResourcesOpenRe(resourcesInfoType) { + function updataResourcesOpenRe(resourcesInfoType,resourcesInfoTypePlural) { checkStatusData = []; layer.open({ type: 1, @@ -645,16 +645,16 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas area: ['820px', '600px'], content: $("#edit_dialog"), success: function (layero, index) { - loadResourcesInfo(resourcesInfoType); + loadResourcesInfo(resourcesInfoType,resourcesInfoTypePlural); $(".search").unbind(); - $(".search").click(function () {searchList(resourcesInfoType);}); //搜索 + $(".search").click(function () {searchList(resourcesInfoType,resourcesInfoTypePlural);}); //搜索 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){ + }else if(resourcesInfoTypePlural == '2,3'){ resourcesInfoShowPPTInfo(dataNew) } @@ -820,9 +820,9 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas /*资源表格搜索*/ /*资源表格搜索*/ - function searchList(resourcesInfoType) { + function searchList(resourcesInfoType,resourcesInfoTypePlural) { resourcesInfoTable.reload({ - where: getParamRe(resourcesInfoType), + where: getParamRe(resourcesInfoType,resourcesInfoTypePlural), page: { curr: 1 } @@ -830,11 +830,12 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas } /*资源库搜索条件*/ - function getParamRe(resourcesInfoType){ + function getParamRe(resourcesInfoType,resourcesInfoTypePlural){ var param = { "courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(), "resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val(), - "resourcesInfoType":resourcesInfoType + "resourcesInfoType":resourcesInfoType, + "resourcesInfoTypePlural":resourcesInfoTypePlural }; return param; } diff --git a/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html b/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html index 7829fc0a..0d60e694 100644 --- a/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html +++ b/web/src/main/resources/templates/jlw/handsOnSimulationTasks/add.html @@ -206,7 +206,7 @@