优化调整
This commit is contained in:
1 parent
6c7897bf47
commit
7d49a7395f
50 files changed
+2805
-259
No files matched your search
@@ -8,14 +8,14 @@ import { Effect, EffectState } from '@tauri-apps/api/window'
|
||||
import { commands } from '@/lib/bindings'
|
||||
import {
|
||||
ClipboardList, Pin, PinOff, Trash2, Search, Image as ImageIcon,
|
||||
FileText, Files, Loader2,
|
||||
FileText, Files,
|
||||
} from '@lucide/vue'
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import {
|
||||
Pagination, PaginationContent, PaginationItem, PaginationEllipsis,
|
||||
} from '@/components/ui/pagination'
|
||||
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@/components/ui/tooltip'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
|
||||
// ===== 与 Rust 端对应的数据结构(bindings 提供,camelCase) =====
|
||||
// kind 为 bindings 生成的 string,前端按字符串比较即可
|
||||
@@ -364,7 +364,6 @@ onUnmounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="popup-root flex flex-col h-screen w-screen" @keydown="onKeydown">
|
||||
<TooltipProvider>
|
||||
<!-- 搜索栏(与剪切板主页统一样式) -->
|
||||
<div class="flex items-center gap-2 px-3 py-2 border-b border-border shrink-0">
|
||||
<div class="relative flex-1 max-w-sm">
|
||||
@@ -390,8 +389,18 @@ onUnmounted(() => {
|
||||
<!-- 列表 -->
|
||||
<ScrollArea class="popup-list flex-1 min-h-0">
|
||||
<div class="space-y-1.5 p-2">
|
||||
<div v-if="loading && !hasItems" class="flex flex-col items-center justify-center py-12 text-muted-foreground">
|
||||
<Loader2 class="size-6 animate-spin" />
|
||||
<div v-if="loading && !hasItems" class="space-y-1.5">
|
||||
<div
|
||||
v-for="n in 8"
|
||||
:key="n"
|
||||
class="flex items-start gap-3 rounded-lg border px-3 py-2"
|
||||
>
|
||||
<Skeleton class="size-4 shrink-0 mt-0.5" />
|
||||
<div class="flex-1 space-y-1.5">
|
||||
<Skeleton class="h-3.5 w-3/4" />
|
||||
<Skeleton class="h-2.5 w-1/4" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!hasItems" class="flex flex-col items-center justify-center py-12 text-muted-foreground">
|
||||
<ClipboardList class="size-10 mb-2 opacity-40" />
|
||||
@@ -417,22 +426,12 @@ onUnmounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
<div class="popup-item-actions shrink-0">
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<button class="popup-action-btn size-7" @click="togglePin(item, $event)">
|
||||
<component :is="item.pinned ? PinOff : Pin" class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>固定</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<button class="popup-action-btn size-7 hover:text-destructive" @click="deleteItem(item, $event)">
|
||||
<Trash2 class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>删除</TooltipContent>
|
||||
</Tooltip>
|
||||
<button class="popup-action-btn size-7" :title="item.pinned ? '取消固定' : '固定'" @click="togglePin(item, $event)">
|
||||
<component :is="item.pinned ? PinOff : Pin" class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
<button class="popup-action-btn size-7 hover:text-destructive" title="删除" @click="deleteItem(item, $event)">
|
||||
<Trash2 class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -472,7 +471,6 @@ onUnmounted(() => {
|
||||
<span><kbd>Enter</kbd> 粘贴</span>
|
||||
<span><kbd>Esc</kbd> 关闭</span>
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in new issue
Block a user