feat: remove unuse file
This commit is contained in:
@@ -1,59 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="p-8 rounded-2xl max-w-3xl w-full mx-4"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<div class="flex justify-between items-center mb-6">
|
|
||||||
<h3 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
内容预览
|
|
||||||
</h3>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition duration-300"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="prose max-w-none overflow-y-auto max-h-[60vh] p-4 rounded-lg"
|
|
||||||
:class="[isDarkMode ? 'prose-invert bg-gray-800' : 'bg-gray-50']"
|
|
||||||
v-html="renderedContent"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { XIcon } from 'lucide-vue-next'
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { marked } from 'marked'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
show: Boolean,
|
|
||||||
content: String,
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close'])
|
|
||||||
|
|
||||||
const renderedContent = computed(() => marked(props.content || ''))
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fade-enter-active,
|
|
||||||
.fade-leave-active {
|
|
||||||
transition: opacity 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-from,
|
|
||||||
.fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="record"
|
|
||||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<div class="flex justify-between items-center mb-6">
|
|
||||||
<h3 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
文件详情
|
|
||||||
</h3>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition duration-300"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="space-y-6">
|
|
||||||
<div class="flex items-center space-x-4">
|
|
||||||
<FileIcon class="h-12 w-12 text-indigo-500" />
|
|
||||||
<div>
|
|
||||||
<h4
|
|
||||||
class="font-medium truncate"
|
|
||||||
:class="[isDarkMode ? 'text-white' : 'text-gray-900']"
|
|
||||||
>
|
|
||||||
{{ record.filename }}
|
|
||||||
</h4>
|
|
||||||
<p class="text-sm text-gray-500 truncate">{{ record.size }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="space-y-4">
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<CalendarIcon class="h-5 w-5 text-gray-400" />
|
|
||||||
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
|
||||||
上传时间:{{ record.date }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<HardDriveIcon class="h-5 w-5 text-gray-400" />
|
|
||||||
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
|
||||||
文件大小:{{ record.size }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-center">
|
|
||||||
<QRCode
|
|
||||||
:value="baseUrl + '/retrieve/' + record.code"
|
|
||||||
:size="200"
|
|
||||||
level="M"
|
|
||||||
render-as="svg"
|
|
||||||
:foreground="isDarkMode ? '#FFFFFF' : '#000000'"
|
|
||||||
:background="isDarkMode ? '#111827' : '#FFFFFF'"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex space-x-4">
|
|
||||||
<button
|
|
||||||
@click="$emit('show-preview')"
|
|
||||||
class="flex-1 px-4 py-2 rounded-lg bg-indigo-500 text-white hover:bg-indigo-600 transition duration-300"
|
|
||||||
>
|
|
||||||
预览内容
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="$emit('download')"
|
|
||||||
class="flex-1 px-4 py-2 rounded-lg bg-green-500 text-white hover:bg-green-600 transition duration-300"
|
|
||||||
>
|
|
||||||
<DownloadIcon class="h-5 w-5 inline-block mr-2" />
|
|
||||||
下载
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { FileIcon, CalendarIcon, HardDriveIcon, DownloadIcon, XIcon } from 'lucide-vue-next'
|
|
||||||
import QRCode from 'qrcode.vue'
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
record: Object,
|
|
||||||
isDarkMode: Boolean,
|
|
||||||
baseUrl: String
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close', 'show-preview', 'download'])
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fade-enter-active,
|
|
||||||
.fade-leave-active {
|
|
||||||
transition: opacity 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-from,
|
|
||||||
.fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
<template>
|
|
||||||
<form @submit.prevent="handleSubmit">
|
|
||||||
<div class="mb-6 relative">
|
|
||||||
<label
|
|
||||||
for="code"
|
|
||||||
class="block text-sm font-medium mb-2"
|
|
||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']"
|
|
||||||
>取件码</label
|
|
||||||
>
|
|
||||||
<div class="relative">
|
|
||||||
<input
|
|
||||||
id="code"
|
|
||||||
v-model="code"
|
|
||||||
type="text"
|
|
||||||
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="[
|
|
||||||
isDarkMode ? 'bg-gray-700 bg-opacity-50' : 'bg-gray-100',
|
|
||||||
{ 'ring-2 ring-red-500': error },
|
|
||||||
[isDarkMode ? 'text-gray-300' : 'text-gray-800']
|
|
||||||
]"
|
|
||||||
placeholder="请输入5位取件码"
|
|
||||||
required
|
|
||||||
:readonly="inputStatus.readonly"
|
|
||||||
maxlength="5"
|
|
||||||
@focus="isInputFocused = true"
|
|
||||||
@blur="isInputFocused = false"
|
|
||||||
/>
|
|
||||||
<div v-if="inputStatus.loading" class="absolute inset-y-0 right-0 flex items-center pr-3">
|
|
||||||
<span class="animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-500"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="absolute -bottom-0.5 left-2 h-0.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 transition-all duration-300 ease-in-out"
|
|
||||||
:class="{ 'w-97-100': isInputFocused, 'w-0': !isInputFocused }"
|
|
||||||
></div>
|
|
||||||
<p v-if="error" class="mt-2 text-sm text-red-500">{{ error }}</p>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-3 px-4 rounded-lg hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group"
|
|
||||||
:disabled="inputStatus.loading"
|
|
||||||
>
|
|
||||||
<span class="flex items-center justify-center">
|
|
||||||
<span>获取文件</span>
|
|
||||||
<ArrowRightIcon class="ml-2 h-5 w-5" />
|
|
||||||
</span>
|
|
||||||
<div
|
|
||||||
class="absolute inset-0 bg-gradient-to-r from-indigo-600 via-purple-600 to-pink-600 opacity-0 group-hover:opacity-100 transition-opacity duration-300"
|
|
||||||
></div>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, inject } from 'vue'
|
|
||||||
import { ArrowRightIcon } from 'lucide-vue-next'
|
|
||||||
|
|
||||||
const emit = defineEmits(['submit'])
|
|
||||||
|
|
||||||
const code = ref('')
|
|
||||||
const inputStatus = ref({
|
|
||||||
readonly: false,
|
|
||||||
loading: false
|
|
||||||
})
|
|
||||||
const isInputFocused = ref(false)
|
|
||||||
const error = ref('')
|
|
||||||
const isDarkMode = inject('isDarkMode')
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
if (code.value.length !== 5) {
|
|
||||||
error.value = '请输入5位取件码'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
error.value = ''
|
|
||||||
inputStatus.value.loading = true
|
|
||||||
inputStatus.value.readonly = true
|
|
||||||
|
|
||||||
try {
|
|
||||||
await emit('submit', code.value)
|
|
||||||
} catch (err) {
|
|
||||||
error.value = err.message
|
|
||||||
} finally {
|
|
||||||
inputStatus.value.loading = false
|
|
||||||
inputStatus.value.readonly = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.w-97-100 {
|
|
||||||
width: 97%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="drawer">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
class="fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex justify-between items-center p-6 border-b"
|
|
||||||
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
|
||||||
>
|
|
||||||
<h2 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
历史记录
|
|
||||||
</h2>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition duration-300"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex-grow overflow-y-auto p-6">
|
|
||||||
<transition-group name="list" tag="div" class="space-y-4">
|
|
||||||
<div
|
|
||||||
v-for="record in records"
|
|
||||||
:key="record.id"
|
|
||||||
class="p-4 rounded-lg transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode ? 'bg-gray-800 hover:bg-gray-700' : 'bg-white hover:bg-gray-50 shadow-md'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<div class="flex items-start justify-between">
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<FileIcon
|
|
||||||
class="h-5 w-5 text-indigo-500"
|
|
||||||
:class="[record.type === 'text' ? 'text-purple-500' : 'text-indigo-500']"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<h3
|
|
||||||
class="font-medium truncate max-w-[200px]"
|
|
||||||
:class="[isDarkMode ? 'text-white' : 'text-gray-900']"
|
|
||||||
>
|
|
||||||
{{ record.filename }}
|
|
||||||
</h3>
|
|
||||||
<p class="text-sm text-gray-500">{{ record.size }} · {{ record.date }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex space-x-2">
|
|
||||||
<button
|
|
||||||
@click="$emit('view-details', record)"
|
|
||||||
class="p-2 rounded-full hover:bg-opacity-20 transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'hover:bg-indigo-400 text-indigo-400'
|
|
||||||
: 'hover:bg-indigo-100 text-indigo-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<EyeIcon
|
|
||||||
class="h-4 w-4"
|
|
||||||
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="$emit('download', record)"
|
|
||||||
class="p-2 rounded-full hover:bg-opacity-20 transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'hover:bg-green-400 text-green-400'
|
|
||||||
: 'hover:bg-green-100 text-green-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<DownloadIcon
|
|
||||||
class="h-4 w-4"
|
|
||||||
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="$emit('delete', record)"
|
|
||||||
class="p-2 rounded-full hover:bg-opacity-20 transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode ? 'hover:bg-red-400 text-red-400' : 'hover:bg-red-100 text-red-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<TrashIcon class="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition-group>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { FileIcon, EyeIcon, DownloadIcon, TrashIcon, XIcon } from 'lucide-vue-next'
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
show: Boolean,
|
|
||||||
records: Array,
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close', 'view-details', 'download', 'delete'])
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer-enter-active,
|
|
||||||
.drawer-leave-active {
|
|
||||||
transition: transform 0.3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-enter-from,
|
|
||||||
.drawer-leave-to {
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-enter-active,
|
|
||||||
.list-leave-active {
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-enter-from,
|
|
||||||
.list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(30px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="p-8 rounded-2xl max-w-3xl w-full mx-4"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<!-- Modal Header -->
|
|
||||||
<div class="flex justify-between items-center mb-6">
|
|
||||||
<h3 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
内容预览
|
|
||||||
</h3>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg transition duration-300"
|
|
||||||
:class="[isDarkMode ? 'hover:bg-gray-800' : 'hover:bg-gray-100']"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Content -->
|
|
||||||
<div
|
|
||||||
class="prose max-w-none overflow-y-auto max-h-[60vh] p-4 rounded-lg"
|
|
||||||
:class="[isDarkMode ? 'prose-invert bg-gray-800' : 'bg-gray-50']"
|
|
||||||
v-html="renderedContent"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { XIcon } from 'lucide-vue-next'
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { marked } from 'marked'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
show: Boolean,
|
|
||||||
content: String,
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close'])
|
|
||||||
|
|
||||||
const renderedContent = computed(() => marked(props.content || ''))
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fade-enter-active,
|
|
||||||
.fade-leave-active {
|
|
||||||
transition: opacity 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-from,
|
|
||||||
.fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Markdown Styles */
|
|
||||||
:deep(.prose) {
|
|
||||||
max-width: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.prose pre) {
|
|
||||||
background-color: v-bind('isDarkMode ? "#1F2937" : "#F3F4F6"');
|
|
||||||
padding: 1rem;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.prose code) {
|
|
||||||
color: v-bind('isDarkMode ? "#E5E7EB" : "#1F2937"');
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.prose a) {
|
|
||||||
color: #6366f1;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.prose a:hover) {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col space-y-4">
|
|
||||||
<label :class="['text-sm font-medium', isDarkMode ? 'text-gray-300' : 'text-gray-700']">
|
|
||||||
过期方式
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
:value="method"
|
|
||||||
@input="$emit('update:method', $event.target.value)"
|
|
||||||
:class="[
|
|
||||||
'px-4 py-2 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500',
|
|
||||||
isDarkMode
|
|
||||||
? 'bg-gray-800 bg-opacity-50 text-white'
|
|
||||||
: 'bg-white text-gray-900 border border-gray-300'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<option value="day">按天数</option>
|
|
||||||
<option value="hour">按小时</option>
|
|
||||||
<option value="minute">按分钟</option>
|
|
||||||
<option value="count">按查看次数</option>
|
|
||||||
<option value="forever">永久</option>
|
|
||||||
</select>
|
|
||||||
<div v-if="method !== 'forever'" class="flex items-center space-x-2">
|
|
||||||
<div class="relative flex-grow">
|
|
||||||
<input
|
|
||||||
:value="value"
|
|
||||||
@input="$emit('update:value', $event.target.value)"
|
|
||||||
type="number"
|
|
||||||
:placeholder="getPlaceholder()"
|
|
||||||
:class="[
|
|
||||||
'w-full px-4 py-2 pr-16 rounded-xl placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500',
|
|
||||||
isDarkMode
|
|
||||||
? 'bg-gray-800 bg-opacity-50 text-white'
|
|
||||||
: 'bg-white text-gray-900 border border-gray-300'
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
:class="[
|
|
||||||
'absolute right-3 top-1/2 transform -translate-y-1/2',
|
|
||||||
isDarkMode ? 'text-gray-300' : 'text-gray-700'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
{{ getUnit() }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
method: String,
|
|
||||||
value: [String, Number],
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['update:method', 'update:value'])
|
|
||||||
|
|
||||||
const getPlaceholder = () => {
|
|
||||||
switch (props.method) {
|
|
||||||
case 'day':
|
|
||||||
return '输入天数'
|
|
||||||
case 'hour':
|
|
||||||
return '输入小时数'
|
|
||||||
case 'minute':
|
|
||||||
return '输入分钟数'
|
|
||||||
case 'count':
|
|
||||||
return '输入查看次数'
|
|
||||||
default:
|
|
||||||
return '输入值'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getUnit = () => {
|
|
||||||
switch (props.method) {
|
|
||||||
case 'day':
|
|
||||||
return '天'
|
|
||||||
case 'hour':
|
|
||||||
return '小时'
|
|
||||||
case 'minute':
|
|
||||||
return '分钟'
|
|
||||||
case 'count':
|
|
||||||
return '次'
|
|
||||||
default:
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="record"
|
|
||||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<!-- Modal Header -->
|
|
||||||
<div class="flex justify-between items-center mb-6">
|
|
||||||
<h3 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
文件详情
|
|
||||||
</h3>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg transition duration-300"
|
|
||||||
:class="[isDarkMode ? 'hover:bg-gray-800' : 'hover:bg-gray-100']"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- File Info -->
|
|
||||||
<div class="space-y-6">
|
|
||||||
<div class="flex items-center space-x-4">
|
|
||||||
<FileIcon
|
|
||||||
class="h-12 w-12"
|
|
||||||
:class="[record.type === 'text' ? 'text-purple-500' : 'text-indigo-500']"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<h4 class="font-medium" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
{{ record.filename }}
|
|
||||||
</h4>
|
|
||||||
<p class="text-sm text-gray-500">
|
|
||||||
{{ record.size }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Details -->
|
|
||||||
<div class="space-y-4">
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<CalendarIcon class="h-5 w-5 text-gray-400" />
|
|
||||||
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
|
||||||
上传时间:{{ record.date }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<ClockIcon class="h-5 w-5 text-gray-400" />
|
|
||||||
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
|
||||||
过期时间:{{ record.expireDate }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<KeyIcon class="h-5 w-5 text-gray-400" />
|
|
||||||
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-600']">
|
|
||||||
取件码:{{ record.code }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- QR Code -->
|
|
||||||
<div class="flex justify-center">
|
|
||||||
<QRCode
|
|
||||||
:value="`${baseUrl}/retrieve/${record.code}`"
|
|
||||||
:size="200"
|
|
||||||
level="M"
|
|
||||||
render-as="svg"
|
|
||||||
:foreground="isDarkMode ? '#FFFFFF' : '#000000'"
|
|
||||||
:background="isDarkMode ? '#111827' : '#FFFFFF'"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Actions -->
|
|
||||||
<div class="flex space-x-4">
|
|
||||||
<button
|
|
||||||
v-if="record.type === 'text'"
|
|
||||||
@click="$emit('show-preview')"
|
|
||||||
class="flex-1 px-4 py-2 rounded-lg bg-indigo-500 text-white hover:bg-indigo-600 transition duration-300"
|
|
||||||
>
|
|
||||||
预览内容
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="flex-1 px-4 py-2 rounded-lg bg-green-500 text-white hover:bg-green-600 transition duration-300"
|
|
||||||
@click="copyShareLink"
|
|
||||||
>
|
|
||||||
复制链接
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { FileIcon, CalendarIcon, ClockIcon, KeyIcon, XIcon } from 'lucide-vue-next'
|
|
||||||
import QRCode from 'qrcode.vue'
|
|
||||||
import { copyToClipboard } from '@/utils/clipboard'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
record: Object,
|
|
||||||
isDarkMode: Boolean,
|
|
||||||
baseUrl: String
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close', 'show-preview'])
|
|
||||||
|
|
||||||
const copyShareLink = async () => {
|
|
||||||
copyToClipboard(`${props.baseUrl}/#/?code=${props.record.code}`)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fade-enter-active,
|
|
||||||
.fade-leave-active {
|
|
||||||
transition: opacity 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-from,
|
|
||||||
.fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
class="rounded-xl p-8 flex flex-col items-center justify-center border-2 border-dashed transition-all duration-300 group cursor-pointer relative"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'bg-gray-800 bg-opacity-50 border-gray-600 hover:border-indigo-500'
|
|
||||||
: 'bg-gray-100 border-gray-300 hover:border-indigo-500'
|
|
||||||
]"
|
|
||||||
@click="triggerFileUpload"
|
|
||||||
@dragover.prevent
|
|
||||||
@drop.prevent="handleFileDrop"
|
|
||||||
>
|
|
||||||
<input id="file-upload" type="file" class="hidden" @change="handleFileUpload" ref="fileInput" />
|
|
||||||
<div class="absolute inset-0 w-full h-full" v-if="uploadProgress > 0">
|
|
||||||
<BorderProgressBar :progress="uploadProgress" />
|
|
||||||
</div>
|
|
||||||
<UploadCloudIcon
|
|
||||||
:class="[
|
|
||||||
'w-16 h-16 transition-colors duration-300',
|
|
||||||
isDarkMode
|
|
||||||
? 'text-gray-400 group-hover:text-indigo-400'
|
|
||||||
: 'text-gray-600 group-hover:text-indigo-600'
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
:class="[
|
|
||||||
'mt-4 text-sm transition-colors duration-300 w-full text-center',
|
|
||||||
isDarkMode
|
|
||||||
? 'text-gray-400 group-hover:text-indigo-400'
|
|
||||||
: 'text-gray-600 group-hover:text-indigo-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<span class="block truncate">
|
|
||||||
{{ selectedFile ? selectedFile.name : '点击或拖放文件到此处上传' }}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<p :class="['mt-2 text-xs', isDarkMode ? 'text-gray-500' : 'text-gray-400']">
|
|
||||||
支持各种常见格式,最大20MB
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import { UploadCloudIcon } from 'lucide-vue-next'
|
|
||||||
import BorderProgressBar from '@/components/common/BorderProgressBar.vue'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
isDarkMode: Boolean,
|
|
||||||
uploadProgress: Number
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits(['file-selected'])
|
|
||||||
|
|
||||||
const fileInput = ref(null)
|
|
||||||
const selectedFile = ref(null)
|
|
||||||
|
|
||||||
const triggerFileUpload = () => {
|
|
||||||
fileInput.value?.click()
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleFileUpload = (event) => {
|
|
||||||
const file = event.target.files?.[0]
|
|
||||||
if (file) {
|
|
||||||
selectedFile.value = file
|
|
||||||
emit('file-selected', file)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleFileDrop = (event) => {
|
|
||||||
const file = event.dataTransfer?.files[0]
|
|
||||||
if (file) {
|
|
||||||
selectedFile.value = file
|
|
||||||
emit('file-selected', file)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="drawer">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
class="fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<!-- Drawer Header -->
|
|
||||||
<div
|
|
||||||
class="flex justify-between items-center p-6 border-b"
|
|
||||||
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
|
||||||
>
|
|
||||||
<h2 class="text-xl font-semibold" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
发送记录
|
|
||||||
</h2>
|
|
||||||
<button
|
|
||||||
@click="$emit('close')"
|
|
||||||
class="p-2 rounded-lg transition duration-300"
|
|
||||||
:class="[isDarkMode ? 'hover:bg-gray-800' : 'hover:bg-gray-100']"
|
|
||||||
>
|
|
||||||
<XIcon class="h-6 w-6" :class="[isDarkMode ? 'text-white' : 'text-gray-900']" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Records List -->
|
|
||||||
<div class="flex-grow overflow-y-auto p-6">
|
|
||||||
<transition-group name="list" tag="div" class="space-y-4">
|
|
||||||
<div
|
|
||||||
v-for="record in records"
|
|
||||||
:key="record.id"
|
|
||||||
class="p-4 rounded-lg transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode ? 'bg-gray-800 hover:bg-gray-700' : 'bg-white hover:bg-gray-50 shadow-md'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<div class="flex items-start justify-between">
|
|
||||||
<div class="flex items-center space-x-3">
|
|
||||||
<FileIcon
|
|
||||||
class="h-5 w-5 text-indigo-500"
|
|
||||||
:class="[record.type === 'text' ? 'text-purple-500' : 'text-indigo-500']"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<h3 class="font-medium" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
|
||||||
{{ record.filename }}
|
|
||||||
</h3>
|
|
||||||
<p class="text-sm text-gray-500">{{ record.size }} · {{ record.date }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex space-x-2">
|
|
||||||
<button
|
|
||||||
@click="$emit('view-details', record)"
|
|
||||||
class="p-2 rounded-lg transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'hover:bg-gray-600 text-gray-400'
|
|
||||||
: 'hover:bg-gray-200 text-gray-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<EyeIcon class="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="$emit('delete', record.id)"
|
|
||||||
class="p-2 rounded-lg transition duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'hover:bg-gray-600 text-gray-400'
|
|
||||||
: 'hover:bg-gray-200 text-gray-600'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<TrashIcon class="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition-group>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { FileIcon, EyeIcon, TrashIcon, XIcon } from 'lucide-vue-next'
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
show: Boolean,
|
|
||||||
records: Array,
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['close', 'view-details', 'delete'])
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer-enter-active,
|
|
||||||
.drawer-leave-active {
|
|
||||||
transition: transform 0.3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-enter-from,
|
|
||||||
.drawer-leave-to {
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-enter-active,
|
|
||||||
.list-leave-active {
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-enter-from,
|
|
||||||
.list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(30px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<template>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold 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:scale-105 hover:shadow-lg relative overflow-hidden group"
|
|
||||||
>
|
|
||||||
<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">
|
|
||||||
<SendIcon class="w-6 h-6 mr-2" />
|
|
||||||
<span>安全寄送</span>
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { SendIcon } from 'lucide-vue-next'
|
|
||||||
</script>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
class="px-8 py-4 bg-opacity-50 flex justify-between items-center"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-800' : 'bg-gray-100']"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="text-sm flex items-center"
|
|
||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']"
|
|
||||||
>
|
|
||||||
<ShieldCheckIcon class="w-4 h-4 mr-1 text-green-400" />
|
|
||||||
安全加密
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
@click="$emit('toggle-drawer')"
|
|
||||||
class="text-sm hover:text-indigo-300 transition duration-300 flex items-center"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
>
|
|
||||||
发件记录
|
|
||||||
<ClipboardListIcon class="w-4 h-4 ml-1" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ShieldCheckIcon, ClipboardListIcon } from 'lucide-vue-next'
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['toggle-drawer'])
|
|
||||||
</script>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-8">
|
|
||||||
<h2
|
|
||||||
class="text-3xl font-extrabold text-center mb-8 cursor-pointer transition-colors duration-300"
|
|
||||||
:class="[
|
|
||||||
isDarkMode
|
|
||||||
? 'text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300'
|
|
||||||
: 'text-indigo-600'
|
|
||||||
]"
|
|
||||||
@click="$emit('to-retrieve')"
|
|
||||||
>
|
|
||||||
FileCodeBox
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
defineProps({
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['to-retrieve'])
|
|
||||||
</script>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex justify-center space-x-4 mb-6">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
@click="$emit('update:modelValue', 'file')"
|
|
||||||
:class="[
|
|
||||||
'px-4 py-2 rounded-lg',
|
|
||||||
modelValue === 'file' ? 'bg-indigo-600 text-white' : 'bg-gray-700 text-gray-300'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
发送文件
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
@click="$emit('update:modelValue', 'text')"
|
|
||||||
:class="[
|
|
||||||
'px-4 py-2 rounded-lg',
|
|
||||||
modelValue === 'text' ? 'bg-indigo-600 text-white' : 'bg-gray-700 text-gray-300'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
发送文本
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
defineProps({
|
|
||||||
modelValue: String
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['update:modelValue'])
|
|
||||||
</script>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<textarea
|
|
||||||
id="text-content"
|
|
||||||
:value="modelValue"
|
|
||||||
@input="$emit('update:modelValue', $event.target.value)"
|
|
||||||
rows="7"
|
|
||||||
:class="[
|
|
||||||
'flex-grow px-4 py-3 rounded-xl placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 resize-none',
|
|
||||||
isDarkMode
|
|
||||||
? 'bg-gray-800 bg-opacity-50 text-white'
|
|
||||||
: 'bg-white text-gray-900 border border-gray-300'
|
|
||||||
]"
|
|
||||||
placeholder="在此输入要发送的文本..."
|
|
||||||
></textarea>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
defineProps({
|
|
||||||
modelValue: String,
|
|
||||||
isDarkMode: Boolean
|
|
||||||
})
|
|
||||||
|
|
||||||
defineEmits(['update:modelValue'])
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user