From 39e88433ef91f2c4d4eb23eebb777fd09b265614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Fri, 14 Oct 2022 19:21:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E6=93=8D=EF=BC=88?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E8=AE=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/jlw/handsOn/index.js | 44 ++++++++++++++++--- .../js/jlw/resourcesCompetition/index.js | 5 +++ .../static/js/jlw/resourcesTraining/index.js | 8 +++- .../templates/jlw/handsOn/index.html | 6 +-- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/web/src/main/resources/static/js/jlw/handsOn/index.js b/web/src/main/resources/static/js/jlw/handsOn/index.js index ce41a0ff..e8052707 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/index.js +++ b/web/src/main/resources/static/js/jlw/handsOn/index.js @@ -68,7 +68,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { width: 260, templet: function (d) { var htm = '上架'; - htm += '下架'; + htm += '下架'; htm += '编辑'; htm += '添加任务'; htm += '删除'; @@ -107,6 +107,22 @@ layui.define(['form', 'laydate', 'table'], function (exports) { Lib.doSearchForm($("#searchForm"), handsOnTable, 1); view.initToolBar() }, + allDel:function(){ + layui.use(['del'], function () { + var delView = layui.del; + delView.delBatch(); + }); + }, + up:function () { + var data = Common.getMoreDataFromTable(table,"handsOnTable"); + var ids = Common.concatBatchId(data, "handsOnId"); + upDrown(1,ids); + }, + drown:function () { + var data = Common.getMoreDataFromTable(table,"handsOnTable"); + var ids = Common.concatBatchId(data, "handsOnId"); + upDrown(0,ids); + } } //触发事件 $('.ext-toolbar').on('click', function () { @@ -137,22 +153,36 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }); } else if (obj.event === "addTask") { var url = "/jlw/handsOnSimulationTasks/add.do?bussiness_id=" + data.handsOnId; - Common.openDlg(url, "HandsOnSimulationTasks管理>" + data.handsOnId + ">编辑"); + Common.openDlg(url, "课程实训案例管理>新增课程实训案例>添加实训任务"); }else if (obj.event === "up") { - alert('up') - } else if (obj.event === "down") { - alert('down') + upDrown(1,data.handsOnId); + } else if (obj.event === "drown") { + upDrown(0,data.handsOnId); } }) }; + function upDrown(status,ids){ + layer.confirm(status == 1?'是否确定上架?':'是否确定下架?', function (index) { + var ret = Common.postAjax(status == 1?"/xx.json":"/dd.json", {ids: ids}); + layer.msg(ret.code == 0 ? "下架成功!" : ret.msg, { + offset: ['50%'], + icon: ret.code == 0 ? 1 : 2, + time: 1500 //2秒关闭(如果不配置,默认是3秒) + }, function () { + if (ret.code == 0) { + Lib.tableRefresh(); + } + }); + }); + }; //选择归属课程 并且根据选择的课程查询章节 resourcesQuestionIdsIsNotNull:查询题目不为空的章节 form.on('select(select_courseInfoIds)', function (obj) { - Lib.getCourseInfo($("select[name='courseInfoId_1']"), obj.value, 1); + Lib.getCourseInfo($("select[name='courseInfoId']"), obj.value, 1); }); //选择归属课程 并且根据选择的课程查询章节 form.on('select(select_courseInfoIds_)', function (obj) { - Lib.getCourseInfo($("select[name='courseInfoId_2']"), obj.value); + Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value); }); exports('index', view); diff --git a/web/src/main/resources/static/js/jlw/resourcesCompetition/index.js b/web/src/main/resources/static/js/jlw/resourcesCompetition/index.js index 6b44c051..c0eb3559 100644 --- a/web/src/main/resources/static/js/jlw/resourcesCompetition/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesCompetition/index.js @@ -86,6 +86,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, search: function () { Lib.doSearchForm($("#searchForm"), resourcesCompetitionTable, 1); + },allDel:function(){ + layui.use(['del'], function () { + var delView = layui.del; + delView.delBatch(); + }); } }; $('.ext-toolbar').on('click', function () { diff --git a/web/src/main/resources/static/js/jlw/resourcesTraining/index.js b/web/src/main/resources/static/js/jlw/resourcesTraining/index.js index 47cc7624..d0e8f06b 100644 --- a/web/src/main/resources/static/js/jlw/resourcesTraining/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesTraining/index.js @@ -88,7 +88,13 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, search: function () { Lib.doSearchForm($("#searchForm"), resourcesTrainingTable, 1); - } + }, + allDel:function(){ + layui.use(['del'], function () { + var delView = layui.del; + delView.delBatch(); + }); + }, }; $('.ext-toolbar').on('click', function () { var type = $(this).data('type'); diff --git a/web/src/main/resources/templates/jlw/handsOn/index.html b/web/src/main/resources/templates/jlw/handsOn/index.html index 1a2ae18b..eba1e00a 100644 --- a/web/src/main/resources/templates/jlw/handsOn/index.html +++ b/web/src/main/resources/templates/jlw/handsOn/index.html @@ -14,7 +14,7 @@
@@ -23,7 +23,7 @@
+ id="courseChildNode" name="courseChildNode" layFilter="select_courseInfoIds_"/>
@@ -48,7 +48,7 @@ class="layui-icon">批量删除 批量上架 - 批量下架