✨ feat: 重构管理后台并增强组件系统与回收站功能
* 新增自适应数值与窗口分析工具,提升交互体验 * 优化回收站模块逻辑,增加展示与选择功能 * 引入 Macaron 主题配置文件并更新 Tailwind 配置 * 精简基础组件代码,移除冗余样式与设置项 * 完善测试用例,覆盖 UI 系统与回收站工作流 * 更新多语言配置,支持功能变更后的文案需求
This commit is contained in:
1 parent
614b9a2104
commit
9b22534e2b
61 files changed
+1624
-832
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<span ref="container" class="fcb-adaptive-value block min-w-0 tabular-nums" :title="String(value)" :style="{ fontSize: `${fontSize}px` }"><span class="whitespace-nowrap">{{ value }}</span></span>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { fitValueFontSize } from '@/utils/adaptiveValue'
|
||||
const props = withDefaults(defineProps<{ value: string | number; maximum?: number; minimum?: number }>(), { maximum: 24, minimum: 14 })
|
||||
const container = ref<HTMLElement | null>(null)
|
||||
const fontSize = ref(props.maximum)
|
||||
let observer: ResizeObserver | undefined
|
||||
const measure = () => {
|
||||
const element = container.value
|
||||
const text = element?.firstElementChild as HTMLElement | null
|
||||
if (!element || !text) return
|
||||
text.style.fontSize = `${props.maximum}px`
|
||||
const width = text.getBoundingClientRect().width
|
||||
text.style.fontSize = ''
|
||||
fontSize.value = fitValueFontSize(element.clientWidth, width, props.maximum, props.minimum)
|
||||
}
|
||||
onMounted(() => {
|
||||
observer = new ResizeObserver(measure)
|
||||
if (container.value) observer.observe(container.value)
|
||||
measure()
|
||||
void document.fonts.ready.then(measure)
|
||||
})
|
||||
watch(() => [props.value, props.maximum, props.minimum], () => { void nextTick(measure) })
|
||||
onBeforeUnmount(() => observer?.disconnect())
|
||||
</script>
|
||||
@@ -18,16 +18,16 @@
|
||||
<div class="p-4">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0">
|
||||
<component :is="alertIcons[alert.type]" class="h-6 w-6 text-white" />
|
||||
<component :is="alertIcons[alert.type]" class="h-6 w-6 text-inherit" />
|
||||
</div>
|
||||
<div class="ml-3 flex-1 pt-0.5">
|
||||
<p class="text-sm font-medium text-white">{{ alert.message }}</p>
|
||||
<p class="text-sm font-medium text-inherit">{{ alert.message }}</p>
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0 flex">
|
||||
<button
|
||||
type="button"
|
||||
@click="removeAlert(alert.id)"
|
||||
class="inline-flex h-11 w-11 items-center justify-center rounded-lg text-white transition-colors duration-200 hover:bg-white/10 hover:text-gray-100 focus:outline-none focus:ring-2 focus:ring-white"
|
||||
class="fcb-action fcb-icon-action inline-flex h-11 w-11 items-center justify-center rounded-lg text-inherit transition-colors duration-200 hover:bg-white/10 hover:text-gray-100 focus:outline-none focus:ring-2 focus:ring-white"
|
||||
>
|
||||
<span class="sr-only">{{ t('common.close') }}</span>
|
||||
<X class="h-5 w-5" />
|
||||
@@ -59,10 +59,10 @@ const { alerts } = storeToRefs(alertStore)
|
||||
const { removeAlert } = alertStore
|
||||
|
||||
const gradientClasses = {
|
||||
success: 'from-[#6f9688] to-[#5f8377]',
|
||||
error: 'from-[#9b6a72] to-[#895c63]',
|
||||
warning: 'from-[#b2a16f] to-[#9b8b5e]',
|
||||
info: 'from-[#5f8796] to-[#527887]'
|
||||
success: 'fcb-alert-success',
|
||||
error: 'fcb-alert-error',
|
||||
warning: 'fcb-alert-warning',
|
||||
info: 'fcb-alert-info'
|
||||
}
|
||||
|
||||
const alertIcons = {
|
||||
@@ -76,6 +76,12 @@ const alertIcons = {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fcb-alert-success { background: var(--fcb-button-success-bg); color: var(--fcb-button-success-text); }
|
||||
.fcb-alert-error { background: var(--fcb-button-danger-bg); color: var(--fcb-button-danger-text); }
|
||||
.fcb-alert-info { background: var(--fcb-button-primary-bg); color: var(--fcb-button-primary-text); }
|
||||
.fcb-alert-warning { background: #f4e6cb; color: #70532e; }
|
||||
.dark .fcb-alert-warning { background: #51452f; color: #f2e4ca; }
|
||||
|
||||
.alert-fade-enter-active,
|
||||
.alert-fade-leave-active {
|
||||
transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:type="type"
|
||||
:disabled="disabled || loading"
|
||||
@click="$emit('click', $event)"
|
||||
class="inline-flex items-center justify-center rounded-[30px] px-4 py-2 font-medium shadow-sm transition-all duration-200 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-sm"
|
||||
class="fcb-action border border-transparent inline-flex items-center justify-center rounded-[30px] px-4 py-2 font-medium shadow-sm transition-all duration-200 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-sm"
|
||||
:class="[
|
||||
sizeClasses,
|
||||
variantClasses,
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useInjectedDarkMode } from '@/composables'
|
||||
|
||||
interface Props {
|
||||
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'outline'
|
||||
@@ -41,8 +40,6 @@ defineEmits<{
|
||||
click: [event: MouseEvent]
|
||||
}>()
|
||||
|
||||
const isDarkMode = useInjectedDarkMode()
|
||||
|
||||
const sizeClasses = computed(() => {
|
||||
const sizes = {
|
||||
sm: 'min-h-11 px-3 py-2 text-sm sm:min-h-0 sm:py-1.5',
|
||||
@@ -52,33 +49,5 @@ const sizeClasses = computed(() => {
|
||||
return sizes[props.size]
|
||||
})
|
||||
|
||||
const variantClasses = computed(() => {
|
||||
const baseClasses = 'focus:ring-2 focus:ring-offset-2'
|
||||
|
||||
if (props.variant === 'primary') {
|
||||
return `${baseClasses} bg-[#5f8796] text-white shadow-[#9fb8bf]/35 hover:bg-[#527887] focus:ring-[#8fb2bf]`
|
||||
}
|
||||
|
||||
if (props.variant === 'secondary') {
|
||||
return isDarkMode.value
|
||||
? `${baseClasses} border border-[#40545c] bg-[#263941] text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#2d4751] focus:ring-[#7199a8]`
|
||||
: `${baseClasses} border border-[#c8d8dc] bg-[#edf4f5] text-[#415d66] hover:border-[#9db6bd] hover:bg-[#e2ecee] focus:ring-[#8fb2bf]`
|
||||
}
|
||||
|
||||
if (props.variant === 'danger') {
|
||||
return `${baseClasses} bg-[#dc2626] text-white shadow-[#f87171]/35 hover:bg-[#b91c1c] focus:ring-[#ef4444]`
|
||||
}
|
||||
|
||||
if (props.variant === 'success') {
|
||||
return `${baseClasses} bg-[#6f9688] text-white shadow-[#aac4ba]/35 hover:bg-[#5f8377] focus:ring-[#92b3a7]`
|
||||
}
|
||||
|
||||
if (props.variant === 'outline') {
|
||||
return isDarkMode.value
|
||||
? `${baseClasses} border border-[#40545c] text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#263941] focus:ring-[#7199a8]`
|
||||
: `${baseClasses} border border-[#c8d8dc] text-[#415d66] hover:border-[#9db6bd] hover:bg-[#edf4f5] focus:ring-[#8fb2bf]`
|
||||
}
|
||||
|
||||
return ''
|
||||
})
|
||||
const variantClasses = computed(() => `fcb-button-${props.variant}`)
|
||||
</script>
|
||||
@@ -15,7 +15,7 @@
|
||||
aria-modal="true"
|
||||
:aria-label="title || t('common.dialog')"
|
||||
tabindex="-1"
|
||||
class="relative flex max-h-[calc(100dvh-1.5rem)] transform flex-col overflow-hidden rounded-[24px] shadow-xl transition-all sm:max-h-[calc(100dvh-2rem)] sm:rounded-[30px]"
|
||||
class="fcb-surface relative flex max-h-[calc(100dvh-1.5rem)] transform flex-col overflow-hidden rounded-[24px] shadow-xl transition-all sm:max-h-[calc(100dvh-2rem)] sm:rounded-[30px]"
|
||||
:class="[sizeClasses, isDarkMode ? 'bg-gray-800' : 'bg-white']"
|
||||
@click.stop
|
||||
@keydown="handleKeydown"
|
||||
@@ -33,7 +33,7 @@
|
||||
<button
|
||||
v-if="closable"
|
||||
type="button"
|
||||
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-[30px] transition-colors"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 shrink-0 items-center justify-center rounded-[30px] transition-colors"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'text-gray-300 hover:bg-gray-700 hover:text-white'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@click.self="$emit('close')"
|
||||
>
|
||||
<div
|
||||
class="flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-[24px] bg-opacity-70 p-4 shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px] sm:p-6"
|
||||
class="fcb-surface flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-[24px] bg-opacity-70 p-4 shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px] sm:p-6"
|
||||
:class="[isDarkMode ? 'bg-gray-800' : 'bg-white']"
|
||||
>
|
||||
<div class="flex justify-between items-center mb-4 flex-shrink-0">
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="flex items-center gap-3">
|
||||
<button
|
||||
@click="$emit('copy-content')"
|
||||
class="inline-flex items-center gap-2 rounded-[30px] px-3 py-1.5 text-sm font-medium transition duration-200 sm:px-4"
|
||||
class="fcb-action inline-flex items-center gap-2 rounded-[30px] px-3 py-1.5 text-sm font-medium transition duration-200 sm:px-4"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white'
|
||||
@@ -28,7 +28,7 @@
|
||||
</button>
|
||||
<button
|
||||
@click="$emit('close')"
|
||||
class="rounded-[30px] p-1.5 transition duration-200 hover:bg-opacity-10"
|
||||
class="fcb-action rounded-[30px] p-1.5 transition duration-200 hover:bg-opacity-10"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'text-gray-400 hover:text-white hover:bg-white'
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<nav
|
||||
class="mt-4 flex flex-col gap-3 border-t px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6"
|
||||
:class="[isDarkMode ? 'border-[#31454d]' : 'border-[#c8d7da]']"
|
||||
class="fcb-pagination mt-3 flex flex-col gap-2 border-t px-3 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-6"
|
||||
:class="[isDarkMode ? 'border-[#495765]' : 'border-[#c8d7da]']"
|
||||
:aria-label="t('components.pagination.navigation')"
|
||||
>
|
||||
<div class="text-sm" :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
||||
<div class="text-xs sm:text-sm" :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
||||
{{ t('components.pagination.range', { start: rangeStart, end: rangeEnd, total }) }}
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 sm:flex sm:flex-wrap">
|
||||
<div class="fcb-pagination-controls grid grid-cols-[minmax(0,1fr)_auto_auto_auto] items-center gap-2 sm:flex sm:flex-wrap">
|
||||
<select
|
||||
:value="pageSize"
|
||||
class="col-span-3 min-h-11 rounded-[30px] border px-3 text-sm shadow-sm transition-colors sm:col-auto lg:min-h-9"
|
||||
class="fcb-page-size min-h-9 rounded-2xl border px-3 text-sm shadow-sm transition-colors lg:min-h-9"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'border-[#40545c] bg-[#263941] text-[#d8e3e5] hover:border-[#7199a8]'
|
||||
? 'border-[#495765] bg-[#2c3440] text-[#d8e3e5] hover:border-[#7199a8]'
|
||||
: 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66] hover:border-[#9db6bd]'
|
||||
]"
|
||||
:aria-label="t('components.pagination.pageSize')"
|
||||
@@ -28,15 +28,15 @@
|
||||
<button
|
||||
type="button"
|
||||
:disabled="currentPage === 1"
|
||||
class="inline-flex min-h-11 items-center justify-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9"
|
||||
class="fcb-action fcb-page-nav inline-flex min-h-11 items-center justify-center rounded-2xl px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9"
|
||||
:class="buttonClass(currentPage === 1)"
|
||||
@click="$emit('page-change', currentPage - 1)"
|
||||
>
|
||||
<ChevronLeftIcon class="h-4 w-4" aria-hidden="true" />
|
||||
<span class="max-[359px]:sr-only">{{ t('common.previous') }}</span>
|
||||
<span class="sr-only sm:not-sr-only">{{ t('common.previous') }}</span>
|
||||
</button>
|
||||
|
||||
<span class="text-center text-sm font-medium sm:hidden" :class="[isDarkMode ? 'text-gray-200' : 'text-gray-700']">
|
||||
<span class="fcb-page-counter text-center text-sm font-medium tabular-nums sm:hidden" :class="[isDarkMode ? 'text-gray-200' : 'text-gray-700']">
|
||||
{{ currentPage }} / {{ totalPages }}
|
||||
</span>
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
<button
|
||||
v-if="pageNum !== '...'"
|
||||
type="button"
|
||||
class="inline-flex min-h-11 min-w-11 items-center justify-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9 lg:min-w-9"
|
||||
class="fcb-action inline-flex min-h-11 min-w-11 items-center justify-center rounded-2xl px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9 lg:min-w-9"
|
||||
:class="[
|
||||
currentPage === pageNum
|
||||
? 'bg-[#5f8796] text-white shadow-[#9fb8bf]/35'
|
||||
: isDarkMode
|
||||
? 'bg-[#263941] text-[#d8e3e5] hover:bg-[#2d4751]'
|
||||
? 'bg-[#2c3440] text-[#d8e3e5] hover:bg-[#384452]'
|
||||
: 'bg-[#edf4f5] text-[#415d66] hover:bg-[#e2ecee]'
|
||||
]"
|
||||
:aria-label="t('components.pagination.goToPage', { page: pageNum })"
|
||||
@@ -66,11 +66,11 @@
|
||||
<button
|
||||
type="button"
|
||||
:disabled="currentPage >= totalPages"
|
||||
class="inline-flex min-h-11 items-center justify-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9"
|
||||
class="fcb-action fcb-page-nav inline-flex min-h-11 items-center justify-center rounded-2xl px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md lg:min-h-9"
|
||||
:class="buttonClass(currentPage >= totalPages)"
|
||||
@click="$emit('page-change', currentPage + 1)"
|
||||
>
|
||||
<span class="max-[359px]:sr-only">{{ t('common.next') }}</span>
|
||||
<span class="sr-only sm:not-sr-only">{{ t('common.next') }}</span>
|
||||
<ChevronRightIcon class="h-4 w-4" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -121,7 +121,7 @@ const buttonClass = (disabled: boolean) => {
|
||||
if (isDarkMode.value) {
|
||||
return disabled
|
||||
? 'cursor-not-allowed bg-[#223039] text-[#71878d]'
|
||||
: 'bg-[#263941] text-[#d8e3e5] hover:bg-[#2d4751]'
|
||||
: 'bg-[#2c3440] text-[#d8e3e5] hover:bg-[#384452]'
|
||||
}
|
||||
return disabled
|
||||
? 'cursor-not-allowed bg-[#e8eeee] text-[#7d8d91]'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
class="data-table-2026 theme-2026-card theme-2026-card-hover overflow-hidden rounded-[30px] shadow-md transition-all duration-300 hover:shadow-lg"
|
||||
class="data-table-2026 theme-2026-card fcb-static-container overflow-hidden rounded-[30px] shadow-md transition-all duration-300 hover:shadow-lg"
|
||||
>
|
||||
<div
|
||||
class="border-b px-6 py-4"
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="overflow-x-auto" tabindex="0" role="region" :aria-label="title">
|
||||
<table
|
||||
class="divide-y"
|
||||
:class="[tableClass, isDarkMode ? 'divide-[#31454d]' : 'divide-[#d7e3e5]']"
|
||||
:class="[tableClass, isDarkMode ? 'divide-[#495765]' : 'divide-[#d7e3e5]']"
|
||||
>
|
||||
<caption class="sr-only">{{ title }}</caption>
|
||||
<thead>
|
||||
@@ -39,7 +39,7 @@
|
||||
</thead>
|
||||
<tbody
|
||||
class="divide-y"
|
||||
:class="[isDarkMode ? 'divide-[#31454d]/70' : 'divide-[#d7e3e5]/80']"
|
||||
:class="[isDarkMode ? 'divide-[#495765]/70' : 'divide-[#d7e3e5]/80']"
|
||||
>
|
||||
<slot name="body"></slot>
|
||||
</tbody>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div v-if="expirationMethod !== 'forever'" class="grid grid-cols-[2.75rem_minmax(0,1fr)_2.75rem] gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-xl border text-xl font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-40"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-xl border text-xl font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:class="controlClass"
|
||||
:disabled="numericValue <= 1"
|
||||
:aria-label="t('send.expiration.decrement')"
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-xl border text-xl font-semibold transition-colors"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-xl border text-xl font-semibold transition-colors"
|
||||
:class="controlClass"
|
||||
:aria-label="t('send.expiration.increment')"
|
||||
@click="incrementValue(1)"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@click.self="$emit('close')"
|
||||
>
|
||||
<div
|
||||
class="w-full max-w-md mx-3 overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px]"
|
||||
class="fcb-surface w-full max-w-md mx-3 overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px]"
|
||||
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white bg-opacity-95']"
|
||||
>
|
||||
<h3
|
||||
@@ -63,7 +63,7 @@
|
||||
<div v-if="record.filename === 'Text'" class="ml-2">
|
||||
<button
|
||||
@click="$emit('preview-content')"
|
||||
class="rounded-[30px] bg-indigo-600 px-4 py-2 text-white transition duration-200 hover:bg-indigo-700"
|
||||
class="fcb-action rounded-[30px] bg-indigo-600 px-4 py-2 text-white transition duration-200 hover:bg-indigo-700"
|
||||
>
|
||||
{{ t('fileDetail.previewContent') }}
|
||||
</button>
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
<button
|
||||
@click="$emit('close')"
|
||||
class="mt-6 w-full rounded-[30px] bg-gradient-to-r from-indigo-500 to-purple-600 px-5 py-3 font-medium text-white transition duration-200 transform hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 sm:mt-8 sm:px-6"
|
||||
class="fcb-action mt-6 w-full rounded-[30px] bg-gradient-to-r from-indigo-500 to-purple-600 px-5 py-3 font-medium text-white transition duration-200 transform hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 sm:mt-8 sm:px-6"
|
||||
>
|
||||
{{ t('common.close') }}
|
||||
</button>
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 grid grid-cols-3 gap-2">
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('view-details', record)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('view-details', record)">
|
||||
<EyeIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('common.fileDetails') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('download-record', record)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('download-record', record)">
|
||||
<DownloadIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('fileRecord.download') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl bg-red-600 px-2 text-xs font-medium text-white hover:bg-red-700" @click="$emit('delete-record', record.id)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl bg-red-600 px-2 text-xs font-medium text-white hover:bg-red-700" @click="$emit('delete-record', record.id)">
|
||||
<TrashIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('common.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
v-if="hasError && allowRetry"
|
||||
type="button"
|
||||
@click.stop="handleRetry"
|
||||
class="mt-3 min-h-11 rounded-lg px-4 py-2 text-sm transition-colors duration-200"
|
||||
class="fcb-action mt-3 min-h-11 rounded-lg px-4 py-2 text-sm transition-colors duration-200"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-indigo-600 hover:bg-indigo-500 text-white'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div ref="switcherRef" class="relative">
|
||||
<button
|
||||
<button class="fcb-action"
|
||||
type="button"
|
||||
@click="toggleDropdown"
|
||||
:class="[
|
||||
@@ -42,7 +42,7 @@
|
||||
]"
|
||||
>
|
||||
<div class="py-1">
|
||||
<button
|
||||
<button class="fcb-action"
|
||||
v-for="language in availableLocales"
|
||||
:key="language.code"
|
||||
type="button"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div class="native-date-strip" :class="fieldClass" :aria-label="ariaLabel">
|
||||
<div class="native-date-field" :class="fieldClass" role="group" :aria-label="ariaLabel">
|
||||
<span class="native-date-label"><CalendarDaysIcon aria-hidden="true" />{{ ariaLabel }}</span>
|
||||
<div class="native-date-strip">
|
||||
<select
|
||||
:value="parts.year"
|
||||
class="native-date-part native-date-year"
|
||||
@@ -54,11 +56,13 @@
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { CalendarDaysIcon } from 'lucide-vue-next'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -132,140 +136,49 @@ const updatePart = (part: DatePart, value: string) => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.native-date-strip {
|
||||
display: inline-flex;
|
||||
width: var(--native-date-width, max-content);
|
||||
.native-date-field {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
min-height: 2.75rem;
|
||||
align-items: center;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 0;
|
||||
padding-inline: 0.65ch;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 30px;
|
||||
background: rgba(237, 244, 245, 0.52);
|
||||
color: #2d4650;
|
||||
font-variant-numeric: tabular-nums;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
|
||||
transition:
|
||||
background 180ms ease,
|
||||
border-color 180ms ease,
|
||||
box-shadow 180ms ease,
|
||||
transform 180ms ease;
|
||||
gap: 3px;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--fcb-border);
|
||||
border-radius: 16px;
|
||||
background: var(--fcb-surface);
|
||||
color: var(--fcb-text);
|
||||
box-shadow: 0 3px 9px rgb(107 132 146 / 10%);
|
||||
transition: border-color 300ms ease, box-shadow 300ms ease;
|
||||
}
|
||||
|
||||
.native-date-strip:hover,
|
||||
.native-date-strip:focus-within {
|
||||
border-color: rgba(143, 178, 191, 0.7);
|
||||
background: rgba(226, 236, 238, 0.78);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.72),
|
||||
0 10px 24px rgba(126, 149, 154, 0.16);
|
||||
}
|
||||
|
||||
.native-date-strip:focus-within {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.native-date-field:focus-within { border-color: var(--fcb-primary); box-shadow: 0 0 0 2px rgb(143 175 191 / 25%); }
|
||||
.native-date-label { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 1.4; color: var(--fcb-text-muted); }
|
||||
.native-date-label svg { width: 13px; height: 13px; }
|
||||
.native-date-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-variant-numeric: tabular-nums; }
|
||||
.native-date-part {
|
||||
height: 2.65rem;
|
||||
appearance: none;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
min-width: 0;
|
||||
min-height: 28px;
|
||||
border: 0 !important;
|
||||
border-radius: 6px;
|
||||
background: transparent !important;
|
||||
color: inherit !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 0.95rem;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
outline: none;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.native-date-part:focus-visible {
|
||||
border-radius: 999px;
|
||||
box-shadow: 0 0 0 2px rgba(143, 178, 191, 0.58);
|
||||
}
|
||||
|
||||
.native-date-year {
|
||||
width: 4.2ch;
|
||||
}
|
||||
|
||||
.native-date-month,
|
||||
.native-date-day,
|
||||
.native-date-time {
|
||||
width: 2.2ch;
|
||||
}
|
||||
|
||||
.native-date-time-spacer {
|
||||
width: 0.9ch;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.native-date-separator {
|
||||
margin-inline: 0.35ch;
|
||||
color: #789096;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1;
|
||||
opacity: 0.78;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.native-date-part:focus-visible { outline: 2px solid var(--fcb-primary); outline-offset: 1px; }
|
||||
.native-date-year { width: 4.5ch; }
|
||||
.native-date-month, .native-date-day, .native-date-time { width: 2.6ch; }
|
||||
.native-date-separator { color: var(--fcb-text-muted); font-size: 12px; }
|
||||
.native-date-time-spacer { width: 6px; }
|
||||
@media (max-width: 639px) {
|
||||
:global(.analytics-date-range) {
|
||||
--native-date-width: auto;
|
||||
display: flex !important;
|
||||
width: 100%;
|
||||
flex-wrap: nowrap !important;
|
||||
gap: 0.2rem !important;
|
||||
}
|
||||
|
||||
.native-date-strip {
|
||||
width: min-content;
|
||||
min-width: 0;
|
||||
flex: 1 1 0;
|
||||
min-height: 2.75rem;
|
||||
padding-inline: 0.2rem;
|
||||
}
|
||||
|
||||
.native-date-part {
|
||||
height: 2.75rem;
|
||||
min-width: 0;
|
||||
font-size: clamp(0.75rem, 3.4vw, 0.9rem);
|
||||
}
|
||||
|
||||
.native-date-year {
|
||||
width: clamp(3.35rem, 15vw, 4rem);
|
||||
}
|
||||
|
||||
.native-date-month,
|
||||
.native-date-day {
|
||||
width: clamp(1.7rem, 8vw, 2.2rem);
|
||||
}
|
||||
|
||||
.native-date-separator {
|
||||
margin-inline: 0;
|
||||
font-size: clamp(0.72rem, 3vw, 0.85rem);
|
||||
}
|
||||
}
|
||||
|
||||
.dark .native-date-strip {
|
||||
background: rgba(38, 57, 65, 0.62);
|
||||
color: #d8e3e5;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.dark .native-date-strip:hover,
|
||||
.dark .native-date-strip:focus-within {
|
||||
border-color: rgba(113, 153, 168, 0.72);
|
||||
background: rgba(45, 71, 81, 0.76);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.1),
|
||||
0 10px 24px rgba(4, 10, 14, 0.28);
|
||||
}
|
||||
|
||||
.dark .native-date-separator {
|
||||
color: #aabdc2;
|
||||
.native-date-field { padding: 7px 8px; border-radius: 14px; }
|
||||
.native-date-strip { gap: 1px; }
|
||||
.native-date-part { font-size: clamp(12px, 3.2vw, 14px); }
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="mb-6 text-center" v-if="linkText && linkTo">
|
||||
<router-link
|
||||
:to="linkTo"
|
||||
class="inline-flex min-h-11 items-center rounded-lg px-3 text-[#3f6a77] transition duration-200 hover:bg-[#dcebed] hover:text-[#315c69] dark:text-[#b8d4dc] dark:hover:bg-[#294047]"
|
||||
class="fcb-action inline-flex min-h-11 items-center rounded-lg px-3 text-[#3f6a77] transition duration-200 hover:bg-[#dcebed] hover:text-[#315c69] dark:text-[#b8d4dc] dark:hover:bg-[#333d49]"
|
||||
>
|
||||
{{ linkText }}
|
||||
</router-link>
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="flex items-center gap-2 sm:gap-4">
|
||||
<router-link
|
||||
to="/login"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-lg text-sm transition duration-200 hover:bg-[#dcebed] dark:hover:bg-[#294047]"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-lg text-sm transition duration-200 hover:bg-[#dcebed] dark:hover:bg-[#333d49]"
|
||||
:aria-label="t('manage.login.title')"
|
||||
:title="t('manage.login.title')"
|
||||
:class="[
|
||||
@@ -37,7 +37,7 @@
|
||||
<button
|
||||
type="button"
|
||||
@click="$emit('toggle-drawer')"
|
||||
class="flex min-h-11 items-center rounded-lg px-2 text-sm transition duration-200 hover:bg-[#dcebed] dark:hover:bg-[#294047]"
|
||||
class="fcb-action flex min-h-11 items-center rounded-lg px-2 text-sm transition duration-200 hover:bg-[#dcebed] dark:hover:bg-[#333d49]"
|
||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
||||
>
|
||||
{{ drawerText }}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<button
|
||||
type="button"
|
||||
@click="$emit('title-click')"
|
||||
class="mb-6 min-h-11 rounded-lg px-2 text-center text-3xl font-extrabold focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
||||
class="fcb-action fcb-content-action mb-6 min-h-11 rounded-lg px-2 text-center text-xl sm:text-3xl font-extrabold focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300'
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
class="group relative w-full overflow-hidden rounded-lg bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 px-4 py-3 font-bold text-white transition duration-300 hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50 motion-safe:disabled:hover:scale-100"
|
||||
class="fcb-action fcb-button-primary group relative w-full overflow-hidden rounded-lg bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 px-4 py-3 font-bold text-white transition duration-300 hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50 motion-safe:disabled:hover:scale-100"
|
||||
:disabled="inputStatus.loading || code.trim().length !== 5"
|
||||
>
|
||||
<span class="flex items-center justify-center relative z-10">
|
||||
@@ -54,9 +54,6 @@
|
||||
class="w-5 h-5 ml-2 transition-transform duration-300 transform group-hover:translate-x-1"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="absolute top-0 left-0 w-full h-full bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 opacity-0 group-hover:opacity-100 transition-opacity duration-300"
|
||||
></span>
|
||||
</button>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="flex justify-center space-x-4 mb-6">
|
||||
<button
|
||||
<button class="fcb-action"
|
||||
type="button"
|
||||
@click="selectType('file')"
|
||||
:class="[
|
||||
@@ -14,7 +14,7 @@
|
||||
>
|
||||
{{ t('nav.sendFile') }}
|
||||
</button>
|
||||
<button
|
||||
<button class="fcb-action"
|
||||
type="button"
|
||||
@click="selectType('text')"
|
||||
:class="[
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class="fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-black/60 p-3 backdrop-blur-sm sm:p-4"
|
||||
>
|
||||
<div
|
||||
class="w-full max-w-2xl overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out sm:rounded-[30px]"
|
||||
class="fcb-surface w-full max-w-2xl overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out sm:rounded-[30px]"
|
||||
:class="[isDarkMode ? 'bg-gray-900 bg-opacity-70' : 'bg-white bg-opacity-95']"
|
||||
>
|
||||
<div
|
||||
@@ -21,7 +21,7 @@
|
||||
</h3>
|
||||
<button
|
||||
@click="$emit('close')"
|
||||
class="rounded-[30px] p-1.5 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800 sm:p-2"
|
||||
class="fcb-action rounded-[30px] p-1.5 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800 sm:p-2"
|
||||
>
|
||||
<XIcon
|
||||
class="w-4 h-4 sm:w-5 sm:h-5"
|
||||
@@ -93,7 +93,7 @@
|
||||
<h4 class="font-medium text-sm sm:text-base">取件码</h4>
|
||||
<button
|
||||
@click="$emit('copy-code', record)"
|
||||
class="p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"
|
||||
class="fcb-action p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"
|
||||
>
|
||||
<ClipboardCopyIcon class="w-4 h-4 sm:w-5 sm:h-5" />
|
||||
</button>
|
||||
@@ -117,7 +117,7 @@
|
||||
</h4>
|
||||
<button
|
||||
@click="$emit('copy-wget', record)"
|
||||
class="p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"
|
||||
class="fcb-action p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"
|
||||
>
|
||||
<ClipboardCopyIcon
|
||||
class="w-4 h-4 sm:w-5 sm:h-5"
|
||||
@@ -157,7 +157,7 @@
|
||||
>
|
||||
<button
|
||||
@click="$emit('copy-link', record)"
|
||||
class="w-full bg-indigo-600 hover:bg-indigo-700 text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg text-sm sm:text-base font-medium transition-colors"
|
||||
class="fcb-action w-full bg-indigo-600 hover:bg-indigo-700 text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg text-sm sm:text-base font-medium transition-colors"
|
||||
>
|
||||
复制取件链接
|
||||
</button>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 grid grid-cols-3 gap-2">
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('copy-link', record)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('copy-link', record)">
|
||||
<ClipboardCopyIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('common.copy') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('view-details', record)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl px-2 text-xs font-medium" :class="actionClass" @click="$emit('view-details', record)">
|
||||
<EyeIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('common.fileDetails') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-xl bg-red-600 px-2 text-xs font-medium text-white hover:bg-red-700" @click="$emit('delete-record', record.id)">
|
||||
<button type="button" class="fcb-action flex min-h-11 items-center justify-center rounded-xl bg-red-600 px-2 text-xs font-medium text-white hover:bg-red-700" @click="$emit('delete-record', record.id)">
|
||||
<TrashIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('common.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
>
|
||||
<span
|
||||
class="relative inline-flex h-6 w-11 rounded-full border-2 border-transparent shadow-sm transition-colors duration-200"
|
||||
:class="modelValue === 1 ? 'bg-[#6f9688]' : isDarkMode ? 'bg-[#40545c]' : 'bg-[#cfdadc]'"
|
||||
:class="modelValue === 1 ? 'bg-[#6f9688]' : isDarkMode ? 'bg-[#495765]' : 'bg-[#cfdadc]'"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<span
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</h3>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-lg transition duration-200"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-lg transition duration-200"
|
||||
:class="[isDarkMode ? 'text-gray-300 hover:bg-gray-800 hover:text-white' : 'text-gray-700 hover:bg-gray-100']"
|
||||
:aria-label="t('common.close')"
|
||||
:title="t('common.close')"
|
||||
|
||||
@@ -31,8 +31,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import type { AnalyticsDailyRow } from '@/types'
|
||||
import { summarizeAnalyticsWindow, type AnalyticsWindowTotals } from '@/utils/analyticsWindow'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps<{
|
||||
rows: AnalyticsDailyRow[]
|
||||
@@ -41,6 +45,7 @@ const props = defineProps<{
|
||||
|
||||
const emit = defineEmits<{
|
||||
windowChange: [text: string]
|
||||
windowStats: [stats: AnalyticsWindowTotals]
|
||||
}>()
|
||||
|
||||
type DragState = {
|
||||
@@ -115,12 +120,12 @@ const formatAxisTick = (value: number) => {
|
||||
|
||||
const panelClass = computed(() =>
|
||||
props.isDarkMode
|
||||
? 'border-[#40545c] bg-[linear-gradient(135deg,rgba(34,49,56,0.96),rgba(24,35,42,0.92))] shadow-md shadow-black/25'
|
||||
? 'border-[#495765] bg-[#2c3440] shadow-md shadow-[#97aac8]/15'
|
||||
: 'border-[#d4e0e3] bg-[linear-gradient(135deg,#f8fbfb,#edf5f6)] shadow-md shadow-[#a9bdc2]/35'
|
||||
)
|
||||
const tooltipClass = computed(() =>
|
||||
props.isDarkMode
|
||||
? 'border-[#40545c] bg-[#203039] text-[#eef5f5]'
|
||||
? 'border-[#495765] bg-[#2c3440] text-[#eef5f5]'
|
||||
: 'border-[#c9d9dd] bg-[#fbfdfd] text-[#263f48]'
|
||||
)
|
||||
|
||||
@@ -310,9 +315,10 @@ const draw = (timestamp = performance.now()) => {
|
||||
emit(
|
||||
'windowChange',
|
||||
total
|
||||
? `${Math.floor(offset.value) + 1}-${Math.min(total, Math.ceil(offset.value + windowSize.value))} / ${total}`
|
||||
: '无数据'
|
||||
? t('admin.dashboard.trend.windowDays', { start: Math.floor(offset.value) + 1, end: Math.min(total, Math.ceil(offset.value + windowSize.value)), total })
|
||||
: t('admin.dashboard.trend.noData')
|
||||
)
|
||||
emit('windowStats', summarizeAnalyticsWindow(props.rows, offset.value, windowSize.value))
|
||||
|
||||
if (hoverX.value !== null && points.length && total) {
|
||||
const hoverRatio = clamp((hoverX.value - padLeft) / width, 0, 1)
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
<template>
|
||||
<div
|
||||
class="theme-2026-card theme-2026-card-hover group rounded-[24px] p-4 shadow-md transition-all duration-300 hover:shadow-lg sm:rounded-[30px] sm:p-6"
|
||||
class="theme-2026-card theme-2026-card-hover fcb-stat-card group rounded-[24px] p-3 sm:p-4 shadow-md transition-all duration-300 hover:shadow-lg sm:rounded-[30px] sm:p-6"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'hover:bg-gray-800 hover:shadow-black/20'
|
||||
? 'hover:bg-gray-800 hover:shadow-[#97aac8]/15'
|
||||
: 'hover:shadow-gray-200/80'
|
||||
]"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="relative">
|
||||
<div class="min-w-0">
|
||||
<p class="line-clamp-2 text-xs leading-tight sm:text-sm" :title="title" :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
||||
<p class="line-clamp-2 pr-9 text-xs leading-tight sm:text-sm" :title="title" :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
||||
{{ title }}
|
||||
</p>
|
||||
<h3 class="mt-1 whitespace-nowrap text-lg font-bold leading-tight tabular-nums sm:text-2xl" :title="String(value)" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
||||
{{ value }}
|
||||
</h3>
|
||||
<AdaptiveValue :value="value" class="mt-3 font-bold leading-tight" :class="isDarkMode ? 'text-white' : 'text-gray-800'" />
|
||||
</div>
|
||||
<div
|
||||
class="shrink-0 rounded-full p-2.5 transition-transform duration-300 group-sm:p-3"
|
||||
class="absolute right-0 top-0 rounded-full p-1.5 transition-transform duration-300"
|
||||
:class="iconBgClass"
|
||||
>
|
||||
<component :is="icon" class="h-5 w-5 sm:h-6 sm:w-6" :class="iconClass" aria-hidden="true" />
|
||||
<component :is="icon" class="h-4 w-4 sm:h-5 sm:w-5" :class="iconClass" aria-hidden="true" />
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-2 line-clamp-2 text-xs sm:text-sm" :class="descriptionClass">
|
||||
@@ -31,6 +29,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import AdaptiveValue from './AdaptiveValue.vue'
|
||||
import type { Component } from 'vue'
|
||||
import { useInjectedDarkMode } from '@/composables'
|
||||
|
||||
@@ -50,7 +49,7 @@ const isDarkMode = useInjectedDarkMode()
|
||||
|
||||
const iconBgClass = computed(() => {
|
||||
const colorMap = {
|
||||
indigo: isDarkMode.value ? 'bg-[#294047]' : 'bg-[#dcebed]',
|
||||
indigo: isDarkMode.value ? 'bg-[#333d49]' : 'bg-[#dcebed]',
|
||||
purple: isDarkMode.value ? 'bg-[#443d4b]' : 'bg-[#e7e2ea]',
|
||||
green: isDarkMode.value ? 'bg-[#31564f]' : 'bg-[#e1eee8]',
|
||||
blue: isDarkMode.value ? 'bg-[#2d4851]' : 'bg-[#dce8eb]'
|
||||
|
||||
@@ -16,12 +16,12 @@ const toggleColorMode = () => {
|
||||
<button
|
||||
type="button"
|
||||
@click="toggleColorMode"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-full shadow-sm transition-all duration-200 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-[#8fb2bf] focus:ring-offset-2 motion-safe:hover:rotate-180"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-full shadow-sm transition-all duration-200 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-[#8fb2bf] focus:ring-offset-2 motion-safe:hover:rotate-180"
|
||||
:aria-label="isDarkMode ? t('common.switchToLight') : t('common.switchToDark')"
|
||||
:title="isDarkMode ? t('common.switchToLight') : t('common.switchToDark')"
|
||||
:class="
|
||||
isDarkMode
|
||||
? 'bg-[#263941] text-[#d8c98e]'
|
||||
? 'bg-[#2c3440] text-[#d8c98e]'
|
||||
: 'bg-[#edf4f5] text-[#4f6c75]'
|
||||
"
|
||||
>
|
||||
|
||||
@@ -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