From d652b741a30cacabb9b1e8bc2e5cdc8f5bb32fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Sat, 8 Jul 2023 14:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E6=93=8D-=E5=8F=82?= =?UTF-8?q?=E6=95=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/jlw/handsOnSimulationTasks/add.js | 9 ++++++- .../static/js/jlw/resourcesInfo/index.js | 4 +-- .../static/js/jlw/resourcesQuestion/index.js | 26 ++++++++++++++----- .../templates/jlw/courseInfo/index.html | 8 +++++- .../jlw/resourcesQuestion/index.html | 6 ++--- 5 files changed, 39 insertions(+), 14 deletions(-) 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 a5176384..c58a4547 100644 --- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js +++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js @@ -313,6 +313,13 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT }); }); resourcesQuestionTable= function(){ + var isAdmin = '${user.get().isAdmin}' + var addType; + if(isAdmin){ + addType = 'ADMIN_ADD'; + }else { + addType = 'FACULTY_ADD'; + } resourcesQuestionTable1=table.render({ elem: '#resourcesQuestionTable', cellMinWidth: 100, @@ -322,7 +329,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口 , page: Lib.tablePage // 开启分页 , limit: 8 - , where: {"courseInfoParentId": courseInfoIds} + , where: {"courseInfoParentId": courseInfoIds,'addType':addType} ,cols: [[ // 表头 { type: 'checkbox', align: "center" 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 622e39b9..f8141728 100644 --- a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js @@ -215,9 +215,9 @@ layui.define(['form', 'laydate', 'table'], function (exports) { } // htm += '' + (d.resourcesInfoType == 3 ? '下载' : '预览') + ''; if(d.resourcesInfoType == 4){ - htm += '预览'; + htm += '查看'; }else { - htm += '预览'; + htm += '查看'; } if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){ htm += '删除'; diff --git a/web/src/main/resources/static/js/jlw/resourcesQuestion/index.js b/web/src/main/resources/static/js/jlw/resourcesQuestion/index.js index 2c68cf80..57208f94 100644 --- a/web/src/main/resources/static/js/jlw/resourcesQuestion/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesQuestion/index.js @@ -49,7 +49,14 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, { field: 'addTypeText', - title: '题库来源', align: "center" + title: '题库来源', align: "center", + templet:function (d) { + var htm = d.addTypeText + if(!isAdmin && d.sourceType == "1"){ + htm = "院校添加" + } + return htm; + } }, /*{ field: 'orgIdText', @@ -66,23 +73,23 @@ layui.define(['form', 'laydate', 'table'], function (exports) { { field: 'userId', title: '操作', align: "center", width: 220, style:"text-align: left", templet: function (d) { let htm = ""; - /*if((d.sourceType == '2' && isAdmin) || (d.sourceType == '1' && !isAdmin)){ + if(((d.sourceType == '2'||d.addType == 'ADMIN_ADD' ) && isAdmin) || ((d.sourceType == '1'||d.addType == 'FACULTY_ADD' ) && !isAdmin)){ htm +='上架\n' +'下架' +'编辑\n' +'删除'; }else{ htm += '查看'; - }*/ - console.log(d.sourceType == '2' ) - if(((d.sourceType == '2'||d.addType == 'ADMIN_ADD' ) && isAdmin)){ + } + + /*if(((d.sourceType == '2'||d.addType == 'ADMIN_ADD' ) && isAdmin)){ htm +='上架\n' +'下架' +'编辑\n' +'删除'; }else if(((d.sourceType == '2'||d.addType == 'ADMIN_ADD') && !isAdmin)){ htm += '查看'; - } + }*/ // TODO 上下架前端逻辑待开发 return htm; @@ -214,7 +221,12 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, initTableTool: table.on('tool(resourcesQuestionTable)', function (obj) { var data = obj.data; if (obj.event === 'edit') { - var url = "/jlw/resourcesQuestion/add.do?resourcesQuestionId=" + data.resourcesQuestionId; + var url = ''; + if((data.sourceType == '2'||data.addType == 'ADMIN_ADD' )){ + url = "/jlw/resourcesQuestion/add.do?resourcesQuestionId=" + data.resourcesQuestionId; + }else if ((data.sourceType == '1'||data.addType == 'FACULTY_ADD' )) { + url = '/jlw/teacherOpenCourseMergeResourcesQuestion' + } Common.openDlg(url, "题库管理/编辑题目"); } else if (obj.event === "del") { allDelete(data.resourcesQuestionId); diff --git a/web/src/main/resources/templates/jlw/courseInfo/index.html b/web/src/main/resources/templates/jlw/courseInfo/index.html index 41e7e3fb..a396b671 100644 --- a/web/src/main/resources/templates/jlw/courseInfo/index.html +++ b/web/src/main/resources/templates/jlw/courseInfo/index.html @@ -25,6 +25,12 @@ type="course_label.course_label_name.course_label_status=1,${user.get().isAdmin
+ +
+ +
+
+ diff --git a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html index 3b7f0dfa..92b146a5 100644 --- a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html +++ b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html @@ -59,10 +59,10 @@
- - - + +