功能完善

This commit is contained in:
2026-07-10 11:40:27 +08:00
parent d56b7d52bf
commit 9f659b371a
5 changed files with 33 additions and 5 deletions

View File

@@ -28,5 +28,11 @@
"userTurns": 1, "userTurns": 1,
"basisHash": "2066e5673ac2f507", "basisHash": "2066e5673ac2f507",
"updatedAt": 1783653328367 "updatedAt": 1783653328367
},
"topic_20260710-032907_600adc6b00791607": {
"stage": 1,
"userTurns": 1,
"basisHash": "e0e08f907071b904",
"updatedAt": 1783654440818
} }
} }

View File

@@ -4,5 +4,6 @@
"topic_20260706-145507_076a32df5f4276b5": 1783349707873, "topic_20260706-145507_076a32df5f4276b5": 1783349707873,
"topic_20260706-153317_238f65a7a470703c": 1783351997029, "topic_20260706-153317_238f65a7a470703c": 1783351997029,
"topic_20260710-024855_5c4b1833149d66bb": 1783651735446, "topic_20260710-024855_5c4b1833149d66bb": 1783651735446,
"topic_20260710-030936_cedad2907c3954fe": 1783652976310 "topic_20260710-030936_cedad2907c3954fe": 1783652976310,
"topic_20260710-032907_600adc6b00791607": 1783654147796
} }

View File

@@ -42,5 +42,6 @@
"topic_20260708-093419_71d1fea2e4b5a40f": "auto", "topic_20260708-093419_71d1fea2e4b5a40f": "auto",
"topic_20260708-095428_990617acd4168b40": "auto", "topic_20260708-095428_990617acd4168b40": "auto",
"topic_20260710-024855_5c4b1833149d66bb": "auto", "topic_20260710-024855_5c4b1833149d66bb": "auto",
"topic_20260710-030936_cedad2907c3954fe": "auto" "topic_20260710-030936_cedad2907c3954fe": "auto",
"topic_20260710-032907_600adc6b00791607": "auto"
} }

View File

@@ -42,5 +42,6 @@
"topic_20260708-093419_71d1fea2e4b5a40f": "src/components/Dir…", "topic_20260708-093419_71d1fea2e4b5a40f": "src/components/Dir…",
"topic_20260708-095428_990617acd4168b40": "帮我检查一下这个应用在进行放大缩小的…", "topic_20260708-095428_990617acd4168b40": "帮我检查一下这个应用在进行放大缩小的…",
"topic_20260710-024855_5c4b1833149d66bb": "帮我给右侧的目录树添加一个功能,当用…", "topic_20260710-024855_5c4b1833149d66bb": "帮我给右侧的目录树添加一个功能,当用…",
"topic_20260710-030936_cedad2907c3954fe": "鼠标放在tree上的时候只有hov…" "topic_20260710-030936_cedad2907c3954fe": "鼠标放在tree上的时候只有hov…",
"topic_20260710-032907_600adc6b00791607": "目录树中显示的文件夹markdow…"
} }

View File

@@ -45,6 +45,25 @@ const isActive = computed(() => {
return props.currentFilePath != null && props.currentFilePath === props.entry.path; 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 ───────────────────────────────────────────────── // ── Menu ─────────────────────────────────────────────────
const menuOpen = ref(false); const menuOpen = ref(false);
const menuRef = ref<HTMLElement | null>(null); const menuRef = ref<HTMLElement | null>(null);
@@ -176,7 +195,7 @@ function onClick() {
class="tree-arrow ri-arrow-right-s-line text-sm transition-transform shrink-0" class="tree-arrow ri-arrow-right-s-line text-sm transition-transform shrink-0"
:class="expanded && entry.children ? 'rotate-90' : ''" :class="expanded && entry.children ? 'rotate-90' : ''"
></i> ></i>
<i class="tree-entry-icon ri-folder-line text-base shrink-0"></i> <i class="tree-entry-icon ri-folder-2-line text-base shrink-0"></i>
<span class="truncate flex-1 min-w-0">{{ entry.name }}</span> <span class="truncate flex-1 min-w-0">{{ entry.name }}</span>
<!-- More button --> <!-- More button -->
@@ -251,7 +270,7 @@ function onClick() {
:style="{ paddingLeft: `${depth * 16 + 8}px` }" :style="{ paddingLeft: `${depth * 16 + 8}px` }"
@click="onClick" @click="onClick"
> >
<i class="tree-entry-icon ri-file-line text-sm shrink-0"></i> <i :class="['tree-entry-icon', fileIcon, 'text-sm shrink-0']"></i>
<span class="truncate flex-1 min-w-0">{{ entry.name }}</span> <span class="truncate flex-1 min-w-0">{{ entry.name }}</span>
<!-- More button --> <!-- More button -->