⚡ 全面优化 2026 前端响应式体验与加载性能

完成 FileCodeBox 2026 全站桌面端、平板和移动端的视觉交互复核,补齐文件选择后的批量操作闭环,并降低公共首屏的字体与低频依赖成本。

- 为移动文件列表增加全选、已选数量、批量编辑、策略与删除固定栏,并补充详情删除和空筛选重置
- 优化设置保存栏、分区导航、发送过期控件、仪表盘日期与图表操作、分页和记录抽屉
- 为后台侧栏增加遮罩、滚动锁定、Escape 关闭和焦点返回,完善登录密码可见性与国际化
- 移除全站强制 DingTalk 字体,按需加载 JSZip、Marked 和 DOMPurify,并停止空闲提示定时器
- 已通过架构检查、Vue 类型检查、ESLint、生产构建、48 组多视口明暗模式矩阵及核心流程回归
This commit is contained in:
orion committed 2026-07-21 16:44:45 +08:00
1 parent fa6b484d17
commit aa3743b42d
26 files changed
+488 -441

No files matched your search

+71 -146
View File
@@ -1,137 +1,67 @@
<template>
<div class="flex flex-col space-y-3">
<label for="send-expiration-value" :class="['text-sm font-medium', isDarkMode ? 'text-gray-300' : 'text-gray-700']">
<div class="space-y-3">
<label for="send-expiration-value" class="block text-sm font-medium" :class="isDarkMode ? 'text-gray-300' : 'text-gray-700'">
{{ t('send.expiration.label') }}
</label>
<div class="relative flex-grow group">
<div
:class="[
'relative h-12 rounded-2xl border transition-all duration-300 shadow-sm',
isDarkMode
? 'bg-gray-800/60 border-gray-700/60 group-hover:border-gray-600/80 group-hover:shadow-lg group-hover:shadow-gray-900/20'
: 'bg-white border-gray-200 group-hover:border-gray-300 group-hover:shadow-md group-hover:shadow-gray-200/50'
]"
<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="controlClass"
:disabled="numericValue <= 1"
:aria-label="t('send.expiration.decrement')"
@click="incrementValue(-1)"
>
<template v-if="expirationMethod !== 'forever'">
<input
id="send-expiration-value"
:value="expirationValue"
@input="updateValue"
type="number"
:placeholder="getPlaceholder()"
min="1"
:class="[
'w-full h-full px-5 pr-32 rounded-2xl placeholder-gray-400 transition-all duration-300',
'focus:outline-none focus:ring-2 focus:ring-offset-0',
'[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',
'bg-transparent',
isDarkMode
? 'text-gray-100 focus:ring-indigo-500/80 placeholder-gray-500'
: 'text-gray-900 focus:ring-indigo-500/60 placeholder-gray-400'
]"
/>
<div
class="absolute right-28 top-0 h-full flex flex-col border-l"
:class="[isDarkMode ? 'border-gray-700/60' : 'border-gray-200']"
>
<button
type="button"
:aria-label="t('send.expiration.increment')"
@click="incrementValue(1)"
class="flex-1 px-2 flex items-center justify-center transition-all duration-200"
:class="[
isDarkMode
? 'hover:bg-gray-700/60 text-gray-400 hover:text-gray-200'
: 'hover:bg-gray-50 text-gray-500 hover:text-gray-700'
]"
>
<svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 15l7-7 7 7"
/>
</svg>
</button>
<button
type="button"
:aria-label="t('send.expiration.decrement')"
@click="incrementValue(-1)"
class="flex-1 px-2 flex items-center justify-center transition-all duration-200"
:class="[
isDarkMode
? 'hover:bg-gray-700/60 text-gray-400 hover:text-gray-200'
: 'hover:bg-gray-50 text-gray-500 hover:text-gray-700'
]"
>
<svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
</div>
</template>
<select
:aria-label="t('send.expiration.method')"
:value="expirationMethod"
@change="updateMethod"
:class="[
'absolute right-0 top-0 h-full appearance-none cursor-pointer transition-all duration-300',
'focus:outline-none focus:ring-2 focus:ring-offset-0',
expirationMethod === 'forever'
? 'w-full px-5 rounded-2xl'
: 'w-28 pl-4 pr-9 border-l rounded-r-2xl',
isDarkMode
? 'text-gray-100 border-gray-700/60 focus:ring-indigo-500/80 bg-gray-800/60'
: 'text-gray-900 border-gray-200 focus:ring-indigo-500/60 bg-white'
]"
:style="{
color: isDarkMode ? '#f3f4f6' : '#111827',
backgroundColor: isDarkMode ? 'rgba(31, 41, 55, 0.5)' : '#ffffff'
}"
>
<option
v-for="option in options"
:key="option.value"
:value="option.value"
:class="[isDarkMode ? 'bg-gray-800 text-gray-100' : 'bg-white text-gray-900']"
:style="{
color: isDarkMode ? '#f3f4f6' : '#111827',
backgroundColor: isDarkMode ? '#1f2937' : '#ffffff'
}"
>
{{ option.label }}
</option>
</select>
<div
class="absolute pointer-events-none"
:class="[
expirationMethod === 'forever' ? 'right-3' : 'right-2',
'top-1/2 -translate-y-1/2',
isDarkMode ? 'text-gray-400' : 'text-gray-500'
]"
>
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
</div>
</div>
<MinusIcon class="h-5 w-5" aria-hidden="true" />
</button>
<input
id="send-expiration-value"
:value="expirationValue"
type="number"
min="1"
inputmode="numeric"
class="h-11 min-w-0 rounded-xl border px-3 text-center font-semibold tabular-nums outline-none transition-colors focus:ring-2 focus:ring-indigo-500 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
:class="controlClass"
:placeholder="getPlaceholder()"
@input="updateValue"
/>
<button
type="button"
class="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)"
>
<PlusIcon class="h-5 w-5" aria-hidden="true" />
</button>
</div>
<label class="block">
<span class="sr-only">{{ t('send.expiration.method') }}</span>
<div class="relative">
<select
:value="expirationMethod"
class="min-h-11 w-full cursor-pointer appearance-none rounded-xl border py-2.5 pl-4 pr-11 text-sm font-medium outline-none transition-colors focus:ring-2 focus:ring-indigo-500"
:class="controlClass"
:aria-label="t('send.expiration.method')"
@change="updateMethod"
>
<option v-for="option in options" :key="option.value" :value="option.value">
{{ option.label }}
</option>
</select>
<ChevronDownIcon class="pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 opacity-70" aria-hidden="true" />
</div>
</label>
</div>
</template>
<script setup lang="ts">
import { inject } from 'vue'
import { computed, inject } from 'vue'
import { ChevronDownIcon, MinusIcon, PlusIcon } from 'lucide-vue-next'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
@@ -139,10 +69,7 @@ const { t } = useI18n()
interface Props {
expirationMethod: string
expirationValue: string
options: Array<{
label: string
value: string
}>
options: Array<{ label: string; value: string }>
}
interface Emits {
@@ -154,34 +81,32 @@ const props = defineProps<Props>()
const emit = defineEmits<Emits>()
const isDarkMode = inject('isDarkMode')
const numericValue = computed(() => Math.max(1, Number.parseInt(props.expirationValue) || 1))
const controlClass = computed(() =>
isDarkMode
? 'border-gray-600 bg-gray-800/70 text-gray-100 hover:border-gray-500'
: 'border-gray-300 bg-white text-gray-900 hover:border-gray-400'
)
const updateMethod = (event: Event) => {
const target = event.target as HTMLSelectElement
emit('update:expirationMethod', target.value)
emit('update:expirationMethod', (event.target as HTMLSelectElement).value)
}
const updateValue = (event: Event) => {
const target = event.target as HTMLInputElement
emit('update:expirationValue', target.value)
emit('update:expirationValue', (event.target as HTMLInputElement).value)
}
const incrementValue = (delta: number) => {
const currentValue = parseInt(props.expirationValue) || 0
const newValue = Math.max(1, currentValue + delta)
emit('update:expirationValue', newValue.toString())
emit('update:expirationValue', Math.max(1, numericValue.value + delta).toString())
}
const getPlaceholder = () => {
switch (props.expirationMethod) {
case 'count':
return t('send.expiration.placeholders.count')
case 'minute':
return t('send.expiration.placeholders.minutes')
case 'hour':
return t('send.expiration.placeholders.hours')
case 'day':
return t('send.expiration.placeholders.days')
default:
return t('send.expiration.placeholders.default')
case 'count': return t('send.expiration.placeholders.count')
case 'minute': return t('send.expiration.placeholders.minutes')
case 'hour': return t('send.expiration.placeholders.hours')
case 'day': return t('send.expiration.placeholders.days')
default: return t('send.expiration.placeholders.default')
}
}
</script>