diff --git a/src/App.vue b/src/App.vue index 18dfcef..645b838 100644 --- a/src/App.vue +++ b/src/App.vue @@ -334,17 +334,17 @@ body { /* 视图切换动画 */ .view-transition-enter-active, .view-transition-leave-active { - transition: all 0.3s ease; + transition: opacity 0.25s ease, transform 0.25s ease; } .view-transition-enter-from { opacity: 0; - transform: translateX(20px); + transform: translateX(10px); } .view-transition-leave-to { opacity: 0; - transform: translateX(-20px); + transform: translateX(-10px); } /* 响应式设计 */ diff --git a/src/components/PromptManager.vue b/src/components/PromptManager.vue index 6433338..5f8d2f5 100644 --- a/src/components/PromptManager.vue +++ b/src/components/PromptManager.vue @@ -16,11 +16,14 @@ const categories = computed(() => store.categories); const currentCategory = computed(() => store.currentCategory); const currentGroup = computed(() => store.currentGroup); const filteredTags = computed(() => store.filteredTags); +const isSearching = computed(() => store.searchQuery.trim().length > 0); function onDragStart(index: number) { + if (isSearching.value) return; draggingIndex.value = index; } function onDragOver(index: number, e: DragEvent) { + if (isSearching.value) return; e.preventDefault(); overIndex.value = index; } @@ -63,6 +66,12 @@ function removeTag(tag: PromptTag) { store.removeTag(gid, tag.key); } +function confirmRemoveTag(tag: PromptTag) { + if (confirm(`确定要删除提示词 "${tag.key}" 吗?`)) { + removeTag(tag); + } +} + function toggleHidden(tag: PromptTag) { const gid = currentGroup.value?.id; if (!gid) return; @@ -75,7 +84,7 @@ function exportAll() { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; - a.download = `prompt_dataset_${new Date().toISOString().slice(0, 19)}.json`; + a.download = `prompt_dataset_${new Date().toISOString().slice(0, 19).replace(/:/g, '-')}.json`; document.body.appendChild(a); a.click(); a.remove(); @@ -92,6 +101,7 @@ function importAll(ev: Event) { const text = String(reader.result); const bundle = JSON.parse(text); store.importFromBundle(bundle); + alert('导入成功!'); } catch (e) { alert('导入失败:JSON 格式不正确'); } finally { @@ -102,71 +112,203 @@ function importAll(ev: Event) { } function resetDefault() { - store.resetToDefault(); + if (confirm('确定要重置为内置词库吗?这将丢失所有自定义更改。')) { + store.resetToDefault(); + } } \ No newline at end of file +