diff --git a/src/main/java/cn/stylefeng/guns/modular/file/FileViewController.java b/src/main/java/cn/stylefeng/guns/modular/file/FileViewController.java index 2602c433..3c6f0507 100644 --- a/src/main/java/cn/stylefeng/guns/modular/file/FileViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/file/FileViewController.java @@ -1,4 +1,4 @@ -package cn.stylefeng.guns.modular.file; +package cn.stylefeng.guns.modular.file.controller; import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource; import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource; @@ -7,15 +7,16 @@ import org.springframework.stereotype.Controller; /** * 文件管理界面 - * - * @author lgq - * @date 2021/1/9 + * @author : lgq + * @date : 2021/1/9 */ @Controller @Slf4j @ApiResource(name = "文件管理界面") public class FileViewController { + + /** * 文件管理首页 * @@ -27,4 +28,18 @@ public class FileViewController { 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..693d6cc6 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 }); }; @@ -106,31 +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: '
' + - // '' + - // '
' - // // 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 - }) + layer.photos({ + photos: { "data": [{"src": imgUrl}] } + ,anim: 0 + }); @@ -161,8 +140,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"]}){ + +
+
+
+
基本信息
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+ + +
+
+ +@}