From aa943e3657e2a134d27981b17b94f70626c5d92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BA=86?= <1576331433@qq.com> Date: Tue, 12 Jan 2021 22:31:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90file=E3=80=91=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E9=A2=84=E8=A7=88=EF=BC=88=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modular/system/fileInfo/file_info.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/main/webapp/assets/modular/system/fileInfo/file_info.js b/src/main/webapp/assets/modular/system/fileInfo/file_info.js index 641daaab..664c359b 100644 --- a/src/main/webapp/assets/modular/system/fileInfo/file_info.js +++ b/src/main/webapp/assets/modular/system/fileInfo/file_info.js @@ -6,6 +6,8 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( var HttpRequest = layui.HttpRequest; var util = layui.util; var upload = layui.upload; + var layer = layui.layer; + // 职位表管理 var FileInfo = { @@ -100,6 +102,42 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( } } + // 预览 + FileInfo.openPreview = function (data) { + var imgUrl = Feng.ctxPath + '/sysFileInfo/previewByObjectName?fileBucket=' + data.fileBucket + '&fileObjectName=' + data.fileObjectName; + + // layer.open({ + // type: 1, + // title: false, + // closeBtn: 0, + // skin: 'layui-layer-nobg', //没有背景色 + // shadeClose: true, + // content: '
' + + // '' + + // '
' + // // content: Feng.ctxPath + '/sysFileInfo/previewByObjectName?fileBucket=' + data.fileBucket + '&fileObjectName=' + data.fileObjectName, + // }); + // + + var imgUrl = Feng.ctxPath + '/sysFileInfo/previewByObjectName?fileBucket=' + data.fileBucket + '&fileObjectName=' + data.fileObjectName; + + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['500px', '300px'], + shadeClose: true, + content: imgUrl + }) + + + + + }; + + // 渲染表格 var tableResult = table.render({ @@ -129,6 +167,8 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( FileInfo.onDeleteFile(data); }else if (event === 'download'){ FileInfo.onFileDownload(data); + }else if(event === 'preview'){ + FileInfo.openPreview(data); } });