From 26af3badc784be98216b8d185493e48f8f04f54e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com>
Date: Mon, 22 May 2023 04:02:11 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 admin-core/src/main/resources/static/js/lib.js              | 2 --
 web/src/main/resources/static/js/jlw/resourcesInfo/index.js | 6 +++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/admin-core/src/main/resources/static/js/lib.js b/admin-core/src/main/resources/static/js/lib.js
index f697c90a..a2a971f3 100644
--- a/admin-core/src/main/resources/static/js/lib.js
+++ b/admin-core/src/main/resources/static/js/lib.js
@@ -1099,8 +1099,6 @@ var Lib = {
         });
         layui.form.render();
     },downloadFile:function (data){ //下载指定文件/或者预览文件 resourcesInfoType:资源类型(1视频 2课件(ppt 、pdf) 3附件)
-        window.location.href = Common.ctxPath + "/jlw/resourcesInfo/previewData.do?resourcesInfoId="+data.resourcesInfoId;
-        return;
         if(data.resourcesInfoType == 3){//前端下载文件
             var a = document.createElement('a');
             a.setAttribute('href', Common.ctxPath + data.resourcesInfoContent); //a.href='文件链接'
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 f007d141..bff3327e 100644
--- a/web/src/main/resources/static/js/jlw/resourcesInfo/index.js
+++ b/web/src/main/resources/static/js/jlw/resourcesInfo/index.js
@@ -142,7 +142,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
                     {
                         field: 'userId', title: '操作', align: "center", field: 'right', templet: function (d) {
                             var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
-                            htm += '<a class="layui-table-link" lay-event="previewPage">' + (d.resourcesInfoType == 3 ? '下载' : '预览') + '</a>';
+                            if(d.resourcesInfoType == 4){
+                                htm += '<a class="layui-table-link" href="'+ d.resourcesInfoContent+'" target="_blank">预览</a>';
+                            }else {
+                                htm += '<a class="layui-table-link" lay-event="previewPage" >' + (d.resourcesInfoType == 3 ? '下载' : '预览') + '</a>';
+                            }
                             htm += '<a class="layui-table-link" lay-event="del">删除</a>';
                             return htm;
                         }