From d75232e5e0d275c6af9ce4867bb4a1ac547fa9ac Mon Sep 17 00:00:00 2001 From: Frost-ZX Date: Wed, 4 Jun 2025 23:38:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E5=85=B7=E7=AE=B1):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=85=B7=E4=BF=A1=E6=81=AF=E5=92=8C=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 8 +- src/assets/js/toolbox-changelogs.js | 15 ++++ src/assets/js/toolbox-data.js | 5 ++ src/views/ToolboxView/ToolboxView.vue | 108 ++++++++++++++++++++++++-- types/web.d.ts | 2 + 5 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 src/assets/js/toolbox-changelogs.js diff --git a/src/App.vue b/src/App.vue index 787ffa3..0e1cbb8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -122,7 +122,8 @@ function initCssVars() { '--color-green': 'var(--color-success)', '--color-blue': 'var(--color-info)', '--color-orange': 'var(--color-warning)', - // 滚动条大小 + // 元素大小 + '--dialog-content-max-height': 'calc(100vh - 160px)', '--scrollbar-size': '8px', }; @@ -265,6 +266,11 @@ html { // -- Naive UI -- +.n-dialog-content--with-max-height { + max-height: var(--dialog-content-max-height); + overflow-y: auto; +} + .n-drawer--right-placement { .n-drawer-body { height: 0; diff --git a/src/assets/js/toolbox-changelogs.js b/src/assets/js/toolbox-changelogs.js new file mode 100644 index 0000000..3d1e42c --- /dev/null +++ b/src/assets/js/toolbox-changelogs.js @@ -0,0 +1,15 @@ +/** 工具更新日志 */ +export const CHANGE_LOGS = { + 'json-formatter': [ + '[2] - 2025-02-07\n优化“输出内容”显示样式,解决内容较多时行号显示不全的问题。', + '[1] - 2025-02-04\n初始版本。', + ], + 'keep-screen-on': [ + '[2] - 2024-10-13\n优化界面样式,背景添加圆角。', + '[1] - 2024-10-11\n初始版本。', + ], + 'qrcode-reader-and-generator': [ + '[2] - 2025-02-23\n支持生成二维码。\n支持解析剪贴板中的二维码图片。\n优化解析功能,在二维码所在位置添加矩形标记。', + '[1] - 2025-02-21\n初始版本。', + ], +}; diff --git a/src/assets/js/toolbox-data.js b/src/assets/js/toolbox-data.js index 9de0469..e5be450 100644 --- a/src/assets/js/toolbox-data.js +++ b/src/assets/js/toolbox-data.js @@ -1,5 +1,7 @@ // 工具箱 +import { CHANGE_LOGS } from './toolbox-changelogs'; + const MODULES = import.meta.glob('../../views/ToolboxView/**/*.vue'); /** @@ -84,6 +86,7 @@ export const toolList = [ updatedAt: '2025-02-23', version: '2', enabled: true, + changelogs: CHANGE_LOGS['qrcode-reader-and-generator'], }, { id: 'convert-text-structure', @@ -135,6 +138,7 @@ export const toolList = [ updatedAt: '2025-02-07', version: '2', enabled: true, + changelogs: CHANGE_LOGS['json-formatter'], }, ], }, @@ -273,6 +277,7 @@ export const toolList = [ updatedAt: '2024-10-13', version: '2', enabled: true, + changelogs: CHANGE_LOGS['keep-screen-on'], }, { id: 'open-new-window', diff --git a/src/views/ToolboxView/ToolboxView.vue b/src/views/ToolboxView/ToolboxView.vue index 2202fc9..e645b81 100644 --- a/src/views/ToolboxView/ToolboxView.vue +++ b/src/views/ToolboxView/ToolboxView.vue @@ -5,7 +5,7 @@ @@ -18,10 +18,20 @@
+ + + + + @@ -89,17 +99,47 @@ + + + + + + diff --git a/types/web.d.ts b/types/web.d.ts index b57da7c..501a3f2 100644 --- a/types/web.d.ts +++ b/types/web.d.ts @@ -65,6 +65,8 @@ declare global { version: string; /** 是否启用 */ enabled: boolean; + /** 更新日志 */ + changelogs: string[]; } // window