From b7f21f835305d76bb02bd815c9a725af43dc96bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Tue, 13 Jun 2023 04:20:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=A1=88=E4=BE=8B=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/js/jlw/handsOn/add.js | 8 ++++++-- .../main/resources/static/js/jlw/handsOn/index.js | 15 ++++++++++----- .../static/js/jlw/resourcesInfo/index.js | 8 +++++--- .../resources/templates/jlw/handsOn/index.html | 15 +++++++++++---- .../templates/jlw/resourcesInfo/index.html | 2 +- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/web/src/main/resources/static/js/jlw/handsOn/add.js b/web/src/main/resources/static/js/jlw/handsOn/add.js index c7f6de2e..8ad3eacc 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/add.js +++ b/web/src/main/resources/static/js/jlw/handsOn/add.js @@ -104,10 +104,14 @@ layui.define(['form', 'laydate', 'table','laytpl','upload','layedit', 'handsOnAp } } - //选择归属课程 并且根据选择的课程查询章节 + + //选择归属课程 并且根据选择的课程查询章节 resourcesQuestionIdsIsNotNull:查询题目不为空的章节 form.on('select(select_courseInfoIds)', function (obj) { - Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value); + let sourceType = $("select[name='courseChildNode']").find('option:selected').attr("status"); + let courseInfoType = 2;//courseInfoType(2 章节,3 节) + Lib.getCourseInfo($("select[name='courseChildNode']"), obj.value,courseInfoType,sourceType, 1); }); + $(".button_add").click(() => { handsOnId = $("#addForm input[name='handsOnId']").val(); if (!$.isEmpty(handsOnId)){ 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 6ae3b74c..724f25f0 100644 --- a/web/src/main/resources/static/js/jlw/handsOn/index.js +++ b/web/src/main/resources/static/js/jlw/handsOn/index.js @@ -3,6 +3,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { var laydate = layui.laydate; var table = layui.table; var handsOnTable = null; + var isAdmin = $("#isAdmin").val()=='true'?true:false; window.loadList = function () {//重新加载实训任务列表 console.log("进入了index页面") } @@ -47,7 +48,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { hideField: false, hide: $.isEmpty(sx_['handsOnName']) ? false : sx_['handsOnName'], }, { - field: 'systemCourseInfoIdText', + field: $.isEmpty('systemCourseInfoIdText')?'systemCourseInfoIdText':"teacherOpenCourseTitle", title: '归属课程', align: "center" }, { @@ -82,13 +83,15 @@ layui.define(['form', 'laydate', 'table'], function (exports) { fixed: 'right', width: 260, templet: function (d) { - var css = $("#isAdmin").val() === 'true' ? "" : "display: none;"; + var css = isAdmin? "" : "display: none;"; var htm = '上架'; htm += '下架'; // htm += '编辑'; - htm += ''+($("#isAdmin").val() === 'true' ?'编辑':'查看')+''; + htm += ''+ (isAdmin?'编辑':'查看')+''; htm += '添加任务'; - htm += '删除'; + if(d.dataType == 'FACULTY_ADD'|| isAdmin){ + htm += '删除'; + } return htm; } } @@ -171,7 +174,9 @@ layui.define(['form', 'laydate', 'table'], function (exports) { } else if (obj.event === "addTask") {//添加任务 // var url = "/jlw/handsOn/add.do?handsOnId=" + data.handsOnId+'&sign=1'; // Common.openDlg(url, "课程实训案例管理>新增课程实训案例>添加实训任务"); - var url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId + '&courseInfoId=' + data.courseInfoId; + var courseInfoId = data.dataType === 'FACULTY_ADD'?data.teacherOpenCourseId:data.systemCourseInfoId + var url = "/jlw/handsOnSimulationTasks/add.do?handsOnId=" + data.handsOnId + '&courseInfoId=' + courseInfoId; + Common.openDlg(url); } else if (obj.event === "up") { upDrown("1", data.handsOnId); diff --git a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js index 2157a8e8..34448d0f 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js @@ -6,7 +6,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) { courseInfoMap = {},//课程map zjMap = {},//章节map selectMap = {},//已经生成过select的map - + isAdmin = $("#isAdmin").val()=='true'?true:false, htmY = '' + htmO + '' + ""; //console.log($("#isUser").val()) }else { @@ -190,7 +190,9 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }else { htm += '预览'; } - htm += '删除'; + if(d.sourceType == 1 || isAdmin){ + htm += '删除'; + } return htm; } } diff --git a/web/src/main/resources/templates/jlw/handsOn/index.html b/web/src/main/resources/templates/jlw/handsOn/index.html index cf8a0787..95e32ef0 100644 --- a/web/src/main/resources/templates/jlw/handsOn/index.html +++ b/web/src/main/resources/templates/jlw/handsOn/index.html @@ -47,14 +47,14 @@ class="layui-input" > +