From a224197c0da2f4bf606ab6fe770927cd26f48dee Mon Sep 17 00:00:00 2001 From: zxl20070701 <1904314465@qq.com> Date: Wed, 5 Feb 2025 21:13:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8B=A5=E5=B9=B2=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=B9=B6=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 13 +- README.md | 2 +- client/htmls/index/mod.css | 122 ++- client/htmls/index/mod.html | 36 +- client/htmls/index/mod.js | 20 +- client/images/addFile.svg | 1 + client/index.html | 13 +- client/libs/min/vislite.js | 375 ++++++-- client/libs/system.info.js | 2 +- client/styles/common.css | 1 - package-lock.json | 1601 ++++++++++++++++++------------- package.json | 14 +- src/config.ts | 2 +- src/handler/dist.service.ts | 5 +- src/handler/index.controller.ts | 22 + src/tool/format.ts | 38 + 16 files changed, 1452 insertions(+), 815 deletions(-) create mode 100644 client/images/addFile.svg create mode 100644 src/tool/format.ts diff --git a/CHANGELOG b/CHANGELOG index 507ab53..0040b80 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,4 +15,15 @@ v0.1.0: * 双击文件打开 (包括:视频) * 右键事件 - * 底部操作按钮 \ No newline at end of file + * 底部操作按钮 +v0.2.0: + date:2025-02-05 + changes: + - 修复bug + 1、修复文件夹错误显示可直接下载问题 + - 优化改造 + 1、文件列表界面优化 + - 新增功能 + 1、文件管理界面 + * 双击文件打开 + (包括:文本、图片) \ No newline at end of file diff --git a/README.md b/README.md index 037acb8..466260f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [File System](https://github.com/zxl20070701/FileSystem) +# [File System](https://github.com/oi-contrib/FileSystem) 🔥文件管理系统 ✨☁️📁✨ 支持:文件或文件夹的上传、下载、ZIP文件压缩与解压、在线查看等 ## 如何开发 diff --git a/client/htmls/index/mod.css b/client/htmls/index/mod.css index 562a703..9e787d2 100644 --- a/client/htmls/index/mod.css +++ b/client/htmls/index/mod.css @@ -47,14 +47,14 @@ body { /* 内容列表 */ .filelist { position: fixed; - left: 20px; - top: 90px; + left: 50px; + top: 70px; outline: 1px solid #9E9E9E; - width: calc(100vw - 40px); - height: calc(100vh - 160px); + width: calc(100vw - 100px); + height: calc(100% - 140px); overflow: auto; - padding: 20px 50px; - border-radius: 5px; + padding: 20px; + border-radius: 0 0 5px 5px; background-color: #fcfcfc; } @@ -98,6 +98,9 @@ body { background-size: auto 90%; padding-left: 30px; color: #000000; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; } .filelist>table>tbody>tr>th.name>span { @@ -122,7 +125,7 @@ body { /* 底部按钮 */ .mult-bottom-btns { - width: 100vw; + width: 100%; height: 70px; position: fixed; left: 0; @@ -147,6 +150,12 @@ body { display: inline-block; } +.mult-bottom-btns>.button.exit { + background-color: red; + color: white; + outline: none; +} + .mult-bottom-btns>.button:hover { font-weight: 800; outline-color: black; @@ -244,24 +253,38 @@ body { /* 显示文件 */ .showfile-view { position: fixed; - left: 50px; - bottom: 50px; - width: 400px; - height: 300px; + left: 20px; + top: 20px; + width: calc(100% - 40px); + height: calc(100% - 40px); background-color: #ffffff; box-shadow: 0 0 5px 3px #9E9E9E; + text-align: left; + z-index: 2; + border-radius: 10px; +} + +.showfile-mask { + position: fixed; + background-color: rgba(0, 0, 0, 0.4); + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 2; } .showfile-view>header>h2 { background-size: auto 70%; - background-position: 5px center; + background-position: 10px center; background-repeat: no-repeat; - line-height: 30px; - font-size: 14px; + line-height: 40px; + font-size: 16px; font-family: cursive; - padding-left: 35px; + padding-left: 50px; background-color: #b0c9dd; background-image: url("../../images/logo.png"); + border-radius: 10px 10px 0 0; } .showfile-view>header>.close { @@ -270,12 +293,75 @@ body { background-image: url("../../images/close-btn.png"); font-size: 0; position: absolute; - right: 10px; + right: 30px; top: 0; cursor: pointer; } -.showfile-view>header>.content { +.showfile-view>.content { width: 100%; - height: 270px; + height: calc(100% - 40px); +} + +.showfile-view>.content.center { + display: flex; + justify-content: center; + align-items: center; +} + +.showfile-view>.content.plain { + margin: 0; + padding: 10px; + overflow: auto; +} + +.showfile-view>.content.plain>pre { + user-select: text; + white-space: break-spaces; +} + +.showfile-view>.content.img>img { + max-width: 100%; + max-height: 100%; +} + +/* 无文件 */ +.filelist>.blank { + text-align: center; +} + +.filelist>.blank>.title { + text-align: center; + font-weight: 700; + color: #1a1a1a; + font-size: 36px; + line-height: 48px; + padding-top: 50px; +} + +.filelist>.blank>.tips { + text-align: center; + line-height: 30px; + font-size: 22px; + color: #1a1a1a; + font-weight: 300; + margin: 10px 0; +} + +.filelist>.blank>.file { + line-height: 50px; + display: inline-block; + border: 1px solid gray; + background-image: url("../../images/addFile.svg"); + background-repeat: no-repeat; + background-position: 5px center; + background-size: auto 70%; + padding-left: 40px; + padding-right: 10px; + border-radius: 5px; + cursor: pointer; +} + +.filelist>.blank>.file:hover { + text-decoration: underline; } \ No newline at end of file diff --git a/client/htmls/index/mod.html b/client/htmls/index/mod.html index ac8796c..364a9e0 100644 --- a/client/htmls/index/mod.html +++ b/client/htmls/index/mod.html @@ -17,7 +17,7 @@
@@ -32,20 +32,16 @@
| ||||
---|---|---|---|---|
.. | - | 文件夹 | - | -- |
{{item.mtime}} | {{item.isDirectory?'文件夹':item.type}} | {{item.size||"-"}} | -- |
{{plainContent}}+