refactor: 重构设置、API、图库与存储页面前端结构。

将操作日志并入设置侧栏,补齐检查更新提示与版本接口刷新;拆分各模块组件并修复图库搜索分页变量。
This commit is contained in:
O96u committed 2026-09-01 17:15:02 +08:00
1 parent 270af4e707
commit ac65c1eb9d
51 files changed
+5119 -2059

No files matched your search

+19 -3
View File
@@ -10,17 +10,31 @@ const props = withDefaults(defineProps<{
emptyText?: string
dense?: boolean
compact?: boolean
/** 图库:5 列 × 2 行,缩略图略扁 */
gallery?: boolean
}>(), {
selectable: true,
showKey: true,
showStorage: false,
dense: false,
compact: false
compact: false,
gallery: false
})
const gridClass = computed(() => {
if (props.gallery) {
return 'grid items-start grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5'
}
if (props.dense) {
return 'grid items-start grid-cols-2 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4'
}
return 'grid items-start grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4'
})
const emit = defineEmits<{
'update:selectedKeys': [value: Set<string>]
'preview': [image: ImageItem]
'delete': [image: ImageItem]
}>()
const { t } = useI18n()
@@ -38,8 +52,8 @@ function updateSelection(key: string, selected: boolean) {
<template>
<div
v-if="items.length"
class="grid items-start sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
:class="dense ? 'grid-cols-2 gap-3' : 'grid-cols-1 gap-4'"
class="items-start"
:class="gridClass"
>
<ImageCard
v-for="image in items"
@@ -50,8 +64,10 @@ function updateSelection(key: string, selected: boolean) {
:show-key="showKey"
:show-storage="showStorage"
:compact="compact"
:gallery="gallery"
@update:selected="updateSelection(image.key, $event)"
@preview="emit('preview', image)"
@delete="emit('delete', image)"
/>
</div>
<div