✨ feat: 重构管理后台并增强组件系统与回收站功能
* 新增自适应数值与窗口分析工具,提升交互体验 * 优化回收站模块逻辑,增加展示与选择功能 * 引入 Macaron 主题配置文件并更新 Tailwind 配置 * 精简基础组件代码,移除冗余样式与设置项 * 完善测试用例,覆盖 UI 系统与回收站工作流 * 更新多语言配置,支持功能变更后的文案需求
This commit is contained in:
1 parent
614b9a2104
commit
9b22534e2b
61 files changed
+1624
-832
No files matched your search
@@ -8,36 +8,25 @@
|
||||
<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1.5">
|
||||
<p class="trash-file-name min-w-0 text-sm font-semibold leading-6 sm:text-base">{{ name }}</p>
|
||||
<span class="trash-state shrink-0 rounded-full border px-2.5 py-0.5 text-xs font-medium" :class="`trash-tone-${info.tone}`">{{ info.state }}</span>
|
||||
<span class="trash-reason-tag shrink-0 rounded-full px-2.5 py-0.5 text-xs" :class="item.trashReason === 'manual' ? 'trash-reason-manual' : item.trashReason === 'batch_delete' ? 'trash-tone-permanent' : 'trash-tone-warning'" :title="`移入原因:${info.reason}`">{{ info.reason }}</span>
|
||||
</div>
|
||||
<dl class="trash-file-meta mt-2 flex flex-wrap gap-x-5 gap-y-2 text-xs leading-5">
|
||||
<div class="flex flex-wrap gap-x-1.5"><dt>原取件码</dt><dd class="font-mono font-medium tracking-wide">{{ item.code || '未记录' }}</dd></div>
|
||||
<div class="flex gap-x-1.5"><dt>文件大小</dt><dd>{{ sizeText }}</dd></div>
|
||||
<div class="flex flex-wrap gap-x-1.5"><dt>移入原因</dt><dd>{{ info.reason }}</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div class="trash-time-panel mt-3 rounded-2xl border px-3 py-2.5 sm:ml-14">
|
||||
<dl class="grid min-w-0 gap-3 text-xs sm:grid-cols-2">
|
||||
<div class="min-w-0">
|
||||
<dt class="trash-time-label flex items-center gap-1.5"><Clock3Icon class="h-3.5 w-3.5" aria-hidden="true" />移入时间</dt>
|
||||
<dd class="mt-1.5 font-medium tabular-nums"><time :datetime="item.trashedAt || undefined" :title="formatTrashTime(item.trashedAt)">{{ formatTrashTime(item.trashedAt, now) }}</time></dd>
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<dt class="trash-time-label flex items-center gap-1.5"><CalendarClockIcon class="h-3.5 w-3.5" aria-hidden="true" />{{ info.timeLabel }}</dt>
|
||||
<dd class="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 font-medium tabular-nums">
|
||||
<span :title="item.isTrashPermanent && !item.isTrashPurged ? undefined : formatTrashTime(item.isTrashPurged ? item.trashPurgedAt : item.trashExpiresAt)">{{ info.timeText }}</span>
|
||||
<span v-if="info.reminder" class="trash-remaining rounded-full px-2 py-0.5 text-[11px]" :class="`trash-tone-${info.tone}`">{{ info.reminder }}</span>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="trash-detail-grid mt-3">
|
||||
<dl v-for="field in fields" :key="field.label" class="trash-detail-card theme-2026-card-hover fcb-secondary-card min-w-0 rounded-2xl border px-3 py-2.5">
|
||||
<dt class="trash-time-label text-xs leading-5">{{ field.label }}</dt>
|
||||
<dd class="mt-1 break-words text-xs font-medium leading-5 tabular-nums" :class="field.mono ? 'font-mono tracking-wide' : ''" :title="field.title">{{ field.value }}</dd>
|
||||
<span v-if="field.reminder" class="trash-remaining mt-1 inline-block rounded-full px-2 py-0.5 text-[11px]" :class="`trash-tone-${info.tone}`">{{ field.reminder }}</span>
|
||||
</dl>
|
||||
<p v-if="info.note" class="trash-time-label mt-2 text-xs leading-5">{{ info.note }}</p>
|
||||
<div v-if="$slots.actions" class="trash-item-actions"><slot name="actions" /></div>
|
||||
</div>
|
||||
<p v-if="info.note" class="trash-time-label mt-3 text-xs leading-5">{{ info.note }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { CalendarClockIcon, Clock3Icon, FileIcon, FileTextIcon, FileX2Icon } from 'lucide-vue-next'
|
||||
import { FileIcon, FileTextIcon, FileX2Icon } from 'lucide-vue-next'
|
||||
import type { TrashFileItem } from '@/types'
|
||||
import { formatFileSize } from '@/utils/common'
|
||||
import { formatTrashTime, getTrashPresentation } from '@/utils/trashPresentation'
|
||||
@@ -49,14 +38,34 @@ const sizeText = computed(() => {
|
||||
const size = Number(props.item.size)
|
||||
return Number.isFinite(size) && size >= 0 ? formatFileSize(size, 1) : '未记录'
|
||||
})
|
||||
const fields = computed(() => [
|
||||
{ label: '原取件码', value: props.item.code || '未记录', mono: true },
|
||||
{ label: '文件大小', value: sizeText.value },
|
||||
{ label: '移入时间', value: formatTrashTime(props.item.trashedAt, props.now), title: formatTrashTime(props.item.trashedAt) },
|
||||
{ label: info.value.timeLabel, value: info.value.timeText, reminder: info.value.reminder,
|
||||
title: props.item.isTrashPermanent && !props.item.isTrashPurged ? undefined : formatTrashTime(props.item.isTrashPurged ? props.item.trashPurgedAt : props.item.trashExpiresAt) }
|
||||
])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.trash-item-info { color: #294851; --trash-muted: #617980; --trash-line: #d7e3e5; --trash-surface: #edf3f6; }
|
||||
.trash-item-info--dark { color: #dbe9ee; --trash-muted: #a9bdc2; --trash-line: #40545c; --trash-surface: #26383f; }
|
||||
.trash-item-info { container-type: inline-size; container-name: trash-record; color: #294851; --trash-muted: #617980; --trash-line: #d7e3e5; --trash-surface: #edf3f6; }
|
||||
.trash-item-info--dark { color: #dbe9ee; --trash-muted: #a9bdc2; --trash-line: #495765; --trash-surface: #303946; }
|
||||
.trash-file-name { overflow-wrap: anywhere; }
|
||||
.trash-file-meta dt, .trash-time-label { color: var(--trash-muted); }
|
||||
.trash-time-panel { background: var(--trash-surface); border-color: var(--trash-line); }
|
||||
.trash-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
|
||||
.trash-detail-card { margin: 0; min-height: 72px; background: var(--trash-surface) !important; border-color: var(--trash-line) !important; }
|
||||
.trash-item-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: center; grid-column: 1 / -1; }
|
||||
@container trash-record (min-width: 620px) {
|
||||
.trash-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
.trash-item-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; grid-column: 1 / -1; }
|
||||
}
|
||||
@container trash-record (min-width: 1000px) {
|
||||
.trash-detail-grid { grid-template-columns: minmax(100px,125px) minmax(90px,110px) minmax(100px,130px) minmax(140px,180px) minmax(400px,1fr); align-items: center; gap: 10px; }
|
||||
.trash-item-actions { grid-column: auto; align-items: center; }
|
||||
}
|
||||
.trash-item-actions :deep(button) { white-space: nowrap; }
|
||||
.trash-detail-grid .trash-detail-card:hover { transform: translateY(-2px) !important; }
|
||||
@media (prefers-reduced-motion: reduce), (hover: none) { .trash-detail-grid .trash-detail-card:hover { transform: none !important; } }
|
||||
.trash-state { border-color: var(--trash-line); }
|
||||
.trash-tone-normal { background: #e4f0ed; color: #355e56; }
|
||||
.trash-tone-warning { background: #fff0d8; color: #885512; }
|
||||
@@ -66,4 +75,5 @@ const sizeText = computed(() => {
|
||||
.trash-item-info--dark .trash-tone-warning { background: #514026; color: #f5d599; }
|
||||
.trash-item-info--dark .trash-tone-permanent { background: #3e3556; color: #ddd2f6; }
|
||||
.trash-item-info--dark .trash-tone-muted { background: #344249; color: #bbc9cf; }
|
||||
.trash-reason-manual { background: var(--fcb-button-primary-bg); color: var(--fcb-button-primary-text); }
|
||||
</style>
|
||||
Reference in new issue
Block a user