✨ feat: 重构管理后台并增强组件系统与回收站功能
* 新增自适应数值与窗口分析工具,提升交互体验 * 优化回收站模块逻辑,增加展示与选择功能 * 引入 Macaron 主题配置文件并更新 Tailwind 配置 * 精简基础组件代码,移除冗余样式与设置项 * 完善测试用例,覆盖 UI 系统与回收站工作流 * 更新多语言配置,支持功能变更后的文案需求
This commit is contained in:
1 parent
614b9a2104
commit
9b22534e2b
61 files changed
+1624
-832
No files matched your search
+2
-4
@@ -54,10 +54,8 @@ const {
|
||||
linear-gradient(90deg, rgba(103, 135, 145, 0.12), rgba(162, 172, 154, 0.1));
|
||||
}
|
||||
|
||||
.dark {
|
||||
background:
|
||||
linear-gradient(135deg, #10191e 0%, #17252b 48%, #223036 100%),
|
||||
linear-gradient(90deg, rgba(113, 153, 168, 0.12), rgba(117, 143, 132, 0.08));
|
||||
.app-container.dark {
|
||||
background: var(--fcb-bg);
|
||||
}
|
||||
|
||||
.fade-enter-active,
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Action motion is independent of transforms used for positioned icons. */
|
||||
.fcb-action {
|
||||
--fcb-action-bg: var(--fcb-button-secondary-bg);
|
||||
--fcb-action-hover: var(--fcb-button-secondary-hover);
|
||||
--fcb-action-text: var(--fcb-button-secondary-text);
|
||||
--fcb-action-border: var(--fcb-button-secondary-border);
|
||||
--fcb-action-shadow: -3px -3px 8px rgb(255 255 255 / 70%), 3px 4px 9px rgb(107 132 146 / 15%);
|
||||
transition: translate 300ms ease, transform 300ms ease, box-shadow 300ms ease,
|
||||
background-color 300ms ease, border-color 300ms ease, color 300ms ease, opacity 300ms ease !important;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
.dark .fcb-action { --fcb-action-shadow: -3px -3px 8px rgb(24 31 44 / 35%), 3px 4px 9px rgb(108 129 164 / 12%); }
|
||||
@media (hover: hover) and (pointer: fine) {
|
||||
.fcb-action:not(:disabled):not([aria-disabled="true"]):hover {
|
||||
translate: 0 -2px;
|
||||
box-shadow: var(--fcb-action-shadow) !important;
|
||||
}
|
||||
.fcb-action:not(:disabled):active { translate: 0 0; }
|
||||
}
|
||||
.fcb-action:disabled, .fcb-action[aria-disabled="true"] { translate: none; }
|
||||
/* Only color roles override utility classes. Component spacing stays contextual. */
|
||||
.fcb-button-primary, .fcb-action:is(.bg-indigo-500,.bg-indigo-600,.bg-blue-500,.bg-blue-600,[class*="from-indigo-"],[class*="from-purple-"],[class*="bg-[#7198a6]"],[class*="bg-[#5f8796]"]) {
|
||||
--fcb-action-bg: var(--fcb-button-primary-bg); --fcb-action-hover: var(--fcb-button-primary-hover);
|
||||
--fcb-action-text: var(--fcb-button-primary-text); --fcb-action-border: var(--fcb-button-primary-border);
|
||||
}
|
||||
.fcb-button-secondary {
|
||||
--fcb-action-bg: var(--fcb-button-secondary-bg); --fcb-action-hover: var(--fcb-button-secondary-hover);
|
||||
--fcb-action-text: var(--fcb-button-secondary-text); --fcb-action-border: var(--fcb-button-secondary-border);
|
||||
}
|
||||
.fcb-button-success, .fcb-action:is(.bg-green-50,.bg-green-100,.bg-green-500,.bg-green-600,[class*="bg-[#6f9688]"]) {
|
||||
--fcb-action-bg: var(--fcb-button-success-bg); --fcb-action-hover: var(--fcb-button-success-hover);
|
||||
--fcb-action-text: var(--fcb-button-success-text); --fcb-action-border: var(--fcb-button-success-border);
|
||||
}
|
||||
.fcb-button-danger, .fcb-action:is(.bg-red-50,.bg-red-100,.bg-red-500,.bg-red-600,.bg-red-700) {
|
||||
--fcb-action-bg: var(--fcb-button-danger-bg); --fcb-action-hover: var(--fcb-button-danger-hover);
|
||||
--fcb-action-text: var(--fcb-button-danger-text); --fcb-action-border: var(--fcb-button-danger-border);
|
||||
}
|
||||
.fcb-button-outline, .fcb-action:is(.bg-purple-50,.bg-purple-100) {
|
||||
--fcb-action-bg: var(--fcb-button-outline-bg); --fcb-action-hover: var(--fcb-button-outline-hover);
|
||||
--fcb-action-text: var(--fcb-button-outline-text); --fcb-action-border: var(--fcb-button-outline-border);
|
||||
}
|
||||
.fcb-action {
|
||||
background-color: var(--fcb-action-bg) !important;
|
||||
color: var(--fcb-action-text) !important;
|
||||
border-color: var(--fcb-action-border) !important;
|
||||
}
|
||||
.fcb-action:is([class*="fcb-button-"],[class*="from-indigo-"],[class*="from-purple-"]) { background-image: none !important; }
|
||||
.fcb-action:not(:disabled):hover { background-color: var(--fcb-action-hover) !important; }
|
||||
.fcb-action svg { flex-shrink: 0; }
|
||||
.fcb-icon-action { padding-inline: 0 !important; }
|
||||
.fcb-icon-action > svg { margin-inline: 0 !important; }
|
||||
|
||||
@media (max-width: 639px) {
|
||||
:root {
|
||||
--fcb-control-size: clamp(36px, 9.5vw, 40px);
|
||||
--fcb-control-font: clamp(12px, 3.35vw, 14px);
|
||||
--fcb-control-px: clamp(8px, 2.5vw, 12px);
|
||||
}
|
||||
.fcb-action:not(.fcb-content-action) {
|
||||
min-height: var(--fcb-control-size) !important;
|
||||
height: auto;
|
||||
padding-block: 6px !important;
|
||||
padding-inline: var(--fcb-control-px) !important;
|
||||
font-size: var(--fcb-control-font) !important;
|
||||
line-height: 1.4;
|
||||
border-radius: 14px;
|
||||
}
|
||||
.fcb-action:not(.fcb-content-action) svg {
|
||||
width: clamp(14px, 4vw, 17px);
|
||||
height: clamp(14px, 4vw, 17px);
|
||||
}
|
||||
.fcb-action:not(.fcb-content-action) svg[class*="mr-"] { margin-right: 5px; }
|
||||
.fcb-action:not(.fcb-content-action) svg[class*="ml-"] { margin-left: 5px; }
|
||||
.fcb-icon-action {
|
||||
width: var(--fcb-control-size) !important;
|
||||
height: var(--fcb-control-size) !important;
|
||||
min-width: var(--fcb-control-size) !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.fcb-icon-action > svg { margin-inline: 0 !important; }
|
||||
.fcb-pagination-controls { gap: 4px; }
|
||||
.fcb-pagination-controls .fcb-action { min-width: 0; padding-inline: 7px !important; white-space: nowrap; }
|
||||
.fcb-page-size {
|
||||
min-height: var(--fcb-control-size) !important;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
padding-inline: 5px !important;
|
||||
font-size: var(--fcb-control-font);
|
||||
}
|
||||
.fcb-metric-card { min-width: 0; padding: 10px 8px !important; border-radius: 16px; }
|
||||
.fcb-metric-card > div:first-child { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px; }
|
||||
.fcb-metric-card > p { font-size: 11px; overflow-wrap: anywhere; }
|
||||
.fcb-summary-grid > div { border-radius: 16px; }
|
||||
.fcb-summary-grid p { font-size: 11px; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.fcb-action { transition-duration: .01ms !important; }
|
||||
.fcb-action:not(:disabled):not([aria-disabled="true"]):hover { translate: none; }
|
||||
}
|
||||
|
||||
.fcb-content-action { --fcb-action-bg: transparent; --fcb-action-hover: transparent; --fcb-action-text: inherit; }
|
||||
/* Match the selected pagination item without requiring dark text on a dark fill. */
|
||||
.fcb-action[aria-current="page"] { outline: 2px solid var(--fcb-button-primary-border); outline-offset: 1px; font-weight: 700; }
|
||||
|
||||
@media (max-width: 639px) {
|
||||
.fcb-pagination-controls { column-gap: 6px; }
|
||||
.fcb-page-size { justify-self: start; width: 5.1rem; border-radius: 12px; }
|
||||
.fcb-pagination-controls .fcb-page-nav {
|
||||
width: var(--fcb-control-size);
|
||||
height: var(--fcb-control-size);
|
||||
min-width: var(--fcb-control-size);
|
||||
padding: 0 !important;
|
||||
border: 1px solid var(--fcb-border);
|
||||
border-radius: 12px;
|
||||
}
|
||||
.fcb-page-nav:disabled { opacity: .45; box-shadow: none; }
|
||||
.fcb-page-counter { min-width: 3rem; font-size: 12px; color: var(--fcb-text); }
|
||||
}
|
||||
|
||||
@media (max-width: 639px) {
|
||||
.fcb-action:not(.fcb-content-action) :is(.text-sm, .text-base, .text-lg) { font-size: inherit; }
|
||||
}
|
||||
|
||||
/* Button-like checkbox labels keep native multi-selection and keyboard access. */
|
||||
.fcb-choice:has(input:focus-visible) .fcb-choice-face { outline: 3px solid var(--fcb-primary); outline-offset: 3px; }
|
||||
.fcb-choice:has(input:disabled) .fcb-choice-face { translate: none !important; opacity: .5; cursor: not-allowed; }
|
||||
|
||||
/* Native semantics with theme-aware checkbox surfaces (including mixed state). */
|
||||
input[type="checkbox"]:not(.sr-only) {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
min-width: 20px;
|
||||
margin: 0;
|
||||
vertical-align: middle;
|
||||
border: 1px solid var(--fcb-button-secondary-border);
|
||||
border-radius: 6px;
|
||||
background-color: var(--fcb-surface);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 15px 15px;
|
||||
box-shadow: inset 1px 1px 3px rgb(107 132 146 / 12%);
|
||||
cursor: pointer;
|
||||
transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
|
||||
}
|
||||
input[type="checkbox"]:not(.sr-only):is(:checked,:indeterminate) {
|
||||
background-color: var(--fcb-button-primary-bg);
|
||||
border-color: var(--fcb-button-primary-border);
|
||||
box-shadow: none;
|
||||
}
|
||||
input[type="checkbox"]:not(.sr-only):checked {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-8' fill='none' stroke='%23304f60' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
||||
}
|
||||
input[type="checkbox"]:not(.sr-only):indeterminate {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10h12' stroke='%23304f60' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||
}
|
||||
.dark input[type="checkbox"]:not(.sr-only):checked {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-8' fill='none' stroke='%23dfedf4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
||||
}
|
||||
.dark input[type="checkbox"]:not(.sr-only):indeterminate {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10h12' stroke='%23dfedf4' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||
}
|
||||
input[type="checkbox"]:not(.sr-only):disabled { cursor: not-allowed; opacity: .45; }
|
||||
@media (forced-colors: active) { input[type="checkbox"]:not(.sr-only) { appearance: auto; background-image: none; } }
|
||||
|
||||
/* Input accessories stay inside the field and never act like floating cards. */
|
||||
.fcb-action.fcb-input-action,
|
||||
.fcb-action.fcb-input-action:not(:disabled):hover {
|
||||
position: absolute;
|
||||
inset-block: 4px;
|
||||
right: 5px;
|
||||
width: 36px;
|
||||
min-width: 36px;
|
||||
min-height: 0 !important;
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
background: transparent !important;
|
||||
color: var(--fcb-text-muted) !important;
|
||||
box-shadow: none !important;
|
||||
translate: none !important;
|
||||
transform: none !important;
|
||||
}
|
||||
.fcb-action.fcb-input-action:not(:disabled):hover { color: var(--fcb-text) !important; }
|
||||
.fcb-filter-grid { align-items: end; }
|
||||
.fcb-filter-grid :is(input,select) { height: 40px; min-height: 40px; font-size: 14px; }
|
||||
.fcb-filter-grid .fcb-action { min-height: 40px; }
|
||||
@media (max-width: 639px) {
|
||||
.fcb-filter-grid :is(input,select), .fcb-filter-grid .fcb-action { height: var(--fcb-control-size); min-height: var(--fcb-control-size); font-size: var(--fcb-control-font); }
|
||||
}
|
||||
/* Clickable list content is not a floating action card. */
|
||||
.fcb-action.fcb-content-action,
|
||||
.fcb-action.fcb-content-action:not(:disabled):not([aria-disabled="true"]):hover {
|
||||
translate: none !important;
|
||||
transform: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
+77
-332
@@ -1,8 +1,10 @@
|
||||
@import 'tailwindcss/base';
|
||||
@import 'tailwindcss/components';
|
||||
@import 'tailwindcss/utilities';
|
||||
@import './controls.css';
|
||||
|
||||
html {
|
||||
color-scheme: light;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
@@ -85,46 +87,8 @@ textarea {
|
||||
box-shadow: 0 16px 34px rgba(114, 143, 150, 0.26);
|
||||
}
|
||||
|
||||
.fcb-interactive-row {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
transition:
|
||||
background-color 180ms ease,
|
||||
border-color 180ms ease,
|
||||
box-shadow 180ms ease,
|
||||
transform 180ms ease;
|
||||
}
|
||||
|
||||
.fcb-interactive-row:hover {
|
||||
z-index: 1;
|
||||
box-shadow: inset 3px 0 0 rgba(95, 135, 150, 0.7), 0 10px 22px rgba(86, 118, 126, 0.16);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* List rows use the same pastel highlight timing and palette as cards. */
|
||||
.fcb-interactive-row {
|
||||
transition: all 300ms ease !important;
|
||||
}
|
||||
.fcb-interactive-row:hover {
|
||||
background: #f0f4f8 !important;
|
||||
box-shadow: -6px -6px 16px rgba(255,255,255,.8), 6px 6px 16px rgba(163,177,198,.35) !important;
|
||||
transform: none !important;
|
||||
}
|
||||
.dark .fcb-interactive-row:hover {
|
||||
background: #2f414a !important;
|
||||
box-shadow: -6px -6px 16px rgba(69,88,99,.4), 6px 6px 16px rgba(10,18,23,.45) !important;
|
||||
}
|
||||
.fcb-list-row { transition: background-color 260ms ease-out, box-shadow 260ms ease-out, border-color 260ms ease-out !important; }
|
||||
.fcb-list-row:hover { background: #dcebed !important; box-shadow: inset 0 0 0 2px rgba(113,152,166,.42), 0 8px 18px rgba(115,139,151,.28) !important; }
|
||||
.dark .fcb-list-row:hover { background: #2f414a !important; }
|
||||
|
||||
.dark .theme-2026-card {
|
||||
border-color: rgba(68, 86, 94, 0.82);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(34, 49, 56, 0.96), rgba(24, 35, 42, 0.92)),
|
||||
radial-gradient(circle at 14% 10%, rgba(102, 142, 156, 0.18), transparent 32%);
|
||||
box-shadow: 0 16px 36px rgba(4, 10, 14, 0.34);
|
||||
}
|
||||
|
||||
.dark .theme-2026-card-hover:hover {
|
||||
border-color: rgba(113, 153, 168, 0.68);
|
||||
@@ -132,8 +96,6 @@ textarea {
|
||||
}
|
||||
.fcb-secondary-card { transition: all 300ms ease !important; box-shadow: -8px -8px 20px rgba(255,255,255,.8), 8px 8px 20px rgba(163,177,198,.5) !important; }
|
||||
.fcb-secondary-card:hover { transform: translateY(-2px); background: #f0f4f8 !important; box-shadow: -10px -10px 25px rgba(255,255,255,.9), 10px 10px 25px rgba(163,177,198,.6) !important; }
|
||||
.fcb-refresh-button { transition: transform 300ms ease, box-shadow 300ms ease, background-color 300ms ease !important; }
|
||||
.fcb-refresh-button:hover { transform: translateY(-2px) !important; box-shadow: -8px -8px 18px rgba(255,255,255,.86), 8px 8px 18px rgba(163,177,198,.48) !important; }
|
||||
|
||||
.data-table-2026 thead th {
|
||||
background: rgba(236, 244, 246, 0.76);
|
||||
@@ -145,10 +107,6 @@ textarea {
|
||||
opacity 180ms ease;
|
||||
}
|
||||
|
||||
.data-table-2026 tbody tr:hover {
|
||||
background: rgba(226, 236, 238, 0.46);
|
||||
}
|
||||
|
||||
.data-table-2026 tbody tr.is-selected {
|
||||
background: rgba(213, 228, 230, 0.72);
|
||||
}
|
||||
@@ -161,274 +119,10 @@ textarea {
|
||||
background: rgba(31, 45, 52, 0.82);
|
||||
}
|
||||
|
||||
.dark .data-table-2026 tbody tr:hover {
|
||||
background: rgba(45, 71, 81, 0.42);
|
||||
}
|
||||
|
||||
.dark .data-table-2026 tbody tr.is-selected-dark {
|
||||
background: rgba(42, 64, 72, 0.68);
|
||||
}
|
||||
|
||||
.bg-indigo-50,
|
||||
.bg-blue-50 {
|
||||
background-color: #dce8eb !important;
|
||||
}
|
||||
|
||||
.bg-indigo-100,
|
||||
.bg-blue-100 {
|
||||
background-color: #d1e0e3 !important;
|
||||
}
|
||||
|
||||
.bg-indigo-500,
|
||||
.bg-blue-500,
|
||||
.bg-cyan-500 {
|
||||
background-color: #6f98a6 !important;
|
||||
}
|
||||
|
||||
.bg-indigo-600,
|
||||
.bg-blue-600,
|
||||
.bg-cyan-600 {
|
||||
background-color: #5f8796 !important;
|
||||
}
|
||||
|
||||
.bg-indigo-700,
|
||||
.bg-blue-700,
|
||||
.bg-cyan-700 {
|
||||
background-color: #527887 !important;
|
||||
}
|
||||
|
||||
.bg-green-50 {
|
||||
background-color: #e1eee8 !important;
|
||||
}
|
||||
|
||||
.bg-green-100 {
|
||||
background-color: #d4e5dd !important;
|
||||
}
|
||||
|
||||
.bg-green-500,
|
||||
.bg-green-600 {
|
||||
background-color: #6f9688 !important;
|
||||
}
|
||||
|
||||
.bg-green-700 {
|
||||
background-color: #5f8377 !important;
|
||||
}
|
||||
|
||||
.bg-red-50 {
|
||||
background-color: #f1e2e5 !important;
|
||||
}
|
||||
|
||||
.bg-red-100 {
|
||||
background-color: #e8d3d7 !important;
|
||||
}
|
||||
|
||||
.bg-red-500,
|
||||
.bg-red-600 {
|
||||
background-color: #9b6a72 !important;
|
||||
}
|
||||
|
||||
.bg-red-700 {
|
||||
background-color: #895c63 !important;
|
||||
}
|
||||
|
||||
.bg-purple-50 {
|
||||
background-color: #e7e2ea !important;
|
||||
}
|
||||
|
||||
.bg-purple-100 {
|
||||
background-color: #ddd6e2 !important;
|
||||
}
|
||||
|
||||
.bg-purple-500,
|
||||
.bg-pink-500 {
|
||||
background-color: #8c8294 !important;
|
||||
}
|
||||
|
||||
.bg-purple-600,
|
||||
.bg-pink-600 {
|
||||
background-color: #7b7284 !important;
|
||||
}
|
||||
|
||||
.text-indigo-200,
|
||||
.text-blue-200 {
|
||||
color: #d8e8eb !important;
|
||||
}
|
||||
|
||||
.text-indigo-300,
|
||||
.text-blue-300 {
|
||||
color: #b8d4dc !important;
|
||||
}
|
||||
|
||||
.text-indigo-400,
|
||||
.text-blue-400,
|
||||
.text-cyan-400 {
|
||||
color: #8fb2bf !important;
|
||||
}
|
||||
|
||||
.text-indigo-500,
|
||||
.text-blue-500,
|
||||
.text-cyan-500 {
|
||||
color: #6f98a6 !important;
|
||||
}
|
||||
|
||||
.text-indigo-600,
|
||||
.text-blue-600,
|
||||
.text-cyan-600 {
|
||||
color: #5f8796 !important;
|
||||
}
|
||||
|
||||
.text-indigo-700,
|
||||
.text-blue-700 {
|
||||
color: #3f6a77 !important;
|
||||
}
|
||||
|
||||
.text-green-300,
|
||||
.text-green-400 {
|
||||
color: #b6d6ca !important;
|
||||
}
|
||||
|
||||
.text-green-500,
|
||||
.text-green-600,
|
||||
.text-green-700 {
|
||||
color: #5f8377 !important;
|
||||
}
|
||||
|
||||
.text-red-200,
|
||||
.text-red-300,
|
||||
.text-red-400 {
|
||||
color: #e5c5ca !important;
|
||||
}
|
||||
|
||||
.text-red-500,
|
||||
.text-red-600,
|
||||
.text-red-700 {
|
||||
color: #8b5962 !important;
|
||||
}
|
||||
|
||||
.text-purple-300,
|
||||
.text-purple-400 {
|
||||
color: #d4c8dc !important;
|
||||
}
|
||||
|
||||
.text-purple-500,
|
||||
.text-purple-600,
|
||||
.text-purple-700 {
|
||||
color: #6f6379 !important;
|
||||
}
|
||||
|
||||
.border-indigo-100,
|
||||
.border-blue-100 {
|
||||
border-color: #cfe1e4 !important;
|
||||
}
|
||||
|
||||
.border-indigo-300,
|
||||
.border-blue-300 {
|
||||
border-color: #9db6bd !important;
|
||||
}
|
||||
|
||||
.border-indigo-400,
|
||||
.border-indigo-500,
|
||||
.border-blue-500 {
|
||||
border-color: #8fb2bf !important;
|
||||
}
|
||||
|
||||
.border-indigo-600 {
|
||||
border-color: #5f8796 !important;
|
||||
}
|
||||
|
||||
.border-red-100 {
|
||||
border-color: #e8d3d7 !important;
|
||||
}
|
||||
|
||||
.border-red-200,
|
||||
.border-red-500 {
|
||||
border-color: #c9a4aa !important;
|
||||
}
|
||||
|
||||
.focus\:ring-indigo-500:focus,
|
||||
.focus\:ring-blue-500:focus,
|
||||
.focus\:ring-cyan-500:focus,
|
||||
.focus\:ring-purple-500:focus {
|
||||
--tw-ring-color: #8fb2bf !important;
|
||||
}
|
||||
|
||||
.focus\:border-indigo-500:focus,
|
||||
.focus\:border-cyan-500:focus {
|
||||
border-color: #8fb2bf !important;
|
||||
}
|
||||
|
||||
.hover\:bg-indigo-100:hover,
|
||||
.hover\:bg-blue-100:hover {
|
||||
background-color: #cfe1e4 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-indigo-500:hover,
|
||||
.hover\:bg-blue-500:hover,
|
||||
.hover\:bg-cyan-500:hover {
|
||||
background-color: #6f98a6 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-indigo-600:hover,
|
||||
.hover\:bg-blue-600:hover,
|
||||
.hover\:bg-cyan-600:hover {
|
||||
background-color: #527887 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-indigo-700:hover,
|
||||
.hover\:bg-blue-700:hover,
|
||||
.hover\:bg-cyan-700:hover {
|
||||
background-color: #466b78 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-green-100:hover {
|
||||
background-color: #d4e5dd !important;
|
||||
}
|
||||
|
||||
.hover\:bg-green-400:hover,
|
||||
.hover\:bg-green-600:hover,
|
||||
.hover\:bg-green-700:hover {
|
||||
background-color: #5f8377 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-red-100:hover {
|
||||
background-color: #e8d3d7 !important;
|
||||
}
|
||||
|
||||
.hover\:bg-red-400:hover,
|
||||
.hover\:bg-red-600:hover,
|
||||
.hover\:bg-red-700:hover {
|
||||
background-color: #895c63 !important;
|
||||
}
|
||||
|
||||
.hover\:border-indigo-500:hover {
|
||||
border-color: #8fb2bf !important;
|
||||
}
|
||||
|
||||
.from-indigo-500,
|
||||
.from-indigo-600,
|
||||
.from-cyan-500,
|
||||
.from-cyan-600 {
|
||||
--tw-gradient-from: #5f8796 var(--tw-gradient-from-position) !important;
|
||||
--tw-gradient-to: rgba(95, 135, 150, 0) var(--tw-gradient-to-position) !important;
|
||||
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
|
||||
}
|
||||
|
||||
.via-purple-500,
|
||||
.via-purple-600 {
|
||||
--tw-gradient-to: rgba(140, 130, 148, 0) var(--tw-gradient-to-position) !important;
|
||||
--tw-gradient-stops:
|
||||
var(--tw-gradient-from),
|
||||
#8c8294 var(--tw-gradient-via-position),
|
||||
var(--tw-gradient-to) !important;
|
||||
}
|
||||
|
||||
.to-purple-500,
|
||||
.to-purple-600,
|
||||
.to-pink-500,
|
||||
.to-pink-600 {
|
||||
--tw-gradient-to: #6f9688 var(--tw-gradient-to-position) !important;
|
||||
}
|
||||
|
||||
/* Serenity-inspired soft pastel motion and surfaces. */
|
||||
:root {
|
||||
--fcb-pastel-sage: #9fc9bd;
|
||||
@@ -448,7 +142,6 @@ body { background: var(--fcb-surface); }
|
||||
box-shadow: 0 16px 34px rgba(112, 137, 151, .22), -8px -8px 20px rgba(255,255,255,.78) !important;
|
||||
}
|
||||
button, a { -webkit-tap-highlight-color: transparent; }
|
||||
button:not(:disabled):not(.fcb-health-card), a { transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease !important; }
|
||||
.fcb-lifecycle-list { overflow: visible; will-change: height; }
|
||||
.fcb-lifecycle-row { will-change: opacity; }
|
||||
.fcb-lifecycle-card { transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease !important; }
|
||||
@@ -463,7 +156,8 @@ button:not(:disabled):not(.fcb-health-card), a { transition: color 220ms ease, b
|
||||
--fcb-surface: #f7fafb;
|
||||
--fcb-surface-muted: #e7eef1;
|
||||
--fcb-text: #405466;
|
||||
--fcb-text-muted: #8494a3;
|
||||
--fcb-text-muted: #607580;
|
||||
--fcb-border: #cbdde3;
|
||||
--fcb-primary: #7198a6;
|
||||
--fcb-primary-dark: #628b9b;
|
||||
--fcb-mint: #a8d0c2;
|
||||
@@ -507,39 +201,18 @@ html, body, #app { background: var(--fcb-bg); color: var(--fcb-text); }
|
||||
background: #2f414a !important;
|
||||
box-shadow: -10px -10px 25px rgba(69,88,99,.45), 10px 10px 25px rgba(10,18,23,.55) !important;
|
||||
}
|
||||
input:not([type=file]), select, textarea { background: var(--fcb-surface) !important; color: var(--fcb-text) !important; border-color: #d5e1e5 !important; box-shadow: var(--fcb-shadow-in); }
|
||||
input:not([type=file]):not([type=checkbox]):not([type=radio]), select:not(.native-date-part), textarea { background: var(--fcb-surface) !important; color: var(--fcb-text) !important; border-color: var(--fcb-border) !important; box-shadow: var(--fcb-shadow-in); }
|
||||
button, a { border-radius: 14px; }
|
||||
button:not(:disabled), a { cursor: pointer; }
|
||||
button:not(:disabled):hover { filter: brightness(1.025); }
|
||||
.bg-indigo-500, .bg-indigo-600, .bg-blue-500, .bg-blue-600, .bg-purple-600 { background-color: var(--fcb-primary) !important; }
|
||||
.from-indigo-500, .from-indigo-600, .from-purple-500, .from-purple-600, .from-pink-500, .via-purple-500, .to-purple-600, .to-pink-500 { --tw-gradient-from: var(--fcb-primary) !important; --tw-gradient-to: var(--fcb-primary-dark) !important; }
|
||||
.text-indigo-600, .text-indigo-500, .text-blue-600 { color: var(--fcb-primary-dark) !important; }
|
||||
.border-indigo-500, .border-indigo-600 { border-color: #a8c8cc !important; }
|
||||
.fcb-lifecycle-card { background: var(--fcb-bg) !important; }
|
||||
.loading-overlay { background: rgba(225,235,238,.72) !important; backdrop-filter: blur(8px); }
|
||||
.loading-spinner { border-color: #d5e5e7 !important; border-top-color: var(--fcb-primary) !important; }
|
||||
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .theme-2026-card-hover:hover, .fcb-lifecycle-card:hover { transform: none !important; } }
|
||||
|
||||
/* Component-level pastel normalization */
|
||||
.bg-white, .bg-gray-50, .bg-gray-100 { background-color: var(--fcb-surface) !important; }
|
||||
.bg-gray-200, .bg-gray-700, .bg-gray-800, .bg-gray-900 { background-color: var(--fcb-surface-muted) !important; color: var(--fcb-text) !important; }
|
||||
.text-gray-900, .text-gray-800, .text-gray-700 { color: var(--fcb-text) !important; }
|
||||
.text-gray-600, .text-gray-500, .text-gray-400 { color: var(--fcb-text-muted) !important; }
|
||||
.border-gray-100, .border-gray-200, .border-gray-300, .border-gray-600, .border-gray-700 { border-color: #d5e1e5 !important; }
|
||||
.bg-red-600, .bg-red-500 { background-color: #d99a9c !important; }
|
||||
.hover\\:bg-red-700:hover { background-color: #c9888b !important; }
|
||||
.fcb-lifecycle-row { transition: opacity 420ms cubic-bezier(.22,1,.36,1); }
|
||||
.fcb-lifecycle-list, .fcb-expand-content { overflow: hidden; }
|
||||
|
||||
/* List highlighting stays inside the hovered row. */
|
||||
.fcb-list-row {
|
||||
transition: background-color 260ms ease-out !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.fcb-list-row:hover {
|
||||
background: #d6e8ec !important;
|
||||
box-shadow: inset 0 0 0 2px rgba(113,152,166,.5) !important;
|
||||
}
|
||||
|
||||
/* Final specificity: health cards are inner cards, so they lift 2px. */
|
||||
.theme-2026-card .fcb-health-card:hover,
|
||||
@@ -553,3 +226,75 @@ button:not(:disabled):hover { filter: brightness(1.025); }
|
||||
transform: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Matching dark surfaces retain the same pastel families with readable contrast. */
|
||||
.dark {
|
||||
color-scheme: dark;
|
||||
--fcb-bg: #252b34;
|
||||
--fcb-surface: #2c3440;
|
||||
--fcb-surface-muted: #333d49;
|
||||
--fcb-text: #dfebee;
|
||||
--fcb-text-muted: #adbec6;
|
||||
--fcb-border: #495765;
|
||||
--fcb-shadow-in: inset 3px 3px 8px rgba(9,20,25,.28), inset -3px -3px 8px rgba(75,98,109,.12);
|
||||
}
|
||||
/* Dark neumorphism uses soft grey-blue light, not black rims. */
|
||||
.dark .theme-2026-card, .dark .theme-2026-card-hover, .dark .fcb-lifecycle-card {
|
||||
box-shadow: -8px -8px 20px rgba(102,119,146,.16), 8px 8px 20px rgba(24,31,44,.55) !important;
|
||||
}
|
||||
.dark .theme-2026-card::before { display: none; }
|
||||
.dark .theme-2026-card-hover:hover, .dark .fcb-secondary-card:hover {
|
||||
background: #2d3541 !important;
|
||||
box-shadow: -10px -10px 25px rgba(102,119,146,.21), 10px 10px 25px rgba(24,31,44,.62) !important;
|
||||
}
|
||||
.fcb-summary-grid .fcb-secondary-card:hover { transform: translateY(-2px) !important; }
|
||||
button.theme-2026-card-hover:disabled:hover { transform: none !important; }
|
||||
@media (prefers-reduced-motion: reduce), (hover: none) {
|
||||
.fcb-summary-grid .fcb-secondary-card:hover { transform: none !important; }
|
||||
}
|
||||
.dark :is(.shadow-sm, .shadow-md, .shadow-lg, .shadow-xl) {
|
||||
--tw-shadow-color: rgba(35, 46, 65, .24);
|
||||
--tw-shadow: var(--tw-shadow-colored);
|
||||
}
|
||||
|
||||
/* Light: upper-left light, lower-right shade. Dark reverses this direction. */
|
||||
:root {
|
||||
--fcb-card-shadow: -8px -8px 20px rgba(255,255,255,.85), 8px 8px 20px rgba(163,177,198,.38);
|
||||
--fcb-card-shadow-hover: -10px -10px 25px rgba(255,255,255,.92), 10px 10px 25px rgba(163,177,198,.48);
|
||||
}
|
||||
.dark {
|
||||
--fcb-card-shadow: -8px -8px 20px rgba(24,31,44,.55), 8px 8px 20px rgba(102,119,146,.16);
|
||||
--fcb-card-shadow-hover: -10px -10px 25px rgba(24,31,44,.62), 10px 10px 25px rgba(102,119,146,.21);
|
||||
}
|
||||
:is(.fcb-surface, .theme-2026-card, .theme-2026-card-hover, .fcb-lifecycle-card, .fcb-secondary-card),
|
||||
.dark :is(.fcb-surface, .theme-2026-card, .theme-2026-card-hover, .fcb-lifecycle-card, .fcb-secondary-card) {
|
||||
box-shadow: var(--fcb-card-shadow) !important;
|
||||
}
|
||||
:is(.theme-2026-card-hover, .fcb-lifecycle-card, .fcb-secondary-card):hover,
|
||||
.dark :is(.theme-2026-card-hover, .fcb-lifecycle-card, .fcb-secondary-card):hover {
|
||||
box-shadow: var(--fcb-card-shadow-hover) !important;
|
||||
}
|
||||
/* Large content sections retain their position while their children animate. */
|
||||
section.theme-2026-card:hover { transform: none !important; }
|
||||
|
||||
.fcb-surface { background: var(--fcb-bg) !important; border-color: var(--fcb-border) !important; }
|
||||
/* Matte faces: directional shadows provide depth without a painted gradient. */
|
||||
.theme-2026-card::before { display: none; }
|
||||
|
||||
.fcb-static-container:hover { transform: none !important; translate: none !important; }
|
||||
.fcb-surface .theme-2026-card-hover:hover { transform: translateY(-2px) !important; }
|
||||
@media (prefers-reduced-motion: reduce), (hover: none) {
|
||||
.fcb-surface .theme-2026-card-hover:hover { transform: none !important; }
|
||||
}
|
||||
|
||||
/* Lists highlight without frames, elevation or movement. Keyboard focus stays visible. */
|
||||
:root { --fcb-row-hover: #dcebef; }
|
||||
.dark { --fcb-row-hover: #303d4a; }
|
||||
.fcb-list-row, .fcb-interactive-row, .data-table-2026 tbody tr {
|
||||
transition: background-color 300ms ease !important;
|
||||
}
|
||||
.fcb-list-row:hover, .fcb-interactive-row:hover, .data-table-2026 tbody tr:hover {
|
||||
background-color: var(--fcb-row-hover) !important;
|
||||
box-shadow: none !important;
|
||||
transform: none !important;
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TrashService } from '@/services'
|
||||
import type { TrashListParams, TrashListResponse } from '@/types'
|
||||
import type { TrashListParams, TrashListResponse, TrashRetentionRequest, TrashBatchRequest } from '@/types'
|
||||
|
||||
export function useAdminTrash() {
|
||||
const fetchTrash = async (params: TrashListParams): Promise<TrashListResponse | null> => {
|
||||
@@ -9,8 +9,10 @@ export function useAdminTrash() {
|
||||
|
||||
const restoreTrashItem = async (id: number) => TrashService.restore(id)
|
||||
const purgeTrashItem = async (id: number) => TrashService.purge(id)
|
||||
const updateTrashRetention = async (id: number, retentionDays: number) =>
|
||||
TrashService.updateRetention(id, retentionDays)
|
||||
const updateTrashRetention = async (id: number, retention: TrashRetentionRequest) =>
|
||||
TrashService.updateRetention(id, retention)
|
||||
|
||||
return { fetchTrash, restoreTrashItem, purgeTrashItem, updateTrashRetention }
|
||||
const batchTrash = (request: TrashBatchRequest) => TrashService.batch(request)
|
||||
|
||||
return { batchTrash, fetchTrash, restoreTrashItem, purgeTrashItem, updateTrashRetention }
|
||||
}
|
||||
@@ -135,6 +135,10 @@ export default {
|
||||
history: 'Historical'
|
||||
},
|
||||
trend: {
|
||||
windowDays: 'Days {start}–{end} of {total}',
|
||||
downloadTotal: 'Period downloads',
|
||||
uploadTotal: 'Period uploads',
|
||||
times: '{count} times',
|
||||
title: 'Download / Upload Trend',
|
||||
mobileHint: 'Tap or slide to inspect; drag the bottom date axis to pan',
|
||||
startDate: 'Start date',
|
||||
|
||||
@@ -135,6 +135,10 @@ export default {
|
||||
history: '历史'
|
||||
},
|
||||
trend: {
|
||||
windowDays: '显示第 {start}–{end} 天,共 {total} 天',
|
||||
downloadTotal: '期间下载',
|
||||
uploadTotal: '期间上传',
|
||||
times: '{count} 次',
|
||||
title: '下载/上传趋势',
|
||||
mobileHint: '轻触或滑动查看数据;拖动底部日期轴平移图表',
|
||||
startDate: '开始日期',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="flex h-screen overflow-hidden flex-col transition-colors duration-300 lg:flex-row"
|
||||
:class="[isDarkMode ? 'bg-[#10191e]' : 'bg-[#dfe9eb]']"
|
||||
:class="[isDarkMode ? 'bg-[#252b34]' : 'bg-[#dfe9eb]']"
|
||||
>
|
||||
<button
|
||||
v-if="isSidebarOpen"
|
||||
@@ -17,7 +17,7 @@
|
||||
class="fixed inset-y-0 left-0 z-50 flex h-full w-64 shrink-0 transform flex-col border-r shadow-2xl lg:relative lg:h-screen lg:translate-x-0 lg:shadow-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'border-[#3d555f] bg-[#18282f]'
|
||||
? 'border-[#495765] bg-[#272e38]'
|
||||
: 'border-[#b8cbd0] bg-[#f9fcfc]',
|
||||
isSidebarOpen ? 'translate-x-0' : '-translate-x-full',
|
||||
'transition-transform duration-300 ease-in-out lg:transition-none'
|
||||
@@ -26,13 +26,13 @@
|
||||
<!-- Logo区域 -->
|
||||
<div
|
||||
class="flex items-center justify-between h-16 px-4 border-b"
|
||||
:class="[isDarkMode ? 'border-[#3d555f]' : 'border-[#c8d7da]']"
|
||||
:class="[isDarkMode ? 'border-[#495765]' : 'border-[#c8d7da]']"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class="rounded-full bg-gradient-to-r from-[#6f98a6] via-[#8eaaa8] to-[#b7b2a1] p-1 animate-spin-slow"
|
||||
>
|
||||
<div class="rounded-full p-1" :class="[isDarkMode ? 'bg-[#18282f]' : 'bg-white']">
|
||||
<div class="rounded-full p-1" :class="[isDarkMode ? 'bg-[#272e38]' : 'bg-white']">
|
||||
<BoxIcon
|
||||
class="w-6 h-6"
|
||||
:class="[isDarkMode ? 'text-[#b9dbe2]' : 'text-[#356b7d]']"
|
||||
@@ -47,7 +47,7 @@
|
||||
{{ t('common.appName') }}
|
||||
</h1>
|
||||
</div>
|
||||
<button type="button" :aria-label="t('common.closeMenu')" :title="t('common.closeMenu')" @click="closeSidebar" class="flex h-11 w-11 items-center justify-center rounded-lg transition-colors lg:hidden" :class="[isDarkMode ? 'hover:bg-[#294047]' : 'hover:bg-[#e5eff1]']">
|
||||
<button type="button" :aria-label="t('common.closeMenu')" :title="t('common.closeMenu')" @click="closeSidebar" class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-lg transition-colors lg:hidden" :class="[isDarkMode ? 'hover:bg-[#333d49]' : 'hover:bg-[#e5eff1]']">
|
||||
<XIcon class="w-6 h-6" :class="[isDarkMode ? 'text-[#d7e6e9]' : 'text-[#294b56]']" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -78,10 +78,10 @@
|
||||
</nav>
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<div class="p-4 border-t" :class="[isDarkMode ? 'border-[#3d555f]' : 'border-[#c8d7da]']">
|
||||
<div class="p-4 border-t" :class="[isDarkMode ? 'border-[#495765]' : 'border-[#c8d7da]']">
|
||||
<button
|
||||
@click="handleLogout"
|
||||
class="flex min-h-11 w-full items-center rounded-lg p-2 transition-colors duration-200"
|
||||
class="fcb-action flex min-h-11 w-full items-center rounded-lg p-2 transition-colors duration-200"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'text-[#d0dee1] hover:bg-[#223942] hover:text-white'
|
||||
@@ -99,10 +99,10 @@
|
||||
<!-- Header -->
|
||||
<header
|
||||
class="h-14 border-b shadow-md transition-colors duration-300 lg:hidden"
|
||||
:class="[isDarkMode ? 'bg-[#1a2930] border-[#31454d]' : 'bg-[#f2f6f5] border-[#c8d7da]']"
|
||||
:class="[isDarkMode ? 'bg-[#2c3440] border-[#495765]' : 'bg-[#f2f6f5] border-[#c8d7da]']"
|
||||
>
|
||||
<div class="flex h-14 items-center justify-between px-4">
|
||||
<button ref="menuButtonRef" type="button" :aria-label="t('common.openMenu')" :title="t('common.openMenu')" :aria-expanded="isSidebarOpen" @click="openSidebar" class="flex h-11 w-11 items-center justify-center rounded-lg lg:hidden">
|
||||
<button ref="menuButtonRef" type="button" :aria-label="t('common.openMenu')" :title="t('common.openMenu')" :aria-expanded="isSidebarOpen" @click="openSidebar" class="fcb-action fcb-icon-action flex h-11 w-11 items-center justify-center rounded-lg lg:hidden">
|
||||
<MenuIcon class="w-6 h-6" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -111,7 +111,7 @@
|
||||
<!-- Content -->
|
||||
<main
|
||||
class="min-h-0 flex-1 overflow-y-auto transition-colors duration-300 custom-scrollbar"
|
||||
:class="[isDarkMode ? 'bg-[#10191e]' : 'bg-[#dfe9eb]']"
|
||||
:class="[isDarkMode ? 'bg-[#252b34]' : 'bg-[#dfe9eb]']"
|
||||
>
|
||||
<router-view />
|
||||
</main>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import api from './client'
|
||||
import type { ApiResponse, TrashListParams, TrashListResponse } from '@/types'
|
||||
import type { ApiResponse, TrashListParams, TrashListResponse, TrashRetentionRequest, TrashBatchRequest, TrashBatchResult } from '@/types'
|
||||
|
||||
export class TrashService {
|
||||
static async list(params: TrashListParams): Promise<ApiResponse<TrashListResponse>> {
|
||||
@@ -14,7 +14,10 @@ export class TrashService {
|
||||
return api.delete('/admin/trash/purge', { data: { id } })
|
||||
}
|
||||
|
||||
static async updateRetention(id: number, retentionDays: number): Promise<ApiResponse> {
|
||||
return api.post('/admin/trash/retention', { id, retentionDays })
|
||||
static async updateRetention(id: number, retention: TrashRetentionRequest): Promise<ApiResponse> {
|
||||
return api.post('/admin/trash/retention', { id, ...retention })
|
||||
}
|
||||
static async batch(request: TrashBatchRequest): Promise<ApiResponse<TrashBatchResult>> {
|
||||
return api.post('/admin/trash/batch', request)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
{
|
||||
"colors": {
|
||||
"blue": {
|
||||
"50": "#f5f8fa",
|
||||
"100": "#e7eff3",
|
||||
"200": "#d0dee7",
|
||||
"300": "#b3c9d6",
|
||||
"400": "#8facbc",
|
||||
"500": "#5b798b",
|
||||
"600": "#49616e",
|
||||
"700": "#3c4e58",
|
||||
"800": "#303d45",
|
||||
"900": "#263036",
|
||||
"950": "#1a2023"
|
||||
},
|
||||
"indigo": {
|
||||
"50": "#f5f8fa",
|
||||
"100": "#e7eff3",
|
||||
"200": "#d0dee7",
|
||||
"300": "#b3c9d6",
|
||||
"400": "#8facbc",
|
||||
"500": "#5b798b",
|
||||
"600": "#49616e",
|
||||
"700": "#3c4e58",
|
||||
"800": "#303d45",
|
||||
"900": "#263036",
|
||||
"950": "#1a2023"
|
||||
},
|
||||
"sky": {
|
||||
"50": "#f5f8fa",
|
||||
"100": "#e7eff3",
|
||||
"200": "#d0dee7",
|
||||
"300": "#b3c9d6",
|
||||
"400": "#8facbc",
|
||||
"500": "#5b798b",
|
||||
"600": "#49616e",
|
||||
"700": "#3c4e58",
|
||||
"800": "#303d45",
|
||||
"900": "#263036",
|
||||
"950": "#1a2023"
|
||||
},
|
||||
"cyan": {
|
||||
"50": "#f5f8fa",
|
||||
"100": "#e7eff3",
|
||||
"200": "#d0dee7",
|
||||
"300": "#b3c9d6",
|
||||
"400": "#8facbc",
|
||||
"500": "#5b798b",
|
||||
"600": "#49616e",
|
||||
"700": "#3c4e58",
|
||||
"800": "#303d45",
|
||||
"900": "#263036",
|
||||
"950": "#1a2023"
|
||||
},
|
||||
"green": {
|
||||
"50": "#f5faf8",
|
||||
"100": "#e7f3ee",
|
||||
"200": "#d0e7dc",
|
||||
"300": "#b3d6c6",
|
||||
"400": "#8fbca8",
|
||||
"500": "#5b8b75",
|
||||
"600": "#496e5e",
|
||||
"700": "#3c584b",
|
||||
"800": "#30453c",
|
||||
"900": "#26362f",
|
||||
"950": "#1a231f"
|
||||
},
|
||||
"emerald": {
|
||||
"50": "#f5faf8",
|
||||
"100": "#e7f3ee",
|
||||
"200": "#d0e7dc",
|
||||
"300": "#b3d6c6",
|
||||
"400": "#8fbca8",
|
||||
"500": "#5b8b75",
|
||||
"600": "#496e5e",
|
||||
"700": "#3c584b",
|
||||
"800": "#30453c",
|
||||
"900": "#26362f",
|
||||
"950": "#1a231f"
|
||||
},
|
||||
"teal": {
|
||||
"50": "#f5faf8",
|
||||
"100": "#e7f3ee",
|
||||
"200": "#d0e7dc",
|
||||
"300": "#b3d6c6",
|
||||
"400": "#8fbca8",
|
||||
"500": "#5b8b75",
|
||||
"600": "#496e5e",
|
||||
"700": "#3c584b",
|
||||
"800": "#30453c",
|
||||
"900": "#26362f",
|
||||
"950": "#1a231f"
|
||||
},
|
||||
"red": {
|
||||
"50": "#faf5f5",
|
||||
"100": "#f3e7e8",
|
||||
"200": "#e7d0d2",
|
||||
"300": "#d6b3b6",
|
||||
"400": "#bc8f94",
|
||||
"500": "#8b5b5f",
|
||||
"600": "#6e494d",
|
||||
"700": "#583c3f",
|
||||
"800": "#453032",
|
||||
"900": "#362628",
|
||||
"950": "#231a1b"
|
||||
},
|
||||
"rose": {
|
||||
"50": "#faf5f5",
|
||||
"100": "#f3e7e8",
|
||||
"200": "#e7d0d2",
|
||||
"300": "#d6b3b6",
|
||||
"400": "#bc8f94",
|
||||
"500": "#8b5b5f",
|
||||
"600": "#6e494d",
|
||||
"700": "#583c3f",
|
||||
"800": "#453032",
|
||||
"900": "#362628",
|
||||
"950": "#231a1b"
|
||||
},
|
||||
"purple": {
|
||||
"50": "#f7f5fa",
|
||||
"100": "#ede7f3",
|
||||
"200": "#dbd0e7",
|
||||
"300": "#c3b3d6",
|
||||
"400": "#a48fbc",
|
||||
"500": "#715b8b",
|
||||
"600": "#5b496e",
|
||||
"700": "#493c58",
|
||||
"800": "#3a3045",
|
||||
"900": "#2d2636",
|
||||
"950": "#1e1a23"
|
||||
},
|
||||
"violet": {
|
||||
"50": "#f7f5fa",
|
||||
"100": "#ede7f3",
|
||||
"200": "#dbd0e7",
|
||||
"300": "#c3b3d6",
|
||||
"400": "#a48fbc",
|
||||
"500": "#715b8b",
|
||||
"600": "#5b496e",
|
||||
"700": "#493c58",
|
||||
"800": "#3a3045",
|
||||
"900": "#2d2636",
|
||||
"950": "#1e1a23"
|
||||
},
|
||||
"fuchsia": {
|
||||
"50": "#f7f5fa",
|
||||
"100": "#ede7f3",
|
||||
"200": "#dbd0e7",
|
||||
"300": "#c3b3d6",
|
||||
"400": "#a48fbc",
|
||||
"500": "#715b8b",
|
||||
"600": "#5b496e",
|
||||
"700": "#493c58",
|
||||
"800": "#3a3045",
|
||||
"900": "#2d2636",
|
||||
"950": "#1e1a23"
|
||||
},
|
||||
"pink": {
|
||||
"50": "#faf5f7",
|
||||
"100": "#f3e7ec",
|
||||
"200": "#e7d0da",
|
||||
"300": "#d6b3c2",
|
||||
"400": "#bc8fa3",
|
||||
"500": "#8b5b70",
|
||||
"600": "#6e4959",
|
||||
"700": "#583c48",
|
||||
"800": "#453039",
|
||||
"900": "#36262d",
|
||||
"950": "#231a1e"
|
||||
},
|
||||
"amber": {
|
||||
"50": "#faf8f5",
|
||||
"100": "#f3efe7",
|
||||
"200": "#e7ded0",
|
||||
"300": "#d6c8b3",
|
||||
"400": "#bcab8f",
|
||||
"500": "#8b785b",
|
||||
"600": "#6e6049",
|
||||
"700": "#584d3c",
|
||||
"800": "#453d30",
|
||||
"900": "#363026",
|
||||
"950": "#23201a"
|
||||
},
|
||||
"yellow": {
|
||||
"50": "#faf8f5",
|
||||
"100": "#f3efe7",
|
||||
"200": "#e7ded0",
|
||||
"300": "#d6c8b3",
|
||||
"400": "#bcab8f",
|
||||
"500": "#8b785b",
|
||||
"600": "#6e6049",
|
||||
"700": "#584d3c",
|
||||
"800": "#453d30",
|
||||
"900": "#363026",
|
||||
"950": "#23201a"
|
||||
},
|
||||
"orange": {
|
||||
"50": "#faf8f5",
|
||||
"100": "#f3efe7",
|
||||
"200": "#e7ded0",
|
||||
"300": "#d6c8b3",
|
||||
"400": "#bcab8f",
|
||||
"500": "#8b785b",
|
||||
"600": "#6e6049",
|
||||
"700": "#584d3c",
|
||||
"800": "#453d30",
|
||||
"900": "#363026",
|
||||
"950": "#23201a"
|
||||
},
|
||||
"lime": {
|
||||
"50": "#f8faf5",
|
||||
"100": "#eef3e7",
|
||||
"200": "#dce7d0",
|
||||
"300": "#c6d6b3",
|
||||
"400": "#a7bc8f",
|
||||
"500": "#748b5b",
|
||||
"600": "#5d6e49",
|
||||
"700": "#4b583c",
|
||||
"800": "#3b4530",
|
||||
"900": "#2e3626",
|
||||
"950": "#1f231a"
|
||||
},
|
||||
"gray": {
|
||||
"50": "#f7fafb",
|
||||
"100": "#edf3f5",
|
||||
"200": "#dce6e9",
|
||||
"300": "#bfced4",
|
||||
"400": "#93a7b0",
|
||||
"500": "#6a818c",
|
||||
"600": "#536b76",
|
||||
"700": "#435365",
|
||||
"800": "#333d49",
|
||||
"900": "#252b34",
|
||||
"950": "#1c222c"
|
||||
},
|
||||
"slate": {
|
||||
"50": "#f7fafb",
|
||||
"100": "#edf3f5",
|
||||
"200": "#dce6e9",
|
||||
"300": "#bfced4",
|
||||
"400": "#93a7b0",
|
||||
"500": "#6a818c",
|
||||
"600": "#536b76",
|
||||
"700": "#435365",
|
||||
"800": "#333d49",
|
||||
"900": "#252b34",
|
||||
"950": "#1c222c"
|
||||
},
|
||||
"zinc": {
|
||||
"50": "#f7fafb",
|
||||
"100": "#edf3f5",
|
||||
"200": "#dce6e9",
|
||||
"300": "#bfced4",
|
||||
"400": "#93a7b0",
|
||||
"500": "#6a818c",
|
||||
"600": "#536b76",
|
||||
"700": "#435365",
|
||||
"800": "#333d49",
|
||||
"900": "#252b34",
|
||||
"950": "#1c222c"
|
||||
},
|
||||
"neutral": {
|
||||
"50": "#f7fafb",
|
||||
"100": "#edf3f5",
|
||||
"200": "#dce6e9",
|
||||
"300": "#bfced4",
|
||||
"400": "#93a7b0",
|
||||
"500": "#6a818c",
|
||||
"600": "#536b76",
|
||||
"700": "#435365",
|
||||
"800": "#333d49",
|
||||
"900": "#252b34",
|
||||
"950": "#1c222c"
|
||||
},
|
||||
"stone": {
|
||||
"50": "#f7fafb",
|
||||
"100": "#edf3f5",
|
||||
"200": "#dce6e9",
|
||||
"300": "#bfced4",
|
||||
"400": "#93a7b0",
|
||||
"500": "#6a818c",
|
||||
"600": "#536b76",
|
||||
"700": "#435365",
|
||||
"800": "#333d49",
|
||||
"900": "#252b34",
|
||||
"950": "#1c222c"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
"light": {
|
||||
"primary": {
|
||||
"bg": "#c8dfe9",
|
||||
"hover": "#b8d3e0",
|
||||
"text": "#304f60",
|
||||
"border": "#a8c7d6"
|
||||
},
|
||||
"secondary": {
|
||||
"bg": "#edf3f5",
|
||||
"hover": "#dde9ed",
|
||||
"text": "#3f5b66",
|
||||
"border": "#c1d3da"
|
||||
},
|
||||
"success": {
|
||||
"bg": "#d3e9de",
|
||||
"hover": "#c1dfd0",
|
||||
"text": "#305a49",
|
||||
"border": "#aacdbc"
|
||||
},
|
||||
"danger": {
|
||||
"bg": "#f1d9de",
|
||||
"hover": "#e9c5cd",
|
||||
"text": "#7a3544",
|
||||
"border": "#dcb4bf"
|
||||
},
|
||||
"outline": {
|
||||
"bg": "#f7fafb",
|
||||
"hover": "#e9e4f2",
|
||||
"text": "#5a4e70",
|
||||
"border": "#d0c7dd"
|
||||
}
|
||||
},
|
||||
"dark": {
|
||||
"primary": {
|
||||
"bg": "#304d5a",
|
||||
"hover": "#3b5c6b",
|
||||
"text": "#dfedf4",
|
||||
"border": "#577784"
|
||||
},
|
||||
"secondary": {
|
||||
"bg": "#303946",
|
||||
"hover": "#3a4655",
|
||||
"text": "#dfebee",
|
||||
"border": "#556477"
|
||||
},
|
||||
"success": {
|
||||
"bg": "#2e4b40",
|
||||
"hover": "#3b5c4e",
|
||||
"text": "#e1f1e9",
|
||||
"border": "#577e6d"
|
||||
},
|
||||
"danger": {
|
||||
"bg": "#51343e",
|
||||
"hover": "#65434e",
|
||||
"text": "#f7e3e8",
|
||||
"border": "#8a6170"
|
||||
},
|
||||
"outline": {
|
||||
"bg": "#393448",
|
||||
"hover": "#4b435d",
|
||||
"text": "#eae4f6",
|
||||
"border": "#726683"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,22 @@ export interface TrashListResponse {
|
||||
size: number
|
||||
total: number
|
||||
data: TrashFileItem[]
|
||||
summary?: { total: number; recoverable: number; purged: number }
|
||||
capabilities?: { filters: boolean; batch: boolean; customRetention: boolean }
|
||||
}
|
||||
|
||||
export interface TrashListParams {
|
||||
page: number
|
||||
size: number
|
||||
keyword?: string
|
||||
state?: 'all' | 'recoverable' | 'permanent' | 'scheduled' | 'purged'
|
||||
reason?: '' | 'manual' | 'batch_delete' | 'expired_time' | 'expired_count' | 'expired_both' | 'expired'
|
||||
}
|
||||
|
||||
export interface TrashRetentionRequest { retentionDays?: number; expiresAt?: string }
|
||||
export interface TrashBatchRequest extends TrashRetentionRequest { ids: number[]; action: 'restore' | 'purge' | 'retention' }
|
||||
export interface TrashBatchResult {
|
||||
requestedCount: number
|
||||
succeeded: { id: number; code?: string; trashExpiresAt?: string | null }[]
|
||||
failed: { id: number; reason: string }[]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export function fitValueFontSize(available: number, measured: number, maximum: number, minimum: number): number {
|
||||
if (available <= 0 || measured <= 0) return maximum
|
||||
return Math.max(minimum, Math.min(maximum, Math.floor(maximum * available / measured * 10) / 10))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { AnalyticsDailyRow } from '@/types'
|
||||
|
||||
export interface AnalyticsWindowTotals {
|
||||
downloads: number
|
||||
uploads: number
|
||||
downloadTraffic: number
|
||||
uploadTraffic: number
|
||||
}
|
||||
|
||||
export function summarizeAnalyticsWindow(
|
||||
rows: AnalyticsDailyRow[],
|
||||
offset: number,
|
||||
windowSize: number
|
||||
): AnalyticsWindowTotals {
|
||||
const start = Math.max(0, Math.floor(offset))
|
||||
const end = Math.min(rows.length, Math.ceil(offset + windowSize))
|
||||
return rows.slice(start, end).reduce(
|
||||
(totals, row) => {
|
||||
totals.downloads += Number(row.downloads || 0)
|
||||
totals.uploads += Number(row.uploads || 0)
|
||||
totals.downloadTraffic += Number(row.downloadTraffic || 0)
|
||||
totals.uploadTraffic += Number(row.uploadTraffic || 0)
|
||||
return totals
|
||||
},
|
||||
{ downloads: 0, uploads: 0, downloadTraffic: 0, uploadTraffic: 0 }
|
||||
)
|
||||
}
|
||||
@@ -19,9 +19,12 @@ export function formatTrashTime(value?: string | null, now?: number): string {
|
||||
}
|
||||
|
||||
export function getTrashPresentation(item: TrashFileItem, now: number) {
|
||||
const reason = item.trashReason === 'manual' ? '手动删除'
|
||||
: item.trashReason === 'expired' ? '已过期或次数用尽'
|
||||
: item.trashReason ? '其他原因' : '未记录'
|
||||
const reasons: Record<string, string> = {
|
||||
manual: '手动删除', batch_delete: '批量删除', expired_time: '保存到期',
|
||||
expired_count: '次数用尽', expired_both: '到期且次数用尽', expired: '历史自动回收'
|
||||
}
|
||||
const reason = item.trashReason ? reasons[item.trashReason] || '其他原因' : '未记录'
|
||||
|
||||
if (item.isTrashPurged) return {
|
||||
state: '已清理', tone: 'muted', reason, reminder: '',
|
||||
timeLabel: '清理时间', timeText: formatTrashTime(item.trashPurgedAt, now),
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { TrashFileItem, TrashRetentionRequest, TrashBatchResult } from '../types/trash'
|
||||
|
||||
export function selectableTrashIds(items: Pick<TrashFileItem, 'id' | 'isTrashPurged'>[]) {
|
||||
return [...new Set(items.filter(item => !item.isTrashPurged).map(item => item.id))]
|
||||
}
|
||||
export function buildTrashRetention(permanent: boolean, value: string, now: number): TrashRetentionRequest {
|
||||
if (permanent) return { retentionDays: 0 }
|
||||
const timestamp = new Date(value).getTime()
|
||||
if (!Number.isFinite(timestamp) || timestamp <= now || timestamp > now + 365 * 86400000) {
|
||||
throw new Error('请选择未来 365 天内的自动清理时间')
|
||||
}
|
||||
return { expiresAt: new Date(timestamp).toISOString() }
|
||||
}
|
||||
export function summarizeTrashBatch(result: Pick<TrashBatchResult, 'succeeded' | 'failed'>) {
|
||||
return result.failed.length ? `成功 ${result.succeeded.length} 项,失败 ${result.failed.length} 项` : `已完成 ${result.succeeded.length} 项`
|
||||
}
|
||||
@@ -4,14 +4,14 @@
|
||||
>
|
||||
<div class="w-full max-w-md relative z-10">
|
||||
<div
|
||||
class="rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300"
|
||||
class="fcb-surface rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700'
|
||||
: 'bg-white border-gray-200'
|
||||
]"
|
||||
>
|
||||
<div class="p-8">
|
||||
<div class="p-5 sm:p-8">
|
||||
<PageHeader :title="config.name" @title-click="toSend" />
|
||||
<RetrieveForm
|
||||
v-model="code"
|
||||
|
||||
+15
-18
@@ -4,16 +4,16 @@
|
||||
@paste.prevent="handlePaste"
|
||||
>
|
||||
<div
|
||||
class="rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300"
|
||||
class="fcb-surface rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700'
|
||||
: 'bg-[#f5f8f9] border-[#dce5e8] shadow-[12px_16px_34px_rgba(112,137,151,.16),-8px_-8px_20px_rgba(255,255,255,.8)]'
|
||||
]"
|
||||
>
|
||||
<div class="p-6 sm:p-8">
|
||||
<div class="p-5 sm:p-8">
|
||||
<PageHeader :title="config.name" @title-click="toRetrieve" />
|
||||
<form @submit.prevent="handleSubmit" class="space-y-8">
|
||||
<form @submit.prevent="handleSubmit" class="space-y-5 sm:space-y-8">
|
||||
<SendTypeSelector
|
||||
:selected-type="sendType"
|
||||
@update:selected-type="sendType = $event"
|
||||
@@ -49,12 +49,9 @@
|
||||
<button
|
||||
type="submit"
|
||||
:disabled="isSubmitting"
|
||||
class="w-full bg-[#7198a6] text-white font-bold shadow-[0_10px_20px_rgba(113,152,166,.24)] py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:shadow-lg relative overflow-hidden group disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none disabled:hover:scale-100"
|
||||
class="fcb-action fcb-button-primary w-full bg-[#7198a6] text-white font-bold shadow-[0_10px_20px_rgba(113,152,166,.24)] py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:shadow-lg relative overflow-hidden group disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none disabled:hover:scale-100"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"
|
||||
></span>
|
||||
<span class="relative z-10 flex items-center justify-center text-lg">
|
||||
<span class="relative z-10 flex items-center justify-center text-sm sm:text-lg">
|
||||
<svg
|
||||
v-if="isSubmitting"
|
||||
class="w-6 h-6 mr-2 animate-spin"
|
||||
@@ -82,7 +79,7 @@
|
||||
</button>
|
||||
</form>
|
||||
<div class="mt-6 text-center">
|
||||
<router-link to="/" class="inline-flex min-h-11 items-center rounded-lg px-2 text-sm text-[#3f6a77] transition duration-200 hover:bg-[#dcebed] hover:text-[#315c69] dark:text-[#b8d4dc] dark:hover:bg-[#294047] sm:px-3 sm:text-base">
|
||||
<router-link to="/" class="fcb-action inline-flex min-h-11 items-center rounded-lg px-2 text-sm text-[#3f6a77] transition duration-200 hover:bg-[#dcebed] hover:text-[#315c69] dark:text-[#b8d4dc] dark:hover:bg-[#333d49] sm:px-3 sm:text-base">
|
||||
{{ t('send.needRetrieveFile') }}
|
||||
</router-link>
|
||||
</div>
|
||||
@@ -102,7 +99,7 @@
|
||||
<button
|
||||
type="button"
|
||||
@click="toggleDrawer"
|
||||
class="flex min-h-11 items-center rounded-lg px-2 text-sm transition duration-200 hover:bg-indigo-50 dark:hover:bg-gray-700"
|
||||
class="fcb-action flex min-h-11 items-center rounded-lg px-2 text-sm transition duration-200 hover:bg-indigo-50 dark:hover:bg-gray-700"
|
||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
||||
>
|
||||
{{ t('send.sendRecords') }}
|
||||
@@ -220,20 +217,20 @@ select option {
|
||||
}
|
||||
|
||||
select option:checked {
|
||||
background: linear-gradient(to right, rgb(99 102 241 / 0.5), rgb(168 85 247 / 0.5)) !important;
|
||||
background: linear-gradient(to right, rgb(143 175 191 / 0.5), rgb(182 168 201 / 0.5)) !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.dark select option:checked {
|
||||
background: linear-gradient(to right, rgb(99 102 241 / 0.7), rgb(168 85 247 / 0.7)) !important;
|
||||
background: linear-gradient(to right, rgb(143 175 191 / 0.7), rgb(182 168 201 / 0.7)) !important;
|
||||
}
|
||||
|
||||
select option:hover {
|
||||
background-color: rgb(99 102 241 / 0.1);
|
||||
background-color: rgb(143 175 191 / 0.1);
|
||||
}
|
||||
|
||||
.dark select option:hover {
|
||||
background-color: rgb(99 102 241 / 0.2);
|
||||
background-color: rgb(143 175 191 / 0.2);
|
||||
}
|
||||
|
||||
/* 自定义滚动条样式 */
|
||||
@@ -254,14 +251,14 @@ select option:hover {
|
||||
}
|
||||
|
||||
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||||
background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
|
||||
background: linear-gradient(135deg, rgba(143, 175, 191, 0.6), rgba(182, 168, 201, 0.6));
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||
background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(168, 85, 247, 0.8));
|
||||
background: linear-gradient(135deg, rgba(143, 175, 191, 0.8), rgba(182, 168, 201, 0.8));
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
@@ -279,11 +276,11 @@ select option:hover {
|
||||
}
|
||||
|
||||
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
|
||||
background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(168, 85, 247, 0.7));
|
||||
background: linear-gradient(135deg, rgba(143, 175, 191, 0.7), rgba(182, 168, 201, 0.7));
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||
background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
|
||||
background: linear-gradient(135deg, rgba(143, 175, 191, 0.9), rgba(182, 168, 201, 0.9));
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="p-4 sm:p-6">
|
||||
<header class="mb-5 flex flex-col gap-3 sm:mb-6 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div>
|
||||
<p class="text-xs font-medium tracking-[0.16em]" :class="mutedTextClass">ADMIN AUDIT</p>
|
||||
<p class="hidden text-xs font-medium tracking-[0.16em] sm:block" :class="mutedTextClass">ADMIN AUDIT</p>
|
||||
<h2 class="mt-1 text-2xl font-bold" :class="primaryTextClass">操作记录</h2>
|
||||
<p class="mt-1 text-sm" :class="mutedTextClass">查看后台管理、回收站和配置变更的可追溯记录。</p>
|
||||
</div>
|
||||
@@ -12,12 +12,12 @@
|
||||
</BaseButton>
|
||||
</header>
|
||||
|
||||
<section class="theme-2026-card theme-2026-card-hover mb-5 rounded-[24px] border p-3 shadow-md sm:mb-6 sm:rounded-[30px] sm:p-4" :class="panelClass">
|
||||
<div class="grid gap-3 sm:grid-cols-2 xl:grid-cols-[minmax(0,1fr)_220px_220px_auto]">
|
||||
<label class="min-w-0">
|
||||
<span class="sr-only">搜索操作、对象或文件名</span>
|
||||
<section class="theme-2026-card mb-5 rounded-[24px] border p-3 shadow-md sm:mb-6 sm:rounded-[30px] sm:p-4" :class="panelClass">
|
||||
<div class="fcb-filter-grid grid grid-cols-2 gap-3 xl:grid-cols-[minmax(0,1fr)_180px_180px_auto]">
|
||||
<label class="col-span-2 min-w-0 xl:col-span-1">
|
||||
<span class="mb-1 block text-xs font-medium" :class="mutedTextClass">关键词</span>
|
||||
<span class="relative block">
|
||||
<SearchIcon class="absolute left-3 top-3 h-4 w-4" :class="mutedTextClass" />
|
||||
<SearchIcon class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2" :class="mutedTextClass" />
|
||||
<input v-model="filters.keyword" class="min-h-11 w-full rounded-xl border py-2.5 pl-10 pr-3 text-sm outline-none focus:ring-2 focus:ring-[#8fb2bf]" :class="fieldClass" placeholder="搜索操作、对象或文件名" @keyup.enter="applyFilters" />
|
||||
</span>
|
||||
</label>
|
||||
@@ -35,9 +35,9 @@
|
||||
<option v-for="option in targetTypeOptions" :key="option.value" :value="option.value">{{ targetTypeLabel(option.label) }} · {{ option.count }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="flex items-end gap-2">
|
||||
<BaseButton class="flex-1" :loading="isLoading" @click="applyFilters">筛选</BaseButton>
|
||||
<button type="button" class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border transition-colors" :class="actionClass" aria-label="重置筛选" title="重置筛选" @click="resetFilters">
|
||||
<div class="col-span-2 flex items-end justify-end gap-2 xl:col-span-1">
|
||||
<BaseButton class="min-w-20" :loading="isLoading" @click="applyFilters">筛选</BaseButton>
|
||||
<button type="button" class="fcb-action fcb-icon-action flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border transition-colors" :class="actionClass" aria-label="重置筛选" title="重置筛选" @click="resetFilters">
|
||||
<RotateCcwIcon class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -50,7 +50,7 @@
|
||||
<h3 class="text-base font-semibold" :class="primaryTextClass">审计事件</h3>
|
||||
<p class="mt-0.5 text-xs" :class="mutedTextClass">筛选结果 {{ total }} 条 · 已保存 {{ storedTotal }} 条</p>
|
||||
</div>
|
||||
<span class="inline-flex items-center rounded-full px-3 py-1 text-xs font-medium" :class="isDarkMode ? 'bg-[#263941] text-[#b8d6de]' : 'bg-[#e5f0f1] text-[#365a66]'">
|
||||
<span class="inline-flex items-center rounded-full px-3 py-1 text-xs font-medium" :class="isDarkMode ? 'bg-[#2c3440] text-[#b8d6de]' : 'bg-[#e5f0f1] text-[#365a66]'">
|
||||
<ShieldCheckIcon class="mr-1.5 h-3.5 w-3.5" /> 审计留痕
|
||||
</span>
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
v-for="activity in activities"
|
||||
:key="activity.id"
|
||||
class="fcb-interactive-row group grid gap-3 px-4 py-4 sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:items-start sm:px-6"
|
||||
:class="isDarkMode ? 'hover:bg-[#253941]/60' : 'hover:bg-[#f2f8f8]'"
|
||||
:class="isDarkMode ? 'hover:bg-[#2c3440]/60' : 'hover:bg-[#f2f8f8]'"
|
||||
>
|
||||
<div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl" :class="activityToneClass(activity.action)">
|
||||
<component :is="activityIcon(activity.action)" class="h-5 w-5" aria-hidden="true" />
|
||||
@@ -109,19 +109,20 @@ const filters = ref({ page: 1, size: 20, keyword: '', action: '', targetType: ''
|
||||
|
||||
const primaryTextClass = computed(() => isDarkMode.value ? 'text-white' : 'text-[#1f3c45]')
|
||||
const mutedTextClass = computed(() => isDarkMode.value ? 'text-[#a9bdc2]' : 'text-[#617980]')
|
||||
const panelClass = computed(() => isDarkMode.value ? 'border-[#40545c] bg-[#202f36]/90' : 'border-[#d7e3e5] bg-[#f8fbfb]')
|
||||
const fieldClass = computed(() => isDarkMode.value ? 'border-[#50666f] bg-[#253941] text-white placeholder:text-[#9fb2b7]' : 'border-[#c8d8dc] bg-white text-[#263f48] placeholder:text-[#84969a]')
|
||||
const dividerClass = computed(() => isDarkMode.value ? 'divide-[#40545c] border-[#40545c]' : 'divide-[#d7e3e5] border-[#d7e3e5]')
|
||||
const actionClass = computed(() => isDarkMode.value ? 'border-[#50666f] bg-[#263941] text-[#d8e3e5] hover:bg-[#2d4751]' : 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66] hover:bg-[#e2ecee]')
|
||||
const panelClass = computed(() => isDarkMode.value ? 'border-[#495765] bg-[#252b34]/90' : 'border-[#d7e3e5] bg-[#f8fbfb]')
|
||||
const fieldClass = computed(() => isDarkMode.value ? 'border-[#50666f] bg-[#2c3440] text-white placeholder:text-[#9fb2b7]' : 'border-[#c8d8dc] bg-white text-[#263f48] placeholder:text-[#84969a]')
|
||||
const dividerClass = computed(() => isDarkMode.value ? 'divide-[#495765] border-[#495765]' : 'divide-[#d7e3e5] border-[#d7e3e5]')
|
||||
const actionClass = computed(() => isDarkMode.value ? 'border-[#50666f] bg-[#2c3440] text-[#d8e3e5] hover:bg-[#384452]' : 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66] hover:bg-[#e2ecee]')
|
||||
const badgeClass = computed(() => isDarkMode.value ? 'border-[#50666f] text-[#b8d6de]' : 'border-[#c8d8dc] text-[#4e6c75]')
|
||||
|
||||
const actionLabel = (action: string) => ({
|
||||
'file.delete': '移入回收站', 'files.batch_delete': '批量移入回收站', 'trash.restore': '从回收站恢复', 'trash.purge': '永久清理文件本体', 'file.update': '更新文件信息', 'files.batch_update': '批量更新文件', 'file.metadata_update': '更新文件备注', 'file.policy_action': '调整文件策略', 'files.batch_policy_action': '批量调整策略', 'config.update': '更新系统设置', 'local_file.delete': '删除本地文件', 'local_file.share': '分享本地文件'
|
||||
'file.delete': '移入回收站', 'files.batch_delete': '批量移入回收站', 'trash.restore': '从回收站恢复', 'trash.purge': '彻底删除文件', 'trash.retention': '设置清理时间', 'trash.batch_restore': '批量恢复', 'trash.batch_purge': '批量彻底删除', 'trash.batch_retention': '批量设置清理时间', 'file.update': '更新文件信息', 'files.batch_update': '批量更新文件', 'file.metadata_update': '更新文件备注', 'file.policy_action': '调整文件策略', 'files.batch_policy_action': '批量调整策略', 'config.update': '更新系统设置', 'local_file.delete': '删除本地文件', 'local_file.share': '分享本地文件'
|
||||
}[action] || action)
|
||||
const targetTypeLabel = (targetType: string) => ({ file: '文件', config: '系统配置', local_file: '本地文件', view_preset: '视图预设', system: '系统' }[targetType] || targetType || '系统')
|
||||
const activityIcon = (action: string): Component => action.includes('trash') || action.includes('delete') ? Trash2Icon : action.includes('config') ? CogIcon : action.includes('update') || action.includes('policy') ? FilePenLineIcon : action.includes('share') ? UploadIcon : ActivityIcon
|
||||
const activityIcon = (action: string): Component => action.includes('restore') ? RotateCcwIcon : action.includes('trash') || action.includes('delete') ? Trash2Icon : action.includes('config') ? CogIcon : action.includes('update') || action.includes('policy') ? FilePenLineIcon : action.includes('share') ? UploadIcon : ActivityIcon
|
||||
const activityToneClass = (action: string) => {
|
||||
if (action === 'trash.purge') return isDarkMode.value ? 'bg-red-950/50 text-red-300' : 'bg-red-50 text-red-600'
|
||||
if (action.includes('restore')) return isDarkMode.value ? 'bg-emerald-950/45 text-emerald-300' : 'bg-emerald-50 text-emerald-700'
|
||||
if (action === 'trash.purge' || action === 'trash.batch_purge') return isDarkMode.value ? 'bg-red-950/50 text-red-300' : 'bg-red-50 text-red-600'
|
||||
if (action.includes('trash') || action.includes('delete')) return isDarkMode.value ? 'bg-amber-950/45 text-amber-300' : 'bg-amber-50 text-amber-700'
|
||||
if (action.includes('restore') || action.includes('share')) return isDarkMode.value ? 'bg-emerald-950/45 text-emerald-300' : 'bg-emerald-50 text-emerald-700'
|
||||
return isDarkMode.value ? 'bg-[#263f48] text-[#b8d6de]' : 'bg-[#e5f0f1] text-[#397084]'
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:loading="isDashboardRefreshing"
|
||||
:title="t('admin.dashboard.refresh')"
|
||||
:aria-label="t('admin.dashboard.refresh')"
|
||||
class="shrink-0 max-sm:h-11 max-sm:w-11 max-sm:!px-0"
|
||||
class="fcb-icon-action shrink-0 max-sm:h-11 max-sm:w-11 max-sm:!px-0"
|
||||
@click="refreshDashboardPage"
|
||||
>
|
||||
<template #icon>
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
<div v-if="dashboardData.hasExtendedStats" class="mt-6 grid grid-cols-1 gap-6 2xl:grid-cols-3">
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5 2xl:col-span-2"
|
||||
class="theme-2026-card rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5 2xl:col-span-2"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-4 flex items-center justify-between sm:mb-5">
|
||||
@@ -103,7 +103,7 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-2 sm:grid-cols-3 sm:gap-4">
|
||||
<div class="fcb-metric-grid grid grid-cols-3 gap-2 sm:gap-4">
|
||||
<MetricProgress
|
||||
:label="t('admin.dashboard.activeFileRatio')"
|
||||
:value="dashboardData.activeRatio"
|
||||
@@ -187,7 +187,7 @@
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
class="theme-2026-card rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-5">
|
||||
@@ -235,32 +235,28 @@
|
||||
|
||||
<div class="mt-6 grid grid-cols-1 gap-6 xl:grid-cols-2">
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
class="theme-2026-card rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-5 flex flex-col gap-4">
|
||||
<div class="flex min-w-0 flex-col gap-3 xl:flex-row xl:items-start xl:justify-between">
|
||||
<div class="min-w-0">
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">{{ t('admin.dashboard.trend.title') }}</h3>
|
||||
<p class="break-words text-sm leading-5" :class="[mutedTextClass]">
|
||||
{{ analyticsSummaryText }}
|
||||
</p>
|
||||
<p class="mt-1 text-xs leading-5" :class="mutedTextClass">{{ analyticsWindowText }}</p>
|
||||
<div class="mt-2 grid grid-cols-2 gap-3 text-xs sm:flex sm:flex-wrap" :class="mutedTextClass">
|
||||
<div><p>{{ t('admin.dashboard.trend.downloadTotal') }}</p><p class="mt-1 flex flex-wrap gap-x-2 gap-y-1 font-medium tabular-nums" :class="primaryTextClass"><span class="whitespace-nowrap">{{ t('admin.dashboard.trend.times', { count: analyticsWindowStats.downloads }) }}</span><span class="whitespace-nowrap">{{ analyticsDownloadTrafficText }}</span></p></div>
|
||||
<div><p>{{ t('admin.dashboard.trend.uploadTotal') }}</p><p class="mt-1 flex flex-wrap gap-x-2 gap-y-1 font-medium tabular-nums" :class="primaryTextClass"><span class="whitespace-nowrap">{{ t('admin.dashboard.trend.times', { count: analyticsWindowStats.uploads }) }}</span><span class="whitespace-nowrap">{{ analyticsUploadTrafficText }}</span></p></div>
|
||||
</div>
|
||||
<p class="mt-1 text-xs sm:hidden" :class="[mutedTextClass]">{{ t('admin.dashboard.trend.mobileHint') }}</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 flex-wrap items-center justify-end gap-2 xl:flex-nowrap">
|
||||
<div class="analytics-date-range flex min-w-0 items-center justify-center gap-1.5 sm:gap-2">
|
||||
<div class="analytics-date-range grid w-full min-w-0 grid-cols-2 gap-2 sm:w-auto">
|
||||
<NativeDateSelect
|
||||
v-model="analyticsStart"
|
||||
:field-class="fieldClass"
|
||||
:aria-label="t('admin.dashboard.trend.startDate')"
|
||||
@change="fetchAnalyticsData"
|
||||
/>
|
||||
<span
|
||||
class="shrink-0 text-sm font-semibold"
|
||||
:class="[isDarkMode ? 'text-[#aabdc2]' : 'text-[#789096]']"
|
||||
>
|
||||
-
|
||||
</span>
|
||||
<NativeDateSelect
|
||||
v-model="analyticsEnd"
|
||||
:field-class="fieldClass"
|
||||
@@ -313,11 +309,12 @@
|
||||
:rows="analyticsDailyRows"
|
||||
:is-dark-mode="isDarkMode"
|
||||
@window-change="analyticsWindowText = $event"
|
||||
@window-stats="analyticsWindowStats = $event"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
class="theme-2026-card rounded-[24px] p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-5"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-5 flex items-center justify-between">
|
||||
@@ -408,7 +405,7 @@
|
||||
class="rounded-[30px] border px-2.5 py-0.5 font-medium shadow-sm"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'border-[#40545c] bg-[#263941]/80 text-[#d8e3e5]'
|
||||
? 'border-[#495765] bg-[#2c3440]/80 text-[#d8e3e5]'
|
||||
: 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66]'
|
||||
]"
|
||||
>
|
||||
@@ -446,6 +443,7 @@ import { ROUTES } from '@/constants'
|
||||
import { useConfigStore } from '@/stores/configStore'
|
||||
import { formatFileSize } from '@/utils/common'
|
||||
import type { AnalyticsData, AnalyticsFileRow, DashboardHealthAction } from '@/types'
|
||||
import type { AnalyticsWindowTotals } from '@/utils/analyticsWindow'
|
||||
|
||||
const isDarkMode = useInjectedDarkMode()
|
||||
const { t } = useI18n()
|
||||
@@ -463,22 +461,22 @@ const mutedTextClass = computed(() => (isDarkMode.value ? 'text-gray-400' : 'tex
|
||||
const versionText = computed(() => appVersion.value || t('admin.dashboard.versionPending'))
|
||||
const panelClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'bg-[#202f36]/90 border border-[#40545c]'
|
||||
? 'bg-[#252b34]/90 border border-[#495765]'
|
||||
: 'bg-[#f8fbfb] border border-[#d7e3e5]'
|
||||
)
|
||||
const fieldClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#50666f] bg-[#253941] text-white'
|
||||
? 'border-[#50666f] bg-[#2c3440] text-white'
|
||||
: 'border-[#c8d8dc] bg-[#fbfdfd] text-[#263f48]'
|
||||
)
|
||||
const subtlePanelClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#3d5159] bg-[#17252c]/50'
|
||||
? 'border-[#3d5159] bg-[#252b34]/50'
|
||||
: 'border-[#d4e0e3] bg-[linear-gradient(135deg,#f7faf9,#eaf3f4)]'
|
||||
)
|
||||
const cardHoverClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'hover:border-[#7199a8] hover:bg-[#263941] hover:shadow-black/25'
|
||||
? 'hover:border-[#7199a8] hover:bg-[#2c3440] hover:shadow-[#97aac8]/15'
|
||||
: 'hover:border-[#8fb2bf] hover:shadow-[#a9bdc2]/70'
|
||||
)
|
||||
const maxSaveTimeText = computed(() => {
|
||||
@@ -503,22 +501,19 @@ const analyticsData = ref<AnalyticsData | null>(null)
|
||||
const analyticsError = ref('')
|
||||
const isAnalyticsLoading = ref(false)
|
||||
const analyticsWindowText = ref(t('admin.dashboard.trend.noData'))
|
||||
const analyticsWindowStats = ref<AnalyticsWindowTotals>({
|
||||
downloads: 0,
|
||||
uploads: 0,
|
||||
downloadTraffic: 0,
|
||||
uploadTraffic: 0
|
||||
})
|
||||
const analyticsDailyRows = computed(() => analyticsData.value?.daily || [])
|
||||
const analyticsTopFiles = computed<AnalyticsFileRow[]>(() => analyticsData.value?.topFiles || [])
|
||||
const analyticsUploadTrafficText = computed(() =>
|
||||
formatBytes(analyticsData.value?.totals?.uploadTraffic || 0)
|
||||
formatBytes(analyticsWindowStats.value.uploadTraffic)
|
||||
)
|
||||
const analyticsDownloadTrafficText = computed(() =>
|
||||
formatBytes(analyticsData.value?.totals?.downloadTraffic || 0)
|
||||
)
|
||||
const analyticsSummaryText = computed(() =>
|
||||
t('admin.dashboard.trend.summary', {
|
||||
window: analyticsWindowText.value,
|
||||
downloads: analyticsData.value?.totals?.totalDownloads || 0,
|
||||
downloadTraffic: analyticsDownloadTrafficText.value,
|
||||
uploads: analyticsData.value?.totals?.totalUploads || 0,
|
||||
uploadTraffic: analyticsUploadTrafficText.value
|
||||
})
|
||||
formatBytes(analyticsWindowStats.value.downloadTraffic)
|
||||
)
|
||||
const formatBytes = (value: number | string | undefined) => formatFileSize(Number(value || 0), 1)
|
||||
|
||||
@@ -595,7 +590,7 @@ const getHealthActionClass = (tone: DashboardHealthAction['tone']) => {
|
||||
danger: 'border-[#7c5f64]/40 bg-[#5f383f]/24 text-[#f0d8dc] hover:border-[#b1878f]',
|
||||
warning: 'border-[#8b7a57]/40 bg-[#665733]/24 text-[#efe3c6] hover:border-[#b8a775]',
|
||||
success: 'border-[#58766d]/40 bg-[#31564f]/24 text-[#d2e7df] hover:border-[#7fa69a]',
|
||||
neutral: 'border-[#40545c] bg-[#17252c]/50 text-[#d8e3e5] hover:border-[#7199a8]'
|
||||
neutral: 'border-[#495765] bg-[#252b34]/50 text-[#d8e3e5] hover:border-[#7199a8]'
|
||||
}
|
||||
const lightClasses: Record<DashboardHealthAction['tone'], string> = {
|
||||
danger: 'border-[#ead8dc] bg-[#f7ecee] text-[#8b5962] hover:border-[#d8b8bf]',
|
||||
@@ -640,7 +635,7 @@ const MetricProgress = defineComponent({
|
||||
'div',
|
||||
{
|
||||
class:
|
||||
'theme-2026-card-hover rounded-[18px] border border-[#d4e0e3] bg-[#f6faf9] p-2.5 shadow-sm transition-all duration-200 hover:border-[#8fb2bf] hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md dark:border-[#40545c] dark:bg-[#17252c]/50 dark:hover:border-[#7199a8] dark:hover:bg-[#263941] dark:hover:shadow-black/25'
|
||||
'fcb-metric-card theme-2026-card-hover rounded-[18px] border border-[#d4e0e3] bg-[#f6faf9] p-2.5 shadow-sm transition-all duration-200 hover:border-[#8fb2bf] hover:shadow-md sm:rounded-[30px] sm:p-4 sm:shadow-md dark:border-[#495765] dark:bg-[#252b34]/50 dark:hover:border-[#7199a8] dark:hover:bg-[#2c3440] dark:hover:shadow-[#97aac8]/15'
|
||||
},
|
||||
[
|
||||
h('div', { class: 'mb-2 flex items-center justify-between gap-3 text-sm' }, [
|
||||
|
||||
@@ -21,15 +21,13 @@
|
||||
class="theme-2026-card theme-2026-card-hover group rounded-[24px] border p-3.5 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-4"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<p class="text-xs sm:text-sm" :class="[mutedTextClass]">{{ card.label }}</p>
|
||||
<p class="mt-1.5 break-words text-xl font-semibold leading-tight tabular-nums sm:mt-2 sm:text-2xl" :title="String(card.value)" :class="[primaryTextClass]">
|
||||
{{ card.value }}
|
||||
</p>
|
||||
<div class="relative">
|
||||
<div class="min-w-0">
|
||||
<p class="pr-8 text-xs sm:text-sm" :class="[mutedTextClass]">{{ card.label }}</p>
|
||||
<AdaptiveValue :value="card.value" class="mt-3 font-semibold leading-tight sm:mt-3" :class="primaryTextClass" />
|
||||
</div>
|
||||
<div
|
||||
class="rounded-lg p-2 transition-transform duration-200 group-max-sm:p-1.5"
|
||||
class="absolute right-0 top-0 rounded-lg p-1.5 transition-transform duration-200"
|
||||
:class="[card.iconClass]"
|
||||
>
|
||||
<component :is="card.icon" class="h-5 w-5" />
|
||||
@@ -40,7 +38,7 @@
|
||||
|
||||
<section
|
||||
v-if="!hasSelectedFiles"
|
||||
class="theme-2026-card theme-2026-card-hover mb-4 rounded-[24px] border p-3 shadow-md transition-all duration-200 hover:shadow-lg sm:mb-6 sm:rounded-[30px] sm:p-4"
|
||||
class="theme-2026-card mb-4 rounded-[24px] border p-3 shadow-md transition-all duration-200 hover:shadow-lg sm:mb-6 sm:rounded-[30px] sm:p-4"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-3 sm:flex-row">
|
||||
@@ -272,7 +270,7 @@
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border"
|
||||
class="fcb-action fcb-icon-action flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border"
|
||||
:class="detailActionClass"
|
||||
:disabled="isLoading"
|
||||
:aria-label="t('fileManage.refresh')"
|
||||
@@ -285,7 +283,7 @@
|
||||
<div
|
||||
v-if="tableData.length > 0"
|
||||
class="flex min-h-14 items-center justify-between gap-3 border-b px-4 py-2 md:hidden"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-[#20323a]/70' : 'border-[#d9e4e6] bg-[#f4f8f8]']"
|
||||
:class="[isDarkMode ? 'border-gray-700 bg-[#2c3440]/70' : 'border-[#d9e4e6] bg-[#f4f8f8]']"
|
||||
>
|
||||
<label class="flex min-h-11 min-w-0 cursor-pointer items-center gap-3 text-sm font-medium" :class="[primaryTextClass]">
|
||||
<span class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl">
|
||||
@@ -305,7 +303,7 @@
|
||||
<button
|
||||
v-if="hasSelectedFiles"
|
||||
type="button"
|
||||
class="min-h-11 shrink-0 rounded-xl px-3 text-sm font-medium"
|
||||
class="fcb-action min-h-11 shrink-0 rounded-xl px-3 text-sm font-medium"
|
||||
:class="detailActionClass"
|
||||
:disabled="isBatchActionRunning"
|
||||
@click="clearSelection"
|
||||
@@ -333,7 +331,7 @@
|
||||
v-for="file in tableData"
|
||||
:key="file.id"
|
||||
class="px-4 py-4"
|
||||
:class="selectedFileIds.has(file.id) ? (isDarkMode ? 'bg-[#294047]/50' : 'bg-[#e5eeee]') : ''"
|
||||
:class="selectedFileIds.has(file.id) ? (isDarkMode ? 'bg-[#333d49]/50' : 'bg-[#e5eeee]') : ''"
|
||||
>
|
||||
<div class="flex items-start gap-3">
|
||||
<label class="flex h-11 w-11 shrink-0 cursor-pointer items-start justify-center pt-1">
|
||||
@@ -346,7 +344,7 @@
|
||||
@change="toggleFileSelection(file.id)"
|
||||
/>
|
||||
</label>
|
||||
<button type="button" class="min-w-0 flex-1 text-left" @click="openFileDetail(file)">
|
||||
<button type="button" class="fcb-action fcb-content-action min-w-0 flex-1 text-left" @click="openFileDetail(file)">
|
||||
<p class="line-clamp-2 break-all text-sm font-semibold leading-5" :class="[primaryTextClass]">
|
||||
{{ file.displayName }}
|
||||
</p>
|
||||
@@ -388,7 +386,7 @@
|
||||
<aside
|
||||
v-if="hasSelectedFiles"
|
||||
class="pointer-events-auto fixed inset-x-0 bottom-0 z-[60] border-t px-3 pt-3 shadow-2xl backdrop-blur-xl md:hidden"
|
||||
:class="isDarkMode ? 'border-[#40545c] bg-[#17252b]/95' : 'border-[#c8d7da] bg-[#f2f6f5]/95'"
|
||||
:class="isDarkMode ? 'border-[#495765] bg-[#252b34]/95' : 'border-[#c8d7da] bg-[#f2f6f5]/95'"
|
||||
:style="{ paddingBottom: 'max(0.75rem, env(safe-area-inset-bottom))', touchAction: 'manipulation' }"
|
||||
:aria-label="t('fileManage.mobileBatchActions')"
|
||||
>
|
||||
@@ -396,13 +394,13 @@
|
||||
<div
|
||||
v-if="showMobilePolicyActions"
|
||||
class="grid grid-cols-2 gap-2 rounded-2xl border p-2"
|
||||
:class="isDarkMode ? 'border-[#40545c] bg-[#20323a]' : 'border-[#c8d7da] bg-white'"
|
||||
:class="isDarkMode ? 'border-[#495765] bg-[#2c3440]' : 'border-[#c8d7da] bg-white'"
|
||||
>
|
||||
<button
|
||||
v-for="option in batchPolicyActionOptions"
|
||||
:key="option.action"
|
||||
type="button"
|
||||
class="min-h-11 rounded-xl border px-2 py-2 text-xs font-medium"
|
||||
class="fcb-action min-h-11 rounded-xl border px-2 py-2 text-xs font-medium"
|
||||
:class="detailActionClass"
|
||||
:title="option.description"
|
||||
:disabled="option.disabled || isBatchDeleting || isBatchUpdating || isBatchPolicyActionRunning"
|
||||
@@ -418,7 +416,7 @@
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 rounded-xl px-3 text-sm font-medium"
|
||||
class="fcb-action min-h-11 rounded-xl px-3 text-sm font-medium"
|
||||
:class="detailActionClass"
|
||||
:disabled="isBatchActionRunning"
|
||||
@click="clearSelection"
|
||||
@@ -430,7 +428,7 @@
|
||||
<div class="grid grid-cols-3 gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-12 items-center justify-center rounded-xl border px-2 text-sm font-medium"
|
||||
class="fcb-action flex min-h-12 items-center justify-center rounded-xl border px-2 text-sm font-medium"
|
||||
:class="detailActionClass"
|
||||
:disabled="isBatchDeleting || isBatchPolicyActionRunning"
|
||||
@click="openBatchEditModal"
|
||||
@@ -440,7 +438,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-12 items-center justify-center rounded-xl border px-2 text-sm font-medium"
|
||||
class="fcb-action flex min-h-12 items-center justify-center rounded-xl border px-2 text-sm font-medium"
|
||||
:class="detailActionClass"
|
||||
:aria-expanded="showMobilePolicyActions"
|
||||
:disabled="isBatchDeleting || isBatchUpdating"
|
||||
@@ -451,7 +449,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-12 items-center justify-center rounded-xl bg-red-600 px-2 text-sm font-medium text-white shadow-sm disabled:opacity-50"
|
||||
class="fcb-action flex min-h-12 items-center justify-center rounded-xl bg-red-600 px-2 text-sm font-medium text-white shadow-sm disabled:opacity-50"
|
||||
:disabled="isBatchUpdating || isBatchPolicyActionRunning || isBatchDeleting"
|
||||
@click="deleteSelectedFilesAndRefreshHistory"
|
||||
>
|
||||
@@ -701,10 +699,10 @@
|
||||
<button
|
||||
type="button"
|
||||
:title="t('fileManage.detail')"
|
||||
class="inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
class="fcb-action inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-[#294047]/70 text-[#b8d4dc] hover:bg-[#34515a]'
|
||||
? 'bg-[#333d49]/70 text-[#b8d4dc] hover:bg-[#34515a]'
|
||||
: 'bg-[#dcebed] text-[#3f6a77] hover:bg-[#cfe1e4]'
|
||||
]"
|
||||
@click="openFileDetail(file)"
|
||||
@@ -716,10 +714,10 @@
|
||||
v-if="file.canPreviewText"
|
||||
type="button"
|
||||
:title="t('fileManage.viewText')"
|
||||
class="inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
class="fcb-action inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-[#263941] text-[#d8e3e5] hover:bg-[#2d4751]'
|
||||
? 'bg-[#2c3440] text-[#d8e3e5] hover:bg-[#384452]'
|
||||
: 'bg-[#edf4f5] text-[#506972] hover:bg-[#e2ecee]'
|
||||
]"
|
||||
@click="openTextPreview(file)"
|
||||
@@ -733,7 +731,7 @@
|
||||
file.isTextFile ? t('fileManage.exportText') : t('fileManage.downloadFile')
|
||||
"
|
||||
:disabled="Boolean(downloadingFileId)"
|
||||
class="inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-sm"
|
||||
class="fcb-action inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-sm"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-[#31564f]/70 text-[#c4dfd5] hover:bg-[#3c675e]'
|
||||
@@ -750,7 +748,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
class="fcb-action inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-[#2d4851]/70 text-[#bfd9df] hover:bg-[#365862]'
|
||||
@@ -763,11 +761,9 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
class="fcb-action inline-flex items-center rounded-[30px] px-3 py-1.5 shadow-sm transition-all duration-200 hover:shadow-md"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-[#dc2626] text-white shadow-[#7f1d1d]/35 hover:bg-[#b91c1c]'
|
||||
: 'bg-[#dc2626] text-white shadow-[#f87171]/35 hover:bg-[#b91c1c]'
|
||||
'fcb-button-danger'
|
||||
]"
|
||||
@click="deleteFileAndRefreshHistory(file.id)"
|
||||
>
|
||||
@@ -793,7 +789,7 @@
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="theme-2026-card theme-2026-card-hover mt-6 rounded-[30px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg"
|
||||
class="theme-2026-card mt-6 rounded-[30px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg"
|
||||
:class="[panelClass, cardHoverClass]"
|
||||
>
|
||||
<div class="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
@@ -801,7 +797,7 @@
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">历史文件</h3>
|
||||
<p class="text-sm" :class="[mutedTextClass]">包含已删除、已过期和现存文件的下载统计</p>
|
||||
</div>
|
||||
<BaseButton class="fcb-refresh-button fcb-secondary-card" variant="secondary" :loading="isHistoryLoading" @click="loadHistoryFiles">
|
||||
<BaseButton class="fcb-refresh-button" variant="secondary" :loading="isHistoryLoading" @click="loadHistoryFiles">
|
||||
<template #icon>
|
||||
<RefreshCwIcon class="mr-2 h-4 w-4" />
|
||||
</template>
|
||||
@@ -1045,7 +1041,7 @@
|
||||
<div class="grid grid-cols-2 gap-2.5 xl:grid-cols-4">
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-60"
|
||||
class="fcb-action flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-60"
|
||||
:class="detailActionClass"
|
||||
@click="openDetailEditModal"
|
||||
>
|
||||
@@ -1055,7 +1051,7 @@
|
||||
<button
|
||||
v-if="selectedFileDetail.canPreviewText"
|
||||
type="button"
|
||||
class="flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors"
|
||||
class="fcb-action flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors"
|
||||
:class="detailActionClass"
|
||||
@click="openDetailTextPreview"
|
||||
>
|
||||
@@ -1064,7 +1060,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-60"
|
||||
class="fcb-action flex min-h-11 items-center justify-center rounded-lg border px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-60"
|
||||
:class="detailActionClass"
|
||||
:disabled="!selectedFileDetail.canDownloadFile || Boolean(downloadingFileId)"
|
||||
@click="downloadFile(selectedFileDetail)"
|
||||
@@ -1082,7 +1078,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex min-h-11 items-center justify-center rounded-lg bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-red-700"
|
||||
class="fcb-action flex min-h-11 items-center justify-center rounded-lg bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-red-700"
|
||||
@click="deleteDetailFileAndRefreshHistory"
|
||||
>
|
||||
<TrashIcon class="mr-2 h-4 w-4" aria-hidden="true" />
|
||||
@@ -1091,7 +1087,7 @@
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="theme-2026-card-hover rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
class="theme-2026-card rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
:class="getInsightPanelClass(selectedFileDetail.statusInsightSeverity)"
|
||||
>
|
||||
<div class="flex flex-col gap-2.5 md:flex-row md:items-start md:justify-between">
|
||||
@@ -1206,7 +1202,7 @@
|
||||
<button
|
||||
v-if="detailTimelineRows.length > 3"
|
||||
type="button"
|
||||
class="inline-flex min-h-10 items-center self-start rounded-[30px] border px-3 py-2 text-sm font-medium transition-colors sm:min-h-0 sm:self-auto"
|
||||
class="fcb-action inline-flex min-h-10 items-center self-start rounded-[30px] border px-3 py-2 text-sm font-medium transition-colors sm:min-h-0 sm:self-auto"
|
||||
:class="detailActionClass"
|
||||
@click="isLifecycleExpanded = !isLifecycleExpanded"
|
||||
>
|
||||
@@ -1265,7 +1261,7 @@
|
||||
<div v-if="item.key === 'retrieved' && retrievalTimelineCount > 0" class="mt-2.5 border-t pt-2.5" :class="isDarkMode ? 'border-gray-700' : 'border-gray-200'">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex min-h-9 items-center rounded-[30px] border px-3 py-1.5 text-sm font-medium transition-colors"
|
||||
class="fcb-action inline-flex min-h-9 items-center rounded-[30px] border px-3 py-1.5 text-sm font-medium transition-colors"
|
||||
:class="detailActionClass"
|
||||
@click="isRetrievalHistoryExpanded = !isRetrievalHistoryExpanded"
|
||||
>
|
||||
@@ -1310,7 +1306,7 @@
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="theme-2026-card-hover space-y-2.5 rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
class="theme-2026-card space-y-2.5 rounded-[24px] border px-3 py-3 shadow-md transition-all duration-200 hover:shadow-lg sm:px-4 sm:py-4"
|
||||
:class="[subtleSectionClass, cardHoverClass]"
|
||||
>
|
||||
<div class="flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between">
|
||||
@@ -1531,7 +1527,7 @@
|
||||
v-for="option in batchEditModeOptions"
|
||||
:key="option.value"
|
||||
type="button"
|
||||
class="flex min-h-12 items-center justify-center rounded-[30px] border px-3 py-2 text-sm font-medium transition-colors"
|
||||
class="fcb-action flex min-h-12 items-center justify-center rounded-[30px] border px-3 py-2 text-sm font-medium transition-colors"
|
||||
:class="getBatchEditModeClass(option.value)"
|
||||
:disabled="isBatchUpdating"
|
||||
@click="batchEditForm.mode = option.value"
|
||||
@@ -1751,6 +1747,7 @@ import FileEditField from '@/components/common/FileEditField.vue'
|
||||
import NativeDateSelect from '@/components/common/NativeDateSelect.vue'
|
||||
import BaseModal from '@/components/common/BaseModal.vue'
|
||||
import BaseButton from '@/components/common/BaseButton.vue'
|
||||
import AdaptiveValue from '@/components/common/AdaptiveValue.vue'
|
||||
import { useAdminFiles, useInjectedDarkMode, useTransferAnalytics } from '@/composables'
|
||||
import { formatFileSize, formatTimestamp } from '@/utils/common'
|
||||
import { createDetailMotion } from '@/utils/detailMotion'
|
||||
@@ -2071,31 +2068,31 @@ const primaryTextClass = computed(() => (isDarkMode.value ? 'text-white' : 'text
|
||||
const mutedTextClass = computed(() => (isDarkMode.value ? 'text-gray-400' : 'text-gray-500'))
|
||||
const panelClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#40545c] bg-[#202f36]/90'
|
||||
? 'border-[#495765] bg-[#252b34]/90'
|
||||
: 'border-[#d7e3e5] bg-[#f8fbfb]'
|
||||
)
|
||||
const fieldClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#50666f] bg-[#253941] text-white'
|
||||
? 'border-[#50666f] bg-[#2c3440] text-white'
|
||||
: 'border-[#c8d8dc] bg-[#fbfdfd] text-[#263f48]'
|
||||
)
|
||||
const detailActionClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#3f535c] bg-[#263941]/70 text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#2d4751]'
|
||||
? 'border-[#3f535c] bg-[#2c3440]/70 text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#384452]'
|
||||
: 'border-[#c9d9dd] bg-[#fbfdfd] text-[#36515b] hover:border-[#8fb2bf] hover:bg-[#edf5f6]'
|
||||
)
|
||||
const cardHoverClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'hover:border-[#7199a8] hover:bg-[#263941] hover:shadow-black/25'
|
||||
? 'hover:border-[#7199a8] hover:bg-[#2c3440] hover:shadow-[#97aac8]/15'
|
||||
: 'hover:border-[#8fb2bf] hover:shadow-[#a9bdc2]/70'
|
||||
)
|
||||
const detailPolicyActionClass = computed(() =>
|
||||
isDarkMode.value
|
||||
? 'border-[#40545c] bg-[#203039]/80 text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#263941]'
|
||||
? 'border-[#495765] bg-[#2c3440]/80 text-[#d8e3e5] hover:border-[#7199a8] hover:bg-[#2c3440]'
|
||||
: 'border-[#c9d9dd] bg-[#fbfdfd] text-[#36515b] hover:border-[#8fb2bf] hover:bg-[#edf5f6]'
|
||||
)
|
||||
const subtleSectionClass = computed(() =>
|
||||
isDarkMode.value ? 'border-[#40545c] bg-[#17252c]/50' : 'border-[#d7e3e5] bg-[#f3f8f8]'
|
||||
isDarkMode.value ? 'border-[#495765] bg-[#252b34]/50' : 'border-[#d7e3e5] bg-[#f3f8f8]'
|
||||
)
|
||||
|
||||
type DetailInfoItem = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div
|
||||
:class="[
|
||||
'min-h-[100dvh] flex items-center justify-center px-4 pb-6 pt-24 sm:px-6 sm:py-12 lg:px-8 transition-colors duration-200 relative overflow-x-hidden overflow-y-auto',
|
||||
isDarkMode ? 'bg-[#10191e]' : 'bg-[#dfe9eb]'
|
||||
isDarkMode ? 'bg-[#252b34]' : 'bg-[#dfe9eb]'
|
||||
]"
|
||||
>
|
||||
<div class="absolute inset-0 z-0">
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div
|
||||
class="max-w-md w-full space-y-8 backdrop-blur-lg p-8 rounded-[30px] border shadow-xl"
|
||||
:class="[isDarkMode ? 'bg-[#1a2930]/82 border-[#31454d]' : 'bg-[#f2f6f5]/82 border-[#c8d7da]']"
|
||||
:class="[isDarkMode ? 'bg-[#2c3440]/82 border-[#495765]' : 'bg-[#f2f6f5]/82 border-[#c8d7da]']"
|
||||
>
|
||||
<div>
|
||||
<div class="mx-auto h-16 w-16 relative">
|
||||
@@ -24,7 +24,7 @@
|
||||
<div
|
||||
:class="[
|
||||
'absolute inset-1 rounded-full flex items-center justify-center',
|
||||
isDarkMode ? 'bg-[#1a2930]' : 'bg-[#f2f6f5]'
|
||||
isDarkMode ? 'bg-[#2c3440]' : 'bg-[#f2f6f5]'
|
||||
]"
|
||||
>
|
||||
<BoxIcon :class="['h-8 w-8', isDarkMode ? 'text-[#a5c8d0]' : 'text-[#5f8796]']" />
|
||||
@@ -68,29 +68,30 @@
|
||||
:class="[
|
||||
'appearance-none rounded-[30px] relative block w-full py-3 pl-4 pr-14 border transition-all duration-200 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-[#8fb2bf] focus:border-[#8fb2bf] focus:z-10 sm:text-sm backdrop-blur-sm',
|
||||
isDarkMode
|
||||
? 'bg-[#263941]/60 border-[#40545c] text-white placeholder-gray-400 hover:border-[#7199a8]'
|
||||
? 'bg-[#2c3440]/60 border-[#495765] text-white placeholder-gray-400 hover:border-[#7199a8]'
|
||||
: 'bg-[#edf4f5]/70 border-[#c8d8dc] text-[#2d4650] hover:border-[#9db6bd]'
|
||||
]"
|
||||
:placeholder="t('manage.login.passwordPlaceholder')"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="absolute inset-y-0 right-1 z-20 flex w-11 items-center justify-center rounded-full"
|
||||
class="fcb-action fcb-input-action absolute inset-y-0 right-1 z-20 flex w-11 items-center justify-center rounded-full"
|
||||
:aria-label="showPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
:title="showPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
:aria-pressed="showPassword"
|
||||
@click="showPassword = !showPassword"
|
||||
>
|
||||
<EyeOffIcon v-if="showPassword" class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeIcon v-else class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeIcon v-if="showPassword" class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeOffIcon v-else class="h-5 w-5" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
<button class="fcb-action"
|
||||
type="submit"
|
||||
:class="[
|
||||
'group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-[30px] text-white transition-all duration-300 transform focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#8fb2bf] shadow-lg',
|
||||
'fcb-button-primary group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-[30px] text-white transition-all duration-300 transform focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#8fb2bf] shadow-lg',
|
||||
isDarkMode
|
||||
? 'bg-gradient-to-r from-[#5f8796] to-[#6f9688] hover:from-[#527887] hover:to-[#5f8377] hover:shadow-[#6f98a6]/35'
|
||||
: 'bg-gradient-to-r from-[#5f8796] to-[#6f9688] hover:from-[#527887] hover:to-[#5f8377] hover:shadow-[#9fb8bf]/45',
|
||||
|
||||
@@ -96,11 +96,11 @@ onMounted(() => {
|
||||
]"
|
||||
:key="section[0]"
|
||||
type="button"
|
||||
class="inline-flex min-h-11 shrink-0 items-center justify-center rounded-full border px-3 text-center text-sm font-medium sm:px-4"
|
||||
class="fcb-action inline-flex min-h-11 shrink-0 items-center justify-center rounded-full border px-3 text-center text-sm font-medium sm:px-4"
|
||||
:class="activeSection === section[0]
|
||||
? 'border-[#5f8796] bg-[#5f8796] text-white'
|
||||
: isDarkMode
|
||||
? 'border-[#40545c] bg-[#263941] text-[#d8e3e5]'
|
||||
? 'border-[#495765] bg-[#2c3440] text-[#d8e3e5]'
|
||||
: 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66]'"
|
||||
:aria-current="activeSection === section[0] ? 'true' : undefined"
|
||||
@click="scrollToSection(section[0])"
|
||||
@@ -110,10 +110,10 @@ onMounted(() => {
|
||||
</nav>
|
||||
|
||||
<div
|
||||
class="theme-2026-card theme-2026-card-hover mx-auto max-w-6xl space-y-8 rounded-[24px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-6"
|
||||
class="theme-2026-card fcb-static-container mx-auto max-w-6xl space-y-8 rounded-[24px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-6"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'border-[#40545c] bg-[#202f36]/90 hover:border-[#7199a8] hover:bg-[#263941] hover:shadow-black/25'
|
||||
? 'border-[#495765] bg-[#252b34]/90 hover:border-[#7199a8] hover:bg-[#2c3440] hover:shadow-[#97aac8]/15'
|
||||
: 'border-[#d7e3e5] bg-[#f8fbfb] hover:border-[#8fb2bf] hover:shadow-[#a9bdc2]/70'
|
||||
]"
|
||||
>
|
||||
@@ -193,13 +193,14 @@ onMounted(() => {
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="absolute inset-y-0 right-1 flex w-11 items-center justify-center rounded-lg"
|
||||
class="fcb-action fcb-input-action absolute inset-y-0 right-1 flex w-11 items-center justify-center rounded-lg"
|
||||
:aria-label="showAdminPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
:title="showAdminPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
:aria-pressed="showAdminPassword"
|
||||
@click="showAdminPassword = !showAdminPassword"
|
||||
>
|
||||
<EyeOffIcon v-if="showAdminPassword" class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeIcon v-else class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeIcon v-if="showAdminPassword" class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeOffIcon v-else class="h-5 w-5" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
<p id="settings-admin-password-note" class="text-xs" :class="isDarkMode ? 'text-gray-300' : 'text-gray-600'">
|
||||
@@ -685,7 +686,7 @@ onMounted(() => {
|
||||
<label
|
||||
v-for="style in ['day', 'hour', 'minute', 'forever', 'count']"
|
||||
:key="style"
|
||||
class="relative inline-flex items-center group cursor-pointer"
|
||||
class="fcb-choice relative inline-flex items-center group cursor-pointer"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -694,16 +695,8 @@ onMounted(() => {
|
||||
class="peer sr-only"
|
||||
/>
|
||||
<div
|
||||
class="px-4 py-2 rounded-full border-2 transition-all duration-200 select-none"
|
||||
:class="[
|
||||
config.expireStyle.includes(style)
|
||||
? isDarkMode
|
||||
? 'bg-indigo-600 border-indigo-600 text-white'
|
||||
: 'bg-indigo-600 border-indigo-600 text-white'
|
||||
: isDarkMode
|
||||
? 'bg-gray-700 border-gray-600 text-gray-300 hover:border-indigo-500'
|
||||
: 'bg-white border-gray-300 text-gray-700 hover:border-indigo-500'
|
||||
]"
|
||||
class="fcb-action fcb-choice-face inline-flex min-h-11 items-center justify-center px-4 py-2 rounded-full border transition-all duration-200 select-none"
|
||||
:class="config.expireStyle.includes(style) ? 'fcb-button-primary' : 'fcb-button-secondary'"
|
||||
>
|
||||
{{ t(`manage.settings.expiration.${style}`) }}
|
||||
</div>
|
||||
@@ -797,7 +790,7 @@ onMounted(() => {
|
||||
|
||||
<div
|
||||
class="fixed inset-x-0 bottom-0 z-40 border-t px-4 pt-3 backdrop-blur-xl lg:left-64"
|
||||
:class="isDarkMode ? 'border-[#31454d] bg-[#17252b]/95' : 'border-[#c8d7da] bg-[#f2f6f5]/95'"
|
||||
:class="isDarkMode ? 'border-[#495765] bg-[#252b34]/95' : 'border-[#c8d7da] bg-[#f2f6f5]/95'"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
|
||||
+171
-68
@@ -2,105 +2,208 @@
|
||||
<div class="p-4 sm:p-6">
|
||||
<header class="mb-5 flex flex-col gap-3 sm:mb-6 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div>
|
||||
<p class="text-xs font-medium tracking-[0.16em]" :class="mutedTextClass">RECYCLE BIN</p>
|
||||
<h2 class="mt-1 text-2xl font-bold" :class="primaryTextClass">回收站</h2>
|
||||
<p class="mt-1 text-sm" :class="mutedTextClass">删除文件会先保留在这里;恢复后将生成新的 8 位取件码。</p>
|
||||
<p class="hidden text-xs font-medium tracking-[0.16em] sm:block" :class="mutedTextClass">RECYCLE BIN</p>
|
||||
<h2 class="mt-1 text-xl font-bold sm:text-2xl" :class="primaryTextClass">回收站</h2>
|
||||
<p class="mt-1 text-xs leading-5 sm:text-sm" :class="mutedTextClass">删除文件会先保留在这里;恢复后将生成新的 8 位取件码。</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<BaseButton variant="secondary" @click="openRetentionSettings">
|
||||
<template #icon><Settings2Icon class="mr-2 h-4 w-4" /></template>
|
||||
配置默认清理时间
|
||||
</BaseButton>
|
||||
<BaseButton class="fcb-refresh-button" variant="secondary" :loading="isLoading" @click="loadTrash">
|
||||
<template #icon><RefreshCwIcon class="mr-2 h-4 w-4" /></template>
|
||||
刷新回收站
|
||||
</BaseButton>
|
||||
<div class="grid grid-cols-2 items-center gap-2 sm:flex">
|
||||
<BaseButton variant="secondary" :disabled="busy" @click="openRetentionSettings"><template #icon><Settings2Icon class="mr-2 h-4 w-4" /></template>清理设置</BaseButton>
|
||||
<BaseButton variant="secondary" :loading="isLoading" :disabled="busy" @click="loadTrash"><template #icon><RefreshCwIcon class="mr-2 h-4 w-4" /></template>刷新回收站</BaseButton>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="mb-5 grid gap-3 sm:mb-6 sm:grid-cols-3">
|
||||
<div class="theme-2026-card rounded-[20px] border p-3.5 shadow-sm sm:rounded-[24px] sm:p-4" :class="panelClass">
|
||||
<p class="text-xs" :class="mutedTextClass">回收站记录</p><strong class="mt-1 block text-2xl" :class="primaryTextClass">{{ total }}</strong>
|
||||
</div>
|
||||
<div class="theme-2026-card rounded-[20px] border p-3.5 shadow-sm sm:rounded-[24px] sm:p-4" :class="panelClass">
|
||||
<p class="text-xs" :class="mutedTextClass">可恢复</p><strong class="mt-1 block text-2xl" :class="primaryTextClass">{{ recoverableCount }}</strong>
|
||||
</div>
|
||||
<div class="theme-2026-card rounded-[20px] border p-3.5 shadow-sm sm:rounded-[24px] sm:p-4" :class="panelClass">
|
||||
<p class="text-xs" :class="mutedTextClass">仅审计记录</p><strong class="mt-1 block text-2xl" :class="primaryTextClass">{{ purgedCount }}</strong>
|
||||
<section class="fcb-summary-grid mb-5 grid grid-cols-3 gap-2 sm:mb-6 sm:gap-3">
|
||||
<div v-for="stat in stats" :key="stat.label" class="theme-2026-card theme-2026-card-hover fcb-secondary-card min-w-0 rounded-[20px] border p-2.5 shadow-sm sm:p-4" :class="panelClass">
|
||||
<p class="text-xs" :class="mutedTextClass">{{ stat.label }}</p><strong class="mt-1 block text-xl sm:text-2xl" :class="primaryTextClass">{{ stat.value }}</strong>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="theme-2026-card overflow-hidden rounded-[24px] border shadow-md sm:rounded-[30px]" :class="panelClass">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 border-b px-4 py-3 sm:px-6 sm:py-4" :class="dividerClass">
|
||||
<div><h3 class="text-base font-semibold" :class="primaryTextClass">已删除文件</h3><p class="mt-0.5 text-xs" :class="mutedTextClass">物理清理只释放文件本体,文件记录和取件历史会持续保留。</p></div>
|
||||
<span class="inline-flex items-center rounded-full px-3 py-1 text-xs font-medium" :class="isDarkMode ? 'bg-[#263941] text-[#b8d6de]' : 'bg-[#e5f0f1] text-[#365a66]'"><ShieldCheckIcon class="mr-1.5 h-3.5 w-3.5" />审计保留</span>
|
||||
<section class="theme-2026-card mb-5 rounded-[24px] border p-3 sm:p-4" :class="panelClass" aria-label="回收站筛选">
|
||||
<form class="fcb-filter-grid grid grid-cols-2 gap-3 xl:grid-cols-[minmax(0,1fr)_180px_180px_auto]" @submit.prevent="applyFilters">
|
||||
<label class="col-span-2 min-w-0 xl:col-span-1"><span class="mb-1 block text-xs font-medium" :class="mutedTextClass">关键词</span><input v-model="draft.keyword" :disabled="busy || !supportsFilters" class="w-full rounded-xl border px-3" placeholder="搜索文件名或原取件码" /></label>
|
||||
<label><span class="mb-1 block text-xs font-medium" :class="mutedTextClass">记录状态</span><select v-model="draft.state" :disabled="busy || !supportsFilters" class="w-full rounded-xl border px-3"><option value="all">全部状态</option><option value="recoverable">可恢复</option><option value="scheduled">定时清理</option><option value="permanent">永久保留</option><option value="purged">仅审计记录</option></select></label>
|
||||
<label><span class="mb-1 block text-xs font-medium" :class="mutedTextClass">移入原因</span><select v-model="draft.reason" :disabled="busy || !supportsFilters" class="w-full rounded-xl border px-3"><option value="">全部原因</option><option value="manual">手动删除</option><option value="batch_delete">批量删除</option><option value="expired_time">保存到期</option><option value="expired_count">次数用尽</option><option value="expired_both">到期且次数用尽</option><option value="expired">历史自动回收</option></select></label>
|
||||
<div class="col-span-2 flex justify-end gap-2 xl:col-span-1"><BaseButton type="submit" :disabled="busy || !supportsFilters" :loading="isLoading">筛选</BaseButton><BaseButton variant="secondary" :disabled="busy || !supportsFilters" @click="resetFilters">重置</BaseButton></div>
|
||||
</form>
|
||||
<p v-if="!isLoading && !supportsFilters" class="mt-3 text-xs" :class="mutedTextClass">当前服务尚未支持回收站筛选和批量操作,更新服务后即可使用。</p>
|
||||
</section>
|
||||
|
||||
<div v-if="resultText" role="status" class="mb-4 rounded-2xl border p-3 text-sm" :class="panelClass">
|
||||
<p>{{ resultText }}</p>
|
||||
<ul v-if="operationResult" class="mt-2 max-h-36 overflow-auto text-xs leading-6">
|
||||
<li v-for="failure in operationResult.failed" :key="failure.id">#{{ failure.id }}:{{ failure.reason }}</li>
|
||||
<li v-for="entry in restoredEntries" :key="entry.id">#{{ entry.id }} 新取件码:<code class="font-semibold">{{ entry.code }}</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p v-if="errorText" role="alert" class="mb-4 rounded-2xl border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-200">{{ errorText }}</p>
|
||||
|
||||
<section class="theme-2026-card overflow-hidden rounded-[24px] border sm:rounded-[30px]" :class="panelClass">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 border-b px-4 py-3 sm:px-6" :class="dividerClass">
|
||||
<div><h3 class="text-base font-semibold" :class="primaryTextClass">文件记录</h3><p class="mt-0.5 text-xs" :class="mutedTextClass">{{ supportsFilters ? `筛选结果 ${total} 条 · ` : '' }}恢复文件,或调整保留期限。</p></div>
|
||||
<span class="inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs" :class="isDarkMode ? 'bg-[#303946] text-[#dbe9ee]' : 'bg-[#e5f0f1] text-[#365a66]'"><ShieldCheckIcon class="h-3.5 w-3.5" />历史保留</span>
|
||||
</div>
|
||||
|
||||
<div v-if="isLoading" class="flex min-h-64 items-center justify-center text-sm" :class="mutedTextClass"><RefreshCwIcon class="mr-2 h-4 w-4 animate-spin" />正在加载回收站…</div>
|
||||
<div v-else-if="errorText" class="px-4 py-12 text-center sm:px-6"><p class="text-sm font-medium text-red-600">{{ errorText }}</p><BaseButton class="fcb-refresh-button mt-3" variant="secondary" @click="loadTrash">重新加载</BaseButton></div>
|
||||
<div v-else-if="items.length === 0" class="px-4 py-14 text-center sm:px-6"><Trash2Icon class="mx-auto h-9 w-9" :class="mutedTextClass" /><p class="mt-3 text-sm" :class="mutedTextClass">回收站目前为空</p></div>
|
||||
|
||||
<div v-if="supportsBatch && items.length" class="flex flex-wrap items-center justify-between gap-3 border-b px-4 py-3 sm:px-6" :class="dividerClass">
|
||||
<label class="flex min-h-9 cursor-pointer items-center gap-2 text-sm"><input type="checkbox" :checked="allSelected" :indeterminate="partiallySelected" :disabled="busy || isLoading || !eligibleIds.length" @change="toggleAll" />{{ selectedIds.length ? `已选择 ${selectedIds.length} 项` : '选择当前页可操作记录' }}</label>
|
||||
<div v-if="selectedIds.length" class="grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:flex-wrap">
|
||||
<BaseButton size="sm" variant="success" :disabled="busy || isLoading" @click="executeBatch('restore', selectedIds)">批量恢复</BaseButton>
|
||||
<BaseButton size="sm" variant="outline" :disabled="busy || isLoading" @click="openRetention(selectedIds)">设置清理时间</BaseButton>
|
||||
<BaseButton size="sm" variant="outline" :disabled="busy || isLoading" @click="executeBatch('retention', selectedIds, { retentionDays: 0 })">永久保留</BaseButton>
|
||||
<BaseButton size="sm" variant="danger" :disabled="busy || isLoading" @click="askPurge(selectedIds)">批量清理</BaseButton>
|
||||
<BaseButton size="sm" variant="secondary" :disabled="busy" @click="selectedIds = []">清空选择</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isLoading" class="flex min-h-40 items-center justify-center text-sm" :class="mutedTextClass"><RefreshCwIcon class="mr-2 h-4 w-4 animate-spin" />正在加载回收站…</div>
|
||||
<div v-else-if="!items.length" class="px-4 py-12 text-center" :class="mutedTextClass"><Trash2Icon class="mx-auto h-9 w-9" /><p class="mt-3 text-sm">{{ hasFilters ? '没有匹配的回收站记录' : '回收站目前为空' }}</p></div>
|
||||
<div v-else class="divide-y" :class="dividerClass">
|
||||
<article
|
||||
v-for="item in items"
|
||||
:key="item.id"
|
||||
class="fcb-interactive-row group grid gap-3 px-4 py-4 xl:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:px-6"
|
||||
:class="isDarkMode ? 'hover:bg-[#253941]/60' : 'hover:bg-[#f2f8f8]'"
|
||||
>
|
||||
<TrashItemInfo :item="item" :is-dark-mode="isDarkMode" :now="now" />
|
||||
<div class="flex flex-wrap items-center gap-2 sm:pl-14 xl:justify-end xl:pl-0">
|
||||
<BaseButton v-if="!item.isTrashPurged" size="sm" variant="success" :loading="busyId === item.id && busyAction === 'restore'" @click="restore(item)"><template #icon><RotateCcwIcon class="mr-2 h-4 w-4" /></template>恢复</BaseButton>
|
||||
<BaseButton v-if="!item.isTrashPurged" size="sm" variant="outline" :loading="busyId === item.id && busyAction === 'retention'" @click="makePermanent(item)"><template #icon><InfinityIcon class="mr-2 h-4 w-4" /></template>永久保留</BaseButton>
|
||||
<BaseButton v-if="!item.isTrashPurged" size="sm" variant="danger" :loading="busyId === item.id && busyAction === 'purge'" @click="purge(item)"><template #icon><EraserIcon class="mr-2 h-4 w-4" /></template>物理清理</BaseButton>
|
||||
</div>
|
||||
<article v-for="item in items" :key="item.id" class="fcb-interactive-row grid grid-cols-[auto_minmax(0,1fr)] gap-3 px-3 py-4 sm:px-6" :class="{ 'trash-row-selected': selectedIds.includes(item.id) }">
|
||||
<label v-if="supportsBatch" class="flex h-11 items-center" :title="item.isTrashPurged ? '已清理记录不能操作' : ''"><input type="checkbox" v-model="selectedIds" :value="item.id" :aria-label="`选择 ${fileName(item)}`" :disabled="busy || item.isTrashPurged" /></label>
|
||||
<TrashItemInfo :item="item" :is-dark-mode="isDarkMode" :now="now" :class="!supportsBatch ? 'col-span-2' : ''">
|
||||
<template v-if="!item.isTrashPurged" #actions>
|
||||
<BaseButton size="sm" variant="success" :disabled="busy" @click="restore(item)"><template #icon><RotateCcwIcon class="mr-1 h-4 w-4" /></template>恢复</BaseButton>
|
||||
<BaseButton size="sm" variant="outline" :disabled="busy || !supportsCustomRetention" @click="openRetention([item.id])"><template #icon><CalendarClockIcon class="mr-1 h-4 w-4" /></template>清理时间</BaseButton>
|
||||
<BaseButton size="sm" variant="outline" :disabled="busy || item.isTrashPermanent" @click="makePermanent(item)"><template #icon><InfinityIcon class="mr-1 h-4 w-4" /></template>永久保留</BaseButton>
|
||||
<BaseButton size="sm" variant="danger" :disabled="busy" @click="askPurge([item.id])"><template #icon><EraserIcon class="mr-1 h-4 w-4" /></template>彻底删除</BaseButton>
|
||||
</template>
|
||||
</TrashItemInfo>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<DataPagination v-if="total > 0" :current-page="page" :page-size="size" :total="total" @page-change="changePage" @page-size-change="changePageSize" />
|
||||
</section>
|
||||
|
||||
<BaseModal :show="retentionOpen" title="设置自动清理时间" :closable="!busy" @close="retentionOpen = false">
|
||||
<p class="mb-4 text-sm" :class="mutedTextClass">为 {{ retentionIds.length }} 条记录设置相同的回收站保留期限。</p>
|
||||
<label class="mb-4 flex cursor-pointer items-center gap-2 text-sm"><input v-model="retainForever" type="checkbox" :disabled="busy" />永久保留,不自动清理</label>
|
||||
<NativeDateSelect v-if="!retainForever" v-model="cleanupTime" aria-label="自动清理时间" include-time />
|
||||
<p class="mt-3 text-xs" :class="mutedTextClass">可选择未来 365 天内的时间。</p>
|
||||
<p v-if="dialogError" role="alert" class="mt-3 text-sm text-red-700 dark:text-red-200">{{ dialogError }}</p>
|
||||
<template #footer><BaseButton variant="secondary" :disabled="busy" @click="retentionOpen = false">取消</BaseButton><BaseButton :loading="busy" @click="saveRetention">保存时间</BaseButton></template>
|
||||
</BaseModal>
|
||||
<BaseModal :show="purgeOpen" title="确认彻底删除" :closable="!busy" @close="purgeOpen = false">
|
||||
<p class="text-sm leading-6">将永久清理所选 <strong>{{ purgeIds.length }}</strong> 条记录的文件本体。此操作不可恢复,审计记录和取件历史仍保留。</p>
|
||||
<template #footer><BaseButton variant="secondary" :disabled="busy" @click="purgeOpen = false">取消</BaseButton><BaseButton variant="danger" :loading="busy" @click="confirmPurge">确认清理 {{ purgeIds.length }} 项</BaseButton></template>
|
||||
</BaseModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { EraserIcon, InfinityIcon, RefreshCwIcon, RotateCcwIcon, Settings2Icon, ShieldCheckIcon, Trash2Icon } from 'lucide-vue-next'
|
||||
import { CalendarClockIcon, EraserIcon, InfinityIcon, RefreshCwIcon, RotateCcwIcon, Settings2Icon, ShieldCheckIcon, Trash2Icon } from 'lucide-vue-next'
|
||||
import BaseButton from '@/components/common/BaseButton.vue'
|
||||
import BaseModal from '@/components/common/BaseModal.vue'
|
||||
import NativeDateSelect from '@/components/common/NativeDateSelect.vue'
|
||||
import TrashItemInfo from '@/components/manage/TrashItemInfo.vue'
|
||||
import DataPagination from '@/components/common/DataPagination.vue'
|
||||
import { useAdminTrash, useInjectedDarkMode } from '@/composables'
|
||||
import type { TrashFileItem } from '@/types'
|
||||
import type { TrashFileItem, TrashListParams, TrashListResponse, TrashBatchRequest, TrashBatchResult, TrashRetentionRequest } from '@/types'
|
||||
import { getErrorMessage } from '@/utils/common'
|
||||
import { selectableTrashIds, buildTrashRetention, summarizeTrashBatch } from '@/utils/trashSelection'
|
||||
|
||||
const isDarkMode = useInjectedDarkMode()
|
||||
const router = useRouter()
|
||||
const { fetchTrash, purgeTrashItem, restoreTrashItem, updateTrashRetention } = useAdminTrash()
|
||||
const items = ref<TrashFileItem[]>([])
|
||||
const page = ref(1)
|
||||
const size = ref(20)
|
||||
const total = ref(0)
|
||||
const isLoading = ref(false)
|
||||
const errorText = ref('')
|
||||
const busyId = ref<number | null>(null)
|
||||
const busyAction = ref('')
|
||||
const { fetchTrash, purgeTrashItem, restoreTrashItem, updateTrashRetention, batchTrash } = useAdminTrash()
|
||||
const items = ref<TrashFileItem[]>([]), page = ref(1), size = ref(20), total = ref(0)
|
||||
const summary = ref<TrashListResponse['summary']>()
|
||||
const capabilities = ref<TrashListResponse['capabilities']>()
|
||||
const supportsFilters = computed(() => capabilities.value?.filters === true)
|
||||
const supportsBatch = computed(() => capabilities.value?.batch === true)
|
||||
const supportsCustomRetention = computed(() => capabilities.value?.customRetention === true)
|
||||
const blankFilters = () => ({ keyword: '', state: 'all' as NonNullable<TrashListParams['state']>, reason: '' as NonNullable<TrashListParams['reason']> })
|
||||
const draft = ref(blankFilters()), applied = ref(blankFilters())
|
||||
const hasFilters = computed(() => Boolean(applied.value.keyword || applied.value.reason || applied.value.state !== 'all'))
|
||||
const isLoading = ref(false), busy = ref(false), errorText = ref(''), resultText = ref('')
|
||||
const operationResult = ref<TrashBatchResult | null>(null)
|
||||
const restoredEntries = computed(() => operationResult.value?.succeeded.filter(entry => entry.code) || [])
|
||||
const selectedIds = ref<number[]>([])
|
||||
const eligibleIds = computed(() => selectableTrashIds(items.value))
|
||||
const allSelected = computed(() => eligibleIds.value.length > 0 && eligibleIds.value.every(id => selectedIds.value.includes(id)))
|
||||
const partiallySelected = computed(() => selectedIds.value.length > 0 && !allSelected.value)
|
||||
const toggleAll = () => { selectedIds.value = allSelected.value ? [] : [...eligibleIds.value] }
|
||||
const now = ref(Date.now())
|
||||
let clockTimer: ReturnType<typeof setInterval> | undefined
|
||||
onMounted(() => { clockTimer = setInterval(() => { now.value = Date.now() }, 60_000) })
|
||||
onUnmounted(() => { clearInterval(clockTimer) })
|
||||
onUnmounted(() => { clearInterval(clockTimer); loadVersion++ })
|
||||
const primaryTextClass = computed(() => isDarkMode.value ? 'text-white' : 'text-[#1f3c45]')
|
||||
const mutedTextClass = computed(() => isDarkMode.value ? 'text-[#a9bdc2]' : 'text-[#617980]')
|
||||
const panelClass = computed(() => isDarkMode.value ? 'border-[#40545c] bg-[#202f36]/90' : 'border-[#d7e3e5] bg-[#f8fbfb]')
|
||||
const dividerClass = computed(() => isDarkMode.value ? 'divide-[#40545c] border-[#40545c]' : 'divide-[#d7e3e5] border-[#d7e3e5]')
|
||||
const recoverableCount = computed(() => items.value.filter(item => !item.isTrashPurged).length)
|
||||
const purgedCount = computed(() => items.value.filter(item => item.isTrashPurged).length)
|
||||
const mutedTextClass = computed(() => isDarkMode.value ? 'text-[#adbec6]' : 'text-[#617980]')
|
||||
const panelClass = computed(() => isDarkMode.value ? 'border-[#495765] bg-[#252b34]' : 'border-[#d7e3e5] bg-[#f8fbfb]')
|
||||
const dividerClass = computed(() => isDarkMode.value ? 'divide-[#495765] border-[#495765]' : 'divide-[#d7e3e5] border-[#d7e3e5]')
|
||||
const stats = computed(() => [
|
||||
{ label: '回收站记录', value: summary.value?.total ?? total.value },
|
||||
{ label: '可恢复', value: summary.value?.recoverable ?? (total.value <= size.value ? items.value.filter(item => !item.isTrashPurged).length : '—') },
|
||||
{ label: '仅审计记录', value: summary.value?.purged ?? (total.value <= size.value ? items.value.filter(item => item.isTrashPurged).length : '—') }
|
||||
])
|
||||
const fileName = (item: TrashFileItem) => item.name || `${item.prefix || ''}${item.suffix || ''}` || '未命名文件'
|
||||
const openRetentionSettings = () => { void router.push({ path: '/admin/settings', hash: '#settings-upload' }) }
|
||||
|
||||
const loadTrash = async () => { isLoading.value = true; errorText.value = ''; try { const detail = await fetchTrash({ page: page.value, size: size.value }); items.value = detail?.data || []; total.value = Number(detail?.total || 0) } catch (error: unknown) { errorText.value = (error as { response?: { data?: { detail?: string } } })?.response?.data?.detail || '回收站加载失败,请稍后重试。' } finally { isLoading.value = false } }
|
||||
const run = async (item: TrashFileItem, action: string, operation: () => Promise<unknown>) => { busyId.value = item.id; busyAction.value = action; try { await operation(); await loadTrash() } catch (error: unknown) { errorText.value = (error as { response?: { data?: { detail?: string } } })?.response?.data?.detail || '操作未完成,请稍后重试。' } finally { busyId.value = null; busyAction.value = '' } }
|
||||
const restore = (item: TrashFileItem) => run(item, 'restore', () => restoreTrashItem(item.id))
|
||||
const makePermanent = (item: TrashFileItem) => run(item, 'retention', () => updateTrashRetention(item.id, 0))
|
||||
const purge = (item: TrashFileItem) => { if (!window.confirm(`确定物理清理“${fileName(item)}”吗?文件本体不可恢复,但审计记录会永久保留。`)) return; void run(item, 'purge', () => purgeTrashItem(item.id)) }
|
||||
const changePage = (nextPage: number) => { page.value = nextPage; void loadTrash() }
|
||||
const changePageSize = (nextSize: number) => { size.value = nextSize; page.value = 1; void loadTrash() }
|
||||
let loadVersion = 0
|
||||
const loadTrash = async () => {
|
||||
const version = ++loadVersion
|
||||
isLoading.value = true; errorText.value = ''
|
||||
try {
|
||||
let detail = await fetchTrash({ page: page.value, size: size.value, ...applied.value })
|
||||
if (version !== loadVersion) return
|
||||
const lastPage = Math.max(1, Math.ceil((detail?.total || 0) / size.value))
|
||||
if (page.value > lastPage) { page.value = lastPage; detail = await fetchTrash({ page: page.value, size: size.value, ...applied.value }) }
|
||||
if (version !== loadVersion) return
|
||||
items.value = detail?.data || []; total.value = Number(detail?.total || 0)
|
||||
summary.value = detail?.summary; capabilities.value = detail?.capabilities
|
||||
selectedIds.value = selectedIds.value.filter(id => eligibleIds.value.includes(id))
|
||||
} catch (error) { if (version === loadVersion) errorText.value = getErrorMessage(error, '回收站加载失败,请重试') }
|
||||
finally { if (version === loadVersion) isLoading.value = false }
|
||||
}
|
||||
const applyFilters = () => { if (!supportsFilters.value || busy.value) return; applied.value = { ...draft.value, keyword: draft.value.keyword.trim() }; selectedIds.value = []; page.value = 1; void loadTrash() }
|
||||
const resetFilters = () => { draft.value = blankFilters(); applyFilters() }
|
||||
const changePage = (value: number) => { if (busy.value) return; page.value = value; selectedIds.value = []; void loadTrash() }
|
||||
const changePageSize = (value: number) => { if (busy.value) return; size.value = value; page.value = 1; selectedIds.value = []; void loadTrash() }
|
||||
const runSingle = async (operation: () => Promise<unknown>, message: string) => {
|
||||
if (busy.value) return false
|
||||
busy.value = true; errorText.value = ''; resultText.value = ''; operationResult.value = null
|
||||
try { await operation(); resultText.value = message; await loadTrash(); return true }
|
||||
catch (error) { errorText.value = getErrorMessage(error, '操作失败,请重试'); return false }
|
||||
finally { busy.value = false }
|
||||
}
|
||||
const executeBatch = async (action: TrashBatchRequest['action'], ids: number[], retention: TrashRetentionRequest = {}) => {
|
||||
if (busy.value || !ids.length || !supportsBatch.value) return false
|
||||
busy.value = true; errorText.value = ''; resultText.value = ''; operationResult.value = null
|
||||
try {
|
||||
const response = await batchTrash({ action, ids: [...ids], ...retention })
|
||||
if (!response.detail) throw new Error('未收到操作结果,请刷新后核对')
|
||||
operationResult.value = response.detail; resultText.value = summarizeTrashBatch(response.detail)
|
||||
selectedIds.value = response.detail.failed.map(entry => entry.id)
|
||||
await loadTrash()
|
||||
return response.detail.failed.length === 0
|
||||
} catch (error) { errorText.value = getErrorMessage(error, '操作失败,请重试'); return false }
|
||||
finally { busy.value = false }
|
||||
}
|
||||
const restore = (item: TrashFileItem) => supportsBatch.value ? executeBatch('restore', [item.id]) : runSingle(() => restoreTrashItem(item.id), '已恢复,请到文件管理查看新取件码')
|
||||
const makePermanent = (item: TrashFileItem) => supportsBatch.value ? executeBatch('retention', [item.id], { retentionDays: 0 }) : runSingle(() => updateTrashRetention(item.id, { retentionDays: 0 }), '已设为永久保留')
|
||||
const retentionOpen = ref(false), retentionIds = ref<number[]>([]), retainForever = ref(false), cleanupTime = ref(''), dialogError = ref('')
|
||||
const localDateTime = (date: Date) => `${date.getFullYear()}-${String(date.getMonth()+1).padStart(2,'0')}-${String(date.getDate()).padStart(2,'0')}T${String(date.getHours()).padStart(2,'0')}:${String(date.getMinutes()).padStart(2,'0')}`
|
||||
const openRetention = (ids: number[]) => {
|
||||
retentionIds.value = [...ids]; dialogError.value = ''
|
||||
const item = ids.length === 1 ? items.value.find(item => item.id === ids[0]) : undefined
|
||||
const current = new Date(item?.trashExpiresAt || '').getTime()
|
||||
retainForever.value = item?.isTrashPermanent === true
|
||||
cleanupTime.value = localDateTime(new Date(Number.isFinite(current) && current > Date.now() ? current : Date.now()+30*86400000))
|
||||
retentionOpen.value = true
|
||||
}
|
||||
const saveRetention = async () => {
|
||||
try {
|
||||
dialogError.value = ''
|
||||
const payload = buildTrashRetention(retainForever.value, cleanupTime.value, Date.now())
|
||||
const ok = await executeBatch('retention', retentionIds.value, payload)
|
||||
if (ok) retentionOpen.value = false
|
||||
else dialogError.value = errorText.value || resultText.value || '操作未完成,请重试'
|
||||
} catch (error) { dialogError.value = getErrorMessage(error, '请选择有效的清理时间') }
|
||||
}
|
||||
const purgeOpen = ref(false), purgeIds = ref<number[]>([])
|
||||
const askPurge = (ids: number[]) => { purgeIds.value = [...ids]; purgeOpen.value = true }
|
||||
const confirmPurge = async () => {
|
||||
const ok = supportsBatch.value ? await executeBatch('purge', purgeIds.value) : await runSingle(() => purgeTrashItem(purgeIds.value[0]), '文件本体已清理,审计记录已保留')
|
||||
if (ok || operationResult.value) purgeOpen.value = false
|
||||
}
|
||||
void loadTrash()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.trash-row-selected { background: var(--fcb-row-hover); }
|
||||
</style>
|
||||
Reference in new issue
Block a user