From 0fb4a9e24c52ed1188c5d1ae5668120dc898c16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BA=86?= <1576331433@qq.com> Date: Thu, 14 Jan 2021 21:49:02 +0800 Subject: [PATCH 1/2] =?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=E6=96=87=E4=BB=B6=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/controller/FileViewController.java | 23 ++++- .../modular/system/fileInfo/file_info.js | 14 ++-- .../system/fileInfo/file_info_details.js | 14 ++++ .../system/fileInfo/file_info_details.html | 83 +++++++++++++++++++ 4 files changed, 125 insertions(+), 9 deletions(-) create mode 100644 src/main/webapp/assets/modular/system/fileInfo/file_info_details.js create mode 100644 src/main/webapp/pages/modular/system/fileInfo/file_info_details.html diff --git a/src/main/java/cn/stylefeng/guns/modular/file/controller/FileViewController.java b/src/main/java/cn/stylefeng/guns/modular/file/controller/FileViewController.java index ae47c352..3c6f0507 100644 --- a/src/main/java/cn/stylefeng/guns/modular/file/controller/FileViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/file/controller/FileViewController.java @@ -15,10 +15,31 @@ import org.springframework.stereotype.Controller; @ApiResource(name = "文件管理界面") public class FileViewController { - @GetResource(name = "菜单管理首页", path = "/view/file") + + + /** + * 文件管理首页 + * + * @author lgq + * @date 2021/1/9 + */ + @GetResource(name = "文件管理首页", path = "/view/file") public String fileIndex() { return "/modular/system/fileInfo/file_info.html"; } + + /** + * 文件详情页面 + * + * @author lgq + * @date 2021/1/12 下午11:11 + */ + @GetResource(name = "文件详情页面", path = "/view/fileInfoDetails") + public String details(){ + + return "/modular/system/fileInfo/file_info_details.html"; + } + } 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 664c359b..27373843 100644 --- a/src/main/webapp/assets/modular/system/fileInfo/file_info.js +++ b/src/main/webapp/assets/modular/system/fileInfo/file_info.js @@ -66,12 +66,12 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( - // 点击编辑 - FileInfo.openEditDlg = function (data) { + // 点击详情 + FileInfo.openDetails = function (data) { func.open({ height: 800, - title: '修改职位', - content: Feng.ctxPath + '/position/editView?positionId=' + data.positionId, + title: '详情', + content: Feng.ctxPath + '/view/fileInfoDetails?fileId=' + data.fileId, tableId: FileInfo.tableId }); }; @@ -121,8 +121,6 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( // }); // - var imgUrl = Feng.ctxPath + '/sysFileInfo/previewByObjectName?fileBucket=' + data.fileBucket + '&fileObjectName=' + data.fileObjectName; - layer.open({ type: 2, title: false, @@ -161,8 +159,8 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util', 'upload'], function ( table.on('tool(' + FileInfo.tableId + ')', function (obj) { var data = obj.data; var event = obj.event; - if (event === 'edit') { - FileInfo.openEditDlg(data); + if (event === 'details') { + FileInfo.openDetails(data); } else if (event === 'delete') { FileInfo.onDeleteFile(data); }else if (event === 'download'){ diff --git a/src/main/webapp/assets/modular/system/fileInfo/file_info_details.js b/src/main/webapp/assets/modular/system/fileInfo/file_info_details.js new file mode 100644 index 00000000..e79493b4 --- /dev/null +++ b/src/main/webapp/assets/modular/system/fileInfo/file_info_details.js @@ -0,0 +1,14 @@ +layui.use(['layer', 'form', 'admin', 'HttpRequest'], function () { + var $ = layui.$; + var form = layui.form; + var HttpRequest = layui.HttpRequest; + + + + //获取详情信息,填充表单 + var httpRequest = new HttpRequest(Feng.ctxPath + "/sysFileInfo/detail?fileId=" + Feng.getUrlParam("fileId"),'get'); + var result = httpRequest.start(); + form.val("fileInfoForm", result.data); + + +}); diff --git a/src/main/webapp/pages/modular/system/fileInfo/file_info_details.html b/src/main/webapp/pages/modular/system/fileInfo/file_info_details.html new file mode 100644 index 00000000..f723476a --- /dev/null +++ b/src/main/webapp/pages/modular/system/fileInfo/file_info_details.html @@ -0,0 +1,83 @@ +@layout("/layout/_form.html",{js:["/assets/modular/system/fileInfo/file_info_details.js"]}){ + +
+ +@} From 182353c60717d10a805d20d94a427fe9595d5488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BA=86?= <1576331433@qq.com> Date: Thu, 14 Jan 2021 22:09:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90file=E3=80=91=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modular/system/fileInfo/file_info.js | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) 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 27373843..693d6cc6 100644 --- a/src/main/webapp/assets/modular/system/fileInfo/file_info.js +++ b/src/main/webapp/assets/modular/system/fileInfo/file_info.js @@ -106,29 +106,10 @@ 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: '