Lan
2025-09-04 02:53:40 +08:00
parent 5447afa988
commit f452bcd886
5 changed files with 713 additions and 670 deletions
+660 -650
View File
File diff suppressed because it is too large Load Diff
+15 -17
View File
@@ -27,7 +27,7 @@
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']">取件码</label> :class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']">取件码</label>
<div class="relative"> <div class="relative">
<input id="code" v-model="code" type="text" ref="codeInput" <input id="code" v-model="code" type="text" ref="codeInput"
class="w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10" class="w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10"
:class="[ :class="[
isDarkMode ? 'bg-gray-700 bg-opacity-50' : 'bg-gray-100', isDarkMode ? 'bg-gray-700 bg-opacity-50' : 'bg-gray-100',
{ 'ring-2 ring-red-500': error }, { 'ring-2 ring-red-500': error },
@@ -141,8 +141,8 @@
<div <div
class="p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg overflow-hidden" class="p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg overflow-hidden"
:class="[ :class="[
isDarkMode isDarkMode
? 'bg-gray-800 bg-opacity-70' ? 'bg-gray-800 bg-opacity-70'
: 'bg-white bg-opacity-95' : 'bg-white bg-opacity-95'
]"> ]">
<h3 class="text-2xl font-bold mb-6 truncate" :class="[isDarkMode ? 'text-white' : 'text-gray-800']"> <h3 class="text-2xl font-bold mb-6 truncate" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
@@ -219,21 +219,20 @@
内容预览 内容预览
</h3> </h3>
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<button @click="copyContent" <button @click="copyContent"
class="px-4 py-1.5 rounded-lg transition duration-300 flex items-center gap-2 text-sm font-medium" class="px-4 py-1.5 rounded-lg transition duration-300 flex items-center gap-2 text-sm font-medium"
:class="[ :class="[
isDarkMode isDarkMode
? 'bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white' ? 'bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white'
: 'bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-900' : 'bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-900'
]"> ]">
<CopyIcon class="w-4 h-4" /> <CopyIcon class="w-4 h-4" />
复制 复制
</button> </button>
<button @click="showPreview = false" <button @click="showPreview = false" class="p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10"
class="p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10"
:class="[ :class="[
isDarkMode isDarkMode
? 'text-gray-400 hover:text-white hover:bg-white' ? 'text-gray-400 hover:text-white hover:bg-white'
: 'text-gray-500 hover:text-gray-900 hover:bg-black' : 'text-gray-500 hover:text-gray-900 hover:bg-black'
]"> ]">
<XIcon class="w-5 h-5" /> <XIcon class="w-5 h-5" />
@@ -241,13 +240,11 @@
</div> </div>
</div> </div>
<div class="flex-1 overflow-y-auto custom-scrollbar"> <div class="flex-1 overflow-y-auto custom-scrollbar">
<div class="prose max-w-none p-6 rounded-xl" <div class="prose max-w-none p-6 rounded-xl" :class="[
:class="[ isDarkMode
isDarkMode ? 'prose-invert bg-gray-900 bg-opacity-50'
? 'prose-invert bg-gray-900 bg-opacity-50' : 'bg-gray-50'
: 'bg-gray-50' ]" v-html="renderedContent">
]"
v-html="renderedContent">
</div> </div>
</div> </div>
</div> </div>
@@ -515,6 +512,7 @@ const showContentPreview = () => {
<style scoped> <style scoped>
@keyframes blob { @keyframes blob {
0%, 0%,
100% { 100% {
transform: translate(0, 0) scale(1); transform: translate(0, 0) scale(1);
+37 -2
View File
@@ -638,7 +638,8 @@ const handlePaste = async (event: ClipboardEvent) => {
const items = event.clipboardData?.items const items = event.clipboardData?.items
if (!items) return if (!items) return
for (const item of items) { for (let i = 0; i < items.length; i++) {
const item = items[i]
if (item.kind === 'file') { if (item.kind === 'file') {
const file = item.getAsFile() const file = item.getAsFile()
if (file) { if (file) {
@@ -762,6 +763,40 @@ const getUnit = (value: string = expirationMethod.value) => {
} }
} }
const getExpirationTime = (method: string, value: string) => {
if (method === 'forever') {
return '永久'
}
if (method === 'count') {
return `${value}次后过期`
}
const now = new Date()
const expireValue = parseInt(value)
switch (method) {
case 'minute':
now.setMinutes(now.getMinutes() + expireValue)
break
case 'hour':
now.setHours(now.getHours() + expireValue)
break
case 'day':
now.setDate(now.getDate() + expireValue)
break
default:
return `${value}${getUnit(method)}后过期`
}
const year = now.getFullYear()
const month = (now.getMonth() + 1).toString().padStart(2, '0')
const day = now.getDate().toString().padStart(2, '0')
const hours = now.getHours().toString().padStart(2, '0')
const minutes = now.getMinutes().toString().padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}过期`
}
const handleChunkUpload = async (file: File) => { const handleChunkUpload = async (file: File) => {
try { try {
// 默认切片大小为5MB // 默认切片大小为5MB
@@ -959,7 +994,7 @@ const handleSubmit = async () => {
expiration: expiration:
expirationMethod.value === 'forever' expirationMethod.value === 'forever'
? '永久' ? '永久'
: `${expirationValue.value}${getUnit()}后过期`, : getExpirationTime(expirationMethod.value, expirationValue.value),
retrieveCode: retrieveCode retrieveCode: retrieveCode
} }
fileDataStore.addShareData(newRecord) fileDataStore.addShareData(newRecord)
-1
View File
@@ -3,7 +3,6 @@
<h2 class="text-2xl font-bold mb-6" :class="[isDarkMode ? 'text-white' : 'text-gray-800']"> <h2 class="text-2xl font-bold mb-6" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
仪表盘 仪表盘
</h2> </h2>
<!-- 统计卡片区域 --> <!-- 统计卡片区域 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="p-6 rounded-lg shadow-md transition-colors duration-300" <div class="p-6 rounded-lg shadow-md transition-colors duration-300"
+1
View File
@@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"moduleResolution": "bundler",
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {