From 9f659b371adf458bf957104acc1089e65db286c2 Mon Sep 17 00:00:00 2001 From: cirry <812852553@qq.com> Date: Fri, 10 Jul 2026 11:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .reasonix/desktop-topic-auto-title-meta.json | 6 +++++ .reasonix/desktop-topic-created-at.json | 3 ++- .reasonix/desktop-topic-title-sources.json | 3 ++- .reasonix/desktop-topic-titles.json | 3 ++- src/components/TreeEntry.vue | 23 ++++++++++++++++++-- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.reasonix/desktop-topic-auto-title-meta.json b/.reasonix/desktop-topic-auto-title-meta.json index d29b632..3772986 100644 --- a/.reasonix/desktop-topic-auto-title-meta.json +++ b/.reasonix/desktop-topic-auto-title-meta.json @@ -28,5 +28,11 @@ "userTurns": 1, "basisHash": "2066e5673ac2f507", "updatedAt": 1783653328367 + }, + "topic_20260710-032907_600adc6b00791607": { + "stage": 1, + "userTurns": 1, + "basisHash": "e0e08f907071b904", + "updatedAt": 1783654440818 } } \ No newline at end of file diff --git a/.reasonix/desktop-topic-created-at.json b/.reasonix/desktop-topic-created-at.json index 69c7d30..fe8168e 100644 --- a/.reasonix/desktop-topic-created-at.json +++ b/.reasonix/desktop-topic-created-at.json @@ -4,5 +4,6 @@ "topic_20260706-145507_076a32df5f4276b5": 1783349707873, "topic_20260706-153317_238f65a7a470703c": 1783351997029, "topic_20260710-024855_5c4b1833149d66bb": 1783651735446, - "topic_20260710-030936_cedad2907c3954fe": 1783652976310 + "topic_20260710-030936_cedad2907c3954fe": 1783652976310, + "topic_20260710-032907_600adc6b00791607": 1783654147796 } \ No newline at end of file diff --git a/.reasonix/desktop-topic-title-sources.json b/.reasonix/desktop-topic-title-sources.json index 869dc70..615072e 100644 --- a/.reasonix/desktop-topic-title-sources.json +++ b/.reasonix/desktop-topic-title-sources.json @@ -42,5 +42,6 @@ "topic_20260708-093419_71d1fea2e4b5a40f": "auto", "topic_20260708-095428_990617acd4168b40": "auto", "topic_20260710-024855_5c4b1833149d66bb": "auto", - "topic_20260710-030936_cedad2907c3954fe": "auto" + "topic_20260710-030936_cedad2907c3954fe": "auto", + "topic_20260710-032907_600adc6b00791607": "auto" } \ No newline at end of file diff --git a/.reasonix/desktop-topic-titles.json b/.reasonix/desktop-topic-titles.json index 834f765..3cf7872 100644 --- a/.reasonix/desktop-topic-titles.json +++ b/.reasonix/desktop-topic-titles.json @@ -42,5 +42,6 @@ "topic_20260708-093419_71d1fea2e4b5a40f": "src/components/Dir…", "topic_20260708-095428_990617acd4168b40": "帮我检查一下这个应用在进行放大缩小的…", "topic_20260710-024855_5c4b1833149d66bb": "帮我给右侧的目录树添加一个功能,当用…", - "topic_20260710-030936_cedad2907c3954fe": "鼠标放在tree上的时候,只有hov…" + "topic_20260710-030936_cedad2907c3954fe": "鼠标放在tree上的时候,只有hov…", + "topic_20260710-032907_600adc6b00791607": "目录树中显示的文件夹,markdow…" } \ No newline at end of file diff --git a/src/components/TreeEntry.vue b/src/components/TreeEntry.vue index 81a9dd4..540259b 100644 --- a/src/components/TreeEntry.vue +++ b/src/components/TreeEntry.vue @@ -45,6 +45,25 @@ const isActive = computed(() => { return props.currentFilePath != null && props.currentFilePath === props.entry.path; }); +// ── File type detection ───────────────────────────────────── +const fileType = computed(() => { + if (props.entry.is_dir) return "folder"; + const ext = props.entry.name.split(".").pop()?.toLowerCase(); + if (ext === "md") return "markdown"; + if (["png", "jpg", "jpeg", "gif", "webp", "avif", "svg", "bmp", "ico"].includes(ext ?? "")) return "image"; + if (["mp4", "webm", "mov", "m4v", "ogv", "avi", "mkv"].includes(ext ?? "")) return "video"; + return "file"; +}); + +const fileIcon = computed(() => { + switch (fileType.value) { + case "markdown": return "ri-markdown-line"; + case "image": return "ri-image-line"; + case "video": return "ri-film-line"; + default: return "ri-file-line"; + } +}); + // ── Menu ───────────────────────────────────────────────── const menuOpen = ref(false); const menuRef = ref(null); @@ -176,7 +195,7 @@ function onClick() { class="tree-arrow ri-arrow-right-s-line text-sm transition-transform shrink-0" :class="expanded && entry.children ? 'rotate-90' : ''" > - + {{ entry.name }} @@ -251,7 +270,7 @@ function onClick() { :style="{ paddingLeft: `${depth * 16 + 8}px` }" @click="onClick" > - + {{ entry.name }}