完成 FileCodeBox 2026 全站桌面端、平板和移动端的视觉交互复核,补齐文件选择后的批量操作闭环,并降低公共首屏的字体与低频依赖成本。 - 为移动文件列表增加全选、已选数量、批量编辑、策略与删除固定栏,并补充详情删除和空筛选重置 - 优化设置保存栏、分区导航、发送过期控件、仪表盘日期与图表操作、分页和记录抽屉 - 为后台侧栏增加遮罩、滚动锁定、Escape 关闭和焦点返回,完善登录密码可见性与国际化 - 移除全站强制 DingTalk 字体,按需加载 JSZip、Marked 和 DOMPurify,并停止空闲提示定时器 - 已通过架构检查、Vue 类型检查、ESLint、生产构建、48 组多视口明暗模式矩阵及核心流程回归
113 lines
4.0 KiB
Vue
113 lines
4.0 KiB
Vue
<template>
|
|
<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 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)"
|
|
>
|
|
<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 { computed, inject } from 'vue'
|
|
import { ChevronDownIcon, MinusIcon, PlusIcon } from 'lucide-vue-next'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const { t } = useI18n()
|
|
|
|
interface Props {
|
|
expirationMethod: string
|
|
expirationValue: string
|
|
options: Array<{ label: string; value: string }>
|
|
}
|
|
|
|
interface Emits {
|
|
'update:expirationMethod': [value: string]
|
|
'update:expirationValue': [value: string]
|
|
}
|
|
|
|
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) => {
|
|
emit('update:expirationMethod', (event.target as HTMLSelectElement).value)
|
|
}
|
|
|
|
const updateValue = (event: Event) => {
|
|
emit('update:expirationValue', (event.target as HTMLInputElement).value)
|
|
}
|
|
|
|
const incrementValue = (delta: number) => {
|
|
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')
|
|
}
|
|
}
|
|
</script>
|