From 1708c65c341c7f38ec1319b5b6269216546675f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Wed, 4 Feb 2026 10:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=80=BB=E8=BE=91=E5=92=8C=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 提取文件列表排序公共函数 sortFileList - 统一应用文件夹优先排序规则 - 移除生产环境 source map,减小打包体积 - 提升代码可维护性 --- web/src/components/DeviceTest.vue | 3 ++- .../components/FileSystem/index-simple.vue | 2 ++ web/src/components/FileSystem/index.vue | 7 ++++-- web/src/utils/fileUtils.js | 22 +++++++++++++++++++ web/vite.config.js | 2 +- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/web/src/components/DeviceTest.vue b/web/src/components/DeviceTest.vue index 593b615..9df4dfb 100644 --- a/web/src/components/DeviceTest.vue +++ b/web/src/components/DeviceTest.vue @@ -216,7 +216,7 @@ import { // 导入公共工具函数和常量 import { STORAGE_KEYS, DEFAULTS } from '@/utils/constants' -import { formatBytes } from '@/utils/fileUtils' +import { formatBytes, sortFileList } from '@/utils/fileUtils' // 导入 composables import { useFileOperations } from '@/composables/useFileOperations' @@ -350,6 +350,7 @@ const listDirectory = async () => { fileLoading.value = true try { fileList.value = await listDir(filePath.value) + fileList.value = sortFileList(fileList.value) } catch (error) { console.error('列出目录失败:', error) Message.error('列出目录失败: ' + (error.message || error)) diff --git a/web/src/components/FileSystem/index-simple.vue b/web/src/components/FileSystem/index-simple.vue index 0afe3e7..059992b 100644 --- a/web/src/components/FileSystem/index-simple.vue +++ b/web/src/components/FileSystem/index-simple.vue @@ -24,6 +24,7 @@