2
This commit is contained in:
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watchEffect, provide, onMounted } from 'vue'
|
import { ref, watchEffect, provide, onMounted } from 'vue'
|
||||||
import { RouterView } from 'vue-router'
|
import { RouterView } from 'vue-router'
|
||||||
import ThemeToggle from './components/ThemeToggle.vue'
|
import ThemeToggle from './components/common/ThemeToggle.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import api from './utils/api'
|
import api from './utils/api'
|
||||||
const isDarkMode = ref(false)
|
const isDarkMode = ref(false)
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
import AlertComponent from '@/components/AlertComponent.vue'
|
import AlertComponent from '@/components/common/AlertComponent.vue'
|
||||||
import { useAlertStore } from '@/stores/alertStore'
|
import { useAlertStore } from '@/stores/alertStore'
|
||||||
|
|
||||||
const alertStore = useAlertStore()
|
const alertStore = useAlertStore()
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ const toggleColorMode = () => {
|
|||||||
<SunIcon v-if="!isDarkMode" class="w-6 h-6" />
|
<SunIcon v-if="!isDarkMode" class="w-6 h-6" />
|
||||||
<MoonIcon v-else class="w-6 h-6" />
|
<MoonIcon v-else class="w-6 h-6" />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<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" :class="[isDarkMode ? 'text-white' : 'text-gray-900']">
|
||||||
|
{{ record.filename }}
|
||||||
|
</h4>
|
||||||
|
<p class="text-sm text-gray-500">{{ 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>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<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" />
|
||||||
|
<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-lg transition duration-300"
|
||||||
|
:class="[isDarkMode ? 'hover:bg-gray-700' : 'hover:bg-gray-100']"
|
||||||
|
>
|
||||||
|
<EyeIcon
|
||||||
|
class="h-4 w-4"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="$emit('download', record)"
|
||||||
|
class="p-2 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-300"
|
||||||
|
>
|
||||||
|
<DownloadIcon
|
||||||
|
class="h-4 w-4"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="$emit('delete', record)"
|
||||||
|
class="p-2 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-300"
|
||||||
|
>
|
||||||
|
<TrashIcon
|
||||||
|
class="h-4 w-4"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
||||||
|
/>
|
||||||
|
</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>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
<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 { useAlertStore } from '@/stores/alertStore'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
record: Object,
|
||||||
|
isDarkMode: Boolean,
|
||||||
|
baseUrl: String
|
||||||
|
})
|
||||||
|
|
||||||
|
const alertStore = useAlertStore()
|
||||||
|
|
||||||
|
defineEmits(['close', 'show-preview'])
|
||||||
|
|
||||||
|
const copyShareLink = async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(`${props.baseUrl}/retrieve/${props.record.code}`)
|
||||||
|
alertStore.showAlert('链接已复制到剪贴板', 'success')
|
||||||
|
} catch (err) {
|
||||||
|
alertStore.showAlert('复制失败,请手动复制', 'error')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<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>
|
||||||
@@ -12,6 +12,11 @@ const router = createRouter({
|
|||||||
path: '/send',
|
path: '/send',
|
||||||
name: 'Send',
|
name: 'Send',
|
||||||
component: () => import('@/views/SendFileView.vue')
|
component: () => import('@/views/SendFileView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/manage',
|
||||||
|
name: 'Manage',
|
||||||
|
component: () => import('@/views/ManageView.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,960 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="min-h-screen flex flex-col lg:flex-row transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-900' : 'bg-gray-50']"
|
||||||
|
>
|
||||||
|
<!-- Sidebar -->
|
||||||
|
<aside
|
||||||
|
class="fixed inset-y-0 left-0 z-50 w-64 transform transition-all duration-300 ease-in-out lg:relative lg:translate-x-0 border-r"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-800 bg-opacity-90 backdrop-filter backdrop-blur-xl border-gray-700'
|
||||||
|
: 'bg-white border-gray-200',
|
||||||
|
{ '-translate-x-full': !isSidebarOpen }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<!-- Logo区域 -->
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-between h-16 px-4 border-b"
|
||||||
|
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div
|
||||||
|
class="rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"
|
||||||
|
>
|
||||||
|
<div class="rounded-full p-1" :class="[isDarkMode ? 'bg-gray-800' : 'bg-white']">
|
||||||
|
<BoxIcon
|
||||||
|
class="w-6 h-6"
|
||||||
|
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h1
|
||||||
|
class="ml-2 text-xl font-semibold"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
FileCodeBox
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<button @click="toggleSidebar" class="lg:hidden">
|
||||||
|
<XIcon class="w-6 h-6" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 导航菜单 -->
|
||||||
|
<nav class="flex-1 overflow-y-auto">
|
||||||
|
<ul class="p-4 space-y-2">
|
||||||
|
<li v-for="item in menuItems" :key="item.id">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
@click="currentSection = item.id"
|
||||||
|
class="flex items-center p-2 rounded-lg transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
currentSection === item.id
|
||||||
|
? isDarkMode
|
||||||
|
? 'bg-indigo-900 text-indigo-400'
|
||||||
|
: 'bg-indigo-100 text-indigo-600'
|
||||||
|
: isDarkMode
|
||||||
|
? 'text-gray-400 hover:bg-gray-700'
|
||||||
|
: 'text-gray-600 hover:bg-gray-100'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<component :is="item.icon" class="w-5 h-5 mr-3" />
|
||||||
|
{{ item.name }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<!-- Main Content -->
|
||||||
|
<div class="flex-1 flex flex-col min-h-screen">
|
||||||
|
<!-- Header -->
|
||||||
|
<header
|
||||||
|
class="shadow-md border-b transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 border-gray-700' : 'bg-white border-gray-200']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between h-16 px-4">
|
||||||
|
<button @click="toggleSidebar" class="lg:hidden">
|
||||||
|
<MenuIcon class="w-6 h-6" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<main
|
||||||
|
class="flex-1 p-6 overflow-y-auto transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-900' : 'bg-gray-50']"
|
||||||
|
>
|
||||||
|
<div v-if="currentSection === 'dashboard'">
|
||||||
|
<h2
|
||||||
|
class="text-2xl font-bold mb-6"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
仪表盘
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<!-- 统计卡片区域 -->
|
||||||
|
<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"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
总文件数
|
||||||
|
</p>
|
||||||
|
<h3
|
||||||
|
class="text-2xl font-bold mt-1"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
128
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="p-3 rounded-full"
|
||||||
|
:class="[isDarkMode ? 'bg-indigo-900' : 'bg-indigo-100']"
|
||||||
|
>
|
||||||
|
<FileIcon
|
||||||
|
class="w-6 h-6"
|
||||||
|
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm mt-2" :class="[isDarkMode ? 'text-green-400' : 'text-green-600']">
|
||||||
|
<span>↑ 12% </span>
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">较上月</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="p-6 rounded-lg shadow-md transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
存储空间
|
||||||
|
</p>
|
||||||
|
<h3
|
||||||
|
class="text-2xl font-bold mt-1"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
1.2 TB
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="p-3 rounded-full"
|
||||||
|
:class="[isDarkMode ? 'bg-purple-900' : 'bg-purple-100']"
|
||||||
|
>
|
||||||
|
<HardDriveIcon
|
||||||
|
class="w-6 h-6"
|
||||||
|
:class="[isDarkMode ? 'text-purple-400' : 'text-purple-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4 h-2 bg-gray-200 rounded-full overflow-hidden">
|
||||||
|
<div class="h-full bg-purple-500" style="width: 75%"></div>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm mt-2" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
已使用 75%
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="p-6 rounded-lg shadow-md transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
活跃用户
|
||||||
|
</p>
|
||||||
|
<h3
|
||||||
|
class="text-2xl font-bold mt-1"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
25
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="p-3 rounded-full"
|
||||||
|
:class="[isDarkMode ? 'bg-green-900' : 'bg-green-100']"
|
||||||
|
>
|
||||||
|
<UsersIcon
|
||||||
|
class="w-6 h-6"
|
||||||
|
:class="[isDarkMode ? 'text-green-400' : 'text-green-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm mt-2" :class="[isDarkMode ? 'text-red-400' : 'text-red-600']">
|
||||||
|
<span>↓ 5% </span>
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">较上周</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="p-6 rounded-lg shadow-md transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
系统状态
|
||||||
|
</p>
|
||||||
|
<h3
|
||||||
|
class="text-2xl font-bold mt-1"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
正常
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-3 rounded-full" :class="[isDarkMode ? 'bg-blue-900' : 'bg-blue-100']">
|
||||||
|
<ActivityIcon
|
||||||
|
class="w-6 h-6"
|
||||||
|
:class="[isDarkMode ? 'text-blue-400' : 'text-blue-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm mt-2" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
||||||
|
服务器运行时间: 30天
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 最近活动 -->
|
||||||
|
<div
|
||||||
|
class="rounded-lg shadow-md overflow-hidden transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="px-6 py-4 border-b"
|
||||||
|
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
||||||
|
>
|
||||||
|
<h3
|
||||||
|
class="text-lg font-medium"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
最近活动
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div
|
||||||
|
v-for="(activity, index) in recentActivities"
|
||||||
|
:key="index"
|
||||||
|
class="flex items-center space-x-4"
|
||||||
|
>
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<component
|
||||||
|
:is="activity.icon"
|
||||||
|
class="w-5 h-5"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex-1">
|
||||||
|
<p :class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']">
|
||||||
|
{{ activity.description }}
|
||||||
|
</p>
|
||||||
|
<p class="text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']">
|
||||||
|
{{ activity.time }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="currentSection === 'files'">
|
||||||
|
<h2
|
||||||
|
class="text-2xl font-bold mb-6"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
文件管理
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<!-- 添加文件操作栏 -->
|
||||||
|
<div
|
||||||
|
class="mb-6 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between"
|
||||||
|
>
|
||||||
|
<!-- 搜索和过滤 -->
|
||||||
|
<div class="flex flex-1 gap-4">
|
||||||
|
<div class="relative flex-1">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
v-model="fileSearchQuery"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-700 border-gray-600 text-white placeholder-gray-400'
|
||||||
|
: 'bg-white border-gray-300 text-gray-900 placeholder-gray-400'
|
||||||
|
]"
|
||||||
|
class="w-full pl-10 pr-4 py-2 rounded-lg border focus:ring-2 focus:ring-indigo-500 focus:border-transparent"
|
||||||
|
placeholder="搜索文件..."
|
||||||
|
/>
|
||||||
|
<SearchIcon
|
||||||
|
class="absolute left-3 top-2.5 w-5 h-5"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<select
|
||||||
|
v-model="fileTypeFilter"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-700 border-gray-600 text-white'
|
||||||
|
: 'bg-white border-gray-300 text-gray-900'
|
||||||
|
]"
|
||||||
|
class="border rounded-lg px-4 py-2 focus:ring-2 focus:ring-indigo-500 focus:border-transparent"
|
||||||
|
>
|
||||||
|
<option value="">所有类型</option>
|
||||||
|
<option value="PDF">PDF</option>
|
||||||
|
<option value="Image">图片</option>
|
||||||
|
<option value="Video">视频</option>
|
||||||
|
<option value="Document">文档</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 上传按钮 -->
|
||||||
|
<div class="flex gap-4">
|
||||||
|
<button
|
||||||
|
@click="$refs.fileInput.click()"
|
||||||
|
class="flex items-center px-4 py-2 rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
<UploadIcon class="w-5 h-5 mr-2" />
|
||||||
|
上传文件
|
||||||
|
</button>
|
||||||
|
<input
|
||||||
|
ref="fileInput"
|
||||||
|
type="file"
|
||||||
|
multiple
|
||||||
|
class="hidden"
|
||||||
|
@change="handleFileUpload"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 拖拽上传区域 -->
|
||||||
|
<div
|
||||||
|
v-if="showDropZone"
|
||||||
|
class="mb-6 border-2 border-dashed rounded-lg p-8 text-center"
|
||||||
|
:class="[isDarkMode ? 'border-gray-600 bg-gray-800/50' : 'border-gray-300 bg-gray-50']"
|
||||||
|
@drop.prevent="handleFileDrop"
|
||||||
|
@dragover.prevent="showDropZone = true"
|
||||||
|
@dragleave.prevent="showDropZone = false"
|
||||||
|
>
|
||||||
|
<UploadCloudIcon
|
||||||
|
class="mx-auto w-12 h-12 mb-4"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']"
|
||||||
|
/>
|
||||||
|
<p :class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']">拖拽文件到此处上传</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- File List -->
|
||||||
|
<div
|
||||||
|
class="rounded-lg shadow-md overflow-hidden transition-colors duration-300"
|
||||||
|
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white']"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="px-6 py-4 border-b"
|
||||||
|
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
||||||
|
>
|
||||||
|
<h3
|
||||||
|
class="text-lg font-medium"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
所有文件
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table
|
||||||
|
class="min-w-full divide-y"
|
||||||
|
:class="[isDarkMode ? 'divide-gray-700' : 'divide-gray-200']"
|
||||||
|
>
|
||||||
|
<thead :class="[isDarkMode ? 'bg-gray-900' : 'bg-gray-100']">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
v-for="header in fileTableHeaders"
|
||||||
|
:key="header"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']"
|
||||||
|
>
|
||||||
|
{{ header }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-800 divide-y divide-gray-700'
|
||||||
|
: 'bg-white divide-y divide-gray-200'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<tr v-for="file in files" :key="file.id">
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<FileIcon
|
||||||
|
class="w-5 h-5 mr-2"
|
||||||
|
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-500']"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
class="font-medium"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-900']"
|
||||||
|
>
|
||||||
|
{{ file.name }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']">
|
||||||
|
{{ file.size }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']">
|
||||||
|
{{ file.type }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']">
|
||||||
|
{{ file.lastModified }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||||
|
<button
|
||||||
|
@click="downloadFile(file)"
|
||||||
|
class="mr-3 transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'text-indigo-400 hover:text-indigo-300'
|
||||||
|
: 'text-indigo-600 hover:text-indigo-900'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
下载
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="deleteFile(file)"
|
||||||
|
class="transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'text-red-400 hover:text-red-300'
|
||||||
|
: 'text-red-600 hover:text-red-900'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 在文件列表表格下方添加分页组件 -->
|
||||||
|
<div
|
||||||
|
class="mt-4 flex items-center justify-between px-6 py-3 border-t"
|
||||||
|
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
||||||
|
>
|
||||||
|
<!-- 分页信息 -->
|
||||||
|
<div
|
||||||
|
class="flex items-center text-sm"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']"
|
||||||
|
>
|
||||||
|
显示第 {{ (params.page - 1) * params.size + 1 }} 到
|
||||||
|
{{ Math.min(params.page * params.size, params.total) }} 条,共 {{ params.total }} 条
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 分页控制器 -->
|
||||||
|
<div class="flex items-center space-x-2">
|
||||||
|
<!-- 上一页 -->
|
||||||
|
<button
|
||||||
|
@click="handlePageChange(params.page - 1)"
|
||||||
|
:disabled="params.page === 1"
|
||||||
|
class="px-3 py-1 rounded-md transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? params.page === 1
|
||||||
|
? 'bg-gray-700 text-gray-500 cursor-not-allowed'
|
||||||
|
: 'bg-gray-700 text-gray-300 hover:bg-gray-600'
|
||||||
|
: params.page === 1
|
||||||
|
? 'bg-gray-100 text-gray-400 cursor-not-allowed'
|
||||||
|
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
上一页
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- 页码 -->
|
||||||
|
<div class="flex items-center space-x-1">
|
||||||
|
<template v-for="pageNum in displayedPages" :key="pageNum">
|
||||||
|
<button
|
||||||
|
v-if="pageNum !== '...'"
|
||||||
|
@click="handlePageChange(pageNum)"
|
||||||
|
class="px-3 py-1 rounded-md transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
params.page === pageNum
|
||||||
|
? 'bg-indigo-600 text-white'
|
||||||
|
: isDarkMode
|
||||||
|
? 'bg-gray-700 text-gray-300 hover:bg-gray-600'
|
||||||
|
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
{{ pageNum }}
|
||||||
|
</button>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="px-2"
|
||||||
|
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-500']"
|
||||||
|
>
|
||||||
|
...
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 下一页 -->
|
||||||
|
<button
|
||||||
|
@click="handlePageChange(params.page + 1)"
|
||||||
|
:disabled="params.page >= totalPages"
|
||||||
|
class="px-3 py-1 rounded-md transition-colors duration-200"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? params.page >= totalPages
|
||||||
|
? 'bg-gray-700 text-gray-500 cursor-not-allowed'
|
||||||
|
: 'bg-gray-700 text-gray-300 hover:bg-gray-600'
|
||||||
|
: params.page >= totalPages
|
||||||
|
? 'bg-gray-100 text-gray-400 cursor-not-allowed'
|
||||||
|
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
下一页
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="currentSection === 'settings'">
|
||||||
|
<h2
|
||||||
|
class="text-2xl font-bold mb-6"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
系统设置
|
||||||
|
</h2>
|
||||||
|
<div
|
||||||
|
class="rounded-lg shadow-md p-6 transition-colors duration-300"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-800 bg-opacity-70 backdrop-filter backdrop-blur-xl border border-gray-700'
|
||||||
|
: 'bg-white border border-gray-200'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<div class="space-y-6">
|
||||||
|
<div>
|
||||||
|
<h3
|
||||||
|
class="text-lg font-medium mb-2"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
常规设置
|
||||||
|
</h3>
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']">启用通知</span>
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" v-model="settings.notifications" />
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']">自动更新</span>
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" v-model="settings.autoUpdate" />
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h3
|
||||||
|
class="text-lg font-medium mb-2"
|
||||||
|
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||||
|
>
|
||||||
|
安全设置
|
||||||
|
</h3>
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span :class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']"
|
||||||
|
>双因素认证</span
|
||||||
|
>
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" v-model="settings.twoFactor" />
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label
|
||||||
|
for="password"
|
||||||
|
class="block text-sm font-medium mb-1"
|
||||||
|
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']"
|
||||||
|
>
|
||||||
|
更改密码
|
||||||
|
</label>
|
||||||
|
<div class="mt-1 relative rounded-md shadow-sm">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password"
|
||||||
|
v-model="newPassword"
|
||||||
|
class="block w-full pr-10 sm:text-sm rounded-md focus:ring-indigo-500 focus:border-indigo-500"
|
||||||
|
:class="[
|
||||||
|
isDarkMode
|
||||||
|
? 'bg-gray-700 border-gray-600 text-white placeholder-gray-400'
|
||||||
|
: 'border-gray-300 text-gray-900 placeholder-gray-400'
|
||||||
|
]"
|
||||||
|
placeholder="新密码"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
@click="changePassword"
|
||||||
|
class="absolute inset-y-0 right-0 px-3 flex items-center bg-indigo-600 text-white rounded-r-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"
|
||||||
|
>
|
||||||
|
更改
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, inject, onMounted, onUnmounted, computed, watch } from 'vue'
|
||||||
|
import {
|
||||||
|
BoxIcon,
|
||||||
|
MenuIcon,
|
||||||
|
XIcon,
|
||||||
|
FileIcon,
|
||||||
|
FolderIcon,
|
||||||
|
CogIcon,
|
||||||
|
LayoutDashboardIcon,
|
||||||
|
HardDriveIcon,
|
||||||
|
UsersIcon,
|
||||||
|
ActivityIcon,
|
||||||
|
UploadIcon,
|
||||||
|
TrashIcon,
|
||||||
|
UserIcon,
|
||||||
|
SearchIcon,
|
||||||
|
UploadCloudIcon
|
||||||
|
} from 'lucide-vue-next'
|
||||||
|
|
||||||
|
interface MenuItem {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
icon: any
|
||||||
|
}
|
||||||
|
|
||||||
|
interface File {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
size: string
|
||||||
|
type: string
|
||||||
|
lastModified: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Settings {
|
||||||
|
notifications: boolean
|
||||||
|
autoUpdate: boolean
|
||||||
|
twoFactor: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const isDarkMode = inject('isDarkMode')
|
||||||
|
const menuItems: MenuItem[] = [
|
||||||
|
{ id: 'dashboard', name: '仪表盘', icon: LayoutDashboardIcon },
|
||||||
|
{ id: 'files', name: '文件管理', icon: FolderIcon },
|
||||||
|
{ id: 'settings', name: '系统设置', icon: CogIcon }
|
||||||
|
]
|
||||||
|
|
||||||
|
const currentSection = ref('dashboard')
|
||||||
|
const isSidebarOpen = ref(true)
|
||||||
|
const newPassword = ref('')
|
||||||
|
|
||||||
|
const settings = ref<Settings>({
|
||||||
|
notifications: true,
|
||||||
|
autoUpdate: false,
|
||||||
|
twoFactor: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const fileTableHeaders = ['名称', '大小', '类型', '最后修改', '操作']
|
||||||
|
|
||||||
|
const files: File[] = [
|
||||||
|
{ id: 1, name: 'document.pdf', size: '2.5 MB', type: 'PDF', lastModified: '2024-01-15' },
|
||||||
|
{ id: 2, name: 'image.jpg', size: '1.8 MB', type: 'Image', lastModified: '2024-01-14' },
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: 'spreadsheet.xlsx',
|
||||||
|
size: '3.2 MB',
|
||||||
|
type: 'Spreadsheet',
|
||||||
|
lastModified: '2024-01-13'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: 'presentation.pptx',
|
||||||
|
size: '5.1 MB',
|
||||||
|
type: 'Presentation',
|
||||||
|
lastModified: '2024-01-12'
|
||||||
|
},
|
||||||
|
{ id: 5, name: 'video.mp4', size: '15.7 MB', type: 'Video', lastModified: '2024-01-11' }
|
||||||
|
]
|
||||||
|
|
||||||
|
const toggleSidebar = () => {
|
||||||
|
isSidebarOpen.value = !isSidebarOpen.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadFile = (file: File) => {
|
||||||
|
console.log('Downloading file:', file.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteFile = (file: File) => {
|
||||||
|
console.log('Deleting file:', file.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
const changePassword = () => {
|
||||||
|
console.log('Changing password to:', newPassword.value)
|
||||||
|
newPassword.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应式处理
|
||||||
|
const handleResize = () => {
|
||||||
|
if (window.innerWidth >= 1024) {
|
||||||
|
isSidebarOpen.value = true
|
||||||
|
} else {
|
||||||
|
isSidebarOpen.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
handleResize()
|
||||||
|
window.addEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加最近活动数据
|
||||||
|
const recentActivities = [
|
||||||
|
{
|
||||||
|
icon: UploadIcon,
|
||||||
|
description: '张三上传了文件 "项目计划.pdf"',
|
||||||
|
time: '10分钟前'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: UserIcon,
|
||||||
|
description: '新用户李四加入了系统',
|
||||||
|
time: '30分钟前'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: TrashIcon,
|
||||||
|
description: '王五删除了文件 "旧文档.doc"',
|
||||||
|
time: '1小时前'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: FileIcon,
|
||||||
|
description: '系统自动备份完成',
|
||||||
|
time: '2小时前'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 新增的响应式变量
|
||||||
|
const fileSearchQuery = ref('')
|
||||||
|
const fileTypeFilter = ref('')
|
||||||
|
const showDropZone = ref(false)
|
||||||
|
|
||||||
|
const handleFileUpload = (event: Event) => {
|
||||||
|
const files = (event.target as HTMLInputElement).files
|
||||||
|
if (files && files.length > 0) {
|
||||||
|
console.log('Uploading files:', files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFileDrop = (event: Event) => {
|
||||||
|
const files = (event.dataTransfer as DataTransfer).files
|
||||||
|
if (files && files.length > 0) {
|
||||||
|
console.log('Dropped files:', files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页参数
|
||||||
|
const params = ref({
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 计算总页数
|
||||||
|
const totalPages = computed(() => Math.ceil(params.value.total / params.value.size))
|
||||||
|
|
||||||
|
// 计算要显示的页码
|
||||||
|
const displayedPages = computed(() => {
|
||||||
|
const current = params.value.page
|
||||||
|
const total = totalPages.value
|
||||||
|
const delta = 2 // 当前页码前后显示的页码数
|
||||||
|
|
||||||
|
let pages: (number | string)[] = []
|
||||||
|
|
||||||
|
// 始终显示第一页
|
||||||
|
pages.push(1)
|
||||||
|
|
||||||
|
// 计算显示范围
|
||||||
|
let left = Math.max(2, current - delta)
|
||||||
|
let right = Math.min(total - 1, current + delta)
|
||||||
|
|
||||||
|
// 添加省略号和页码
|
||||||
|
if (left > 2) {
|
||||||
|
pages.push('...')
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = left; i <= right; i++) {
|
||||||
|
pages.push(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (right < total - 1) {
|
||||||
|
pages.push('...')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 始终显示最后一页
|
||||||
|
if (total > 1) {
|
||||||
|
pages.push(total)
|
||||||
|
}
|
||||||
|
|
||||||
|
return pages
|
||||||
|
})
|
||||||
|
|
||||||
|
// 页码改变处理函数
|
||||||
|
const handlePageChange = async (page: number) => {
|
||||||
|
if (page < 1 || page > totalPages.value) return
|
||||||
|
params.value.page = page
|
||||||
|
await loadFiles() // 重新加载文件列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载文件列表
|
||||||
|
const loadFiles = async () => {
|
||||||
|
try {
|
||||||
|
// 这里实现实际的API调用
|
||||||
|
// const response = await api.getFiles({
|
||||||
|
// page: params.value.page,
|
||||||
|
// size: params.value.size,
|
||||||
|
// search: fileSearchQuery.value,
|
||||||
|
// type: fileTypeFilter.value
|
||||||
|
// });
|
||||||
|
|
||||||
|
// params.value.total = response.total;
|
||||||
|
// files.value = response.data;
|
||||||
|
|
||||||
|
// 模拟API响应
|
||||||
|
params.value.total = 85 // 示例总数
|
||||||
|
// 更新文件列表数据...
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载文件列表失败:', error)
|
||||||
|
// 处理错误...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听搜索和筛选条件变化
|
||||||
|
watch(
|
||||||
|
[fileSearchQuery, fileTypeFilter],
|
||||||
|
() => {
|
||||||
|
params.value.page = 1 // 重置页码
|
||||||
|
loadFiles()
|
||||||
|
},
|
||||||
|
{ debounce: 300 }
|
||||||
|
)
|
||||||
|
|
||||||
|
// 初始加载
|
||||||
|
onMounted(() => {
|
||||||
|
loadFiles()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 60px;
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: #e5e7eb;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .slider {
|
||||||
|
background-color: #4b5563;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #4f46e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark input:checked + .slider {
|
||||||
|
background-color: #4f46e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
|
height: 26px;
|
||||||
|
width: 26px;
|
||||||
|
left: 4px;
|
||||||
|
bottom: 4px;
|
||||||
|
background-color: white;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .slider:before {
|
||||||
|
background-color: #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-spin-slow {
|
||||||
|
animation: spin 8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transition-colors {
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 300ms;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+88
-407
@@ -11,6 +11,7 @@
|
|||||||
: 'bg-white border-gray-200'
|
: 'bg-white border-gray-200'
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
|
<!-- Logo and Title Section -->
|
||||||
<div class="p-8">
|
<div class="p-8">
|
||||||
<div class="flex justify-center mb-8">
|
<div class="flex justify-center mb-8">
|
||||||
<div
|
<div
|
||||||
@@ -32,61 +33,9 @@
|
|||||||
>
|
>
|
||||||
FileCodeBox
|
FileCodeBox
|
||||||
</h2>
|
</h2>
|
||||||
<form @submit.prevent="handleSubmit">
|
|
||||||
<div class="mb-6 relative">
|
<!-- File Input Form Component -->
|
||||||
<label
|
<FileInputForm :is-dark-mode="isDarkMode" @submit="handleSubmit" />
|
||||||
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 text-white 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 }
|
|
||||||
]"
|
|
||||||
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>
|
|
||||||
</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 relative z-10">
|
|
||||||
<span>{{ inputStatus.loading ? '处理中...' : '提取文件' }}</span>
|
|
||||||
<ArrowRightIcon
|
|
||||||
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>
|
|
||||||
|
|
||||||
<div class="mt-6 text-center">
|
<div class="mt-6 text-center">
|
||||||
<router-link
|
<router-link
|
||||||
@@ -97,6 +46,8 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer Section -->
|
||||||
<div
|
<div
|
||||||
class="px-8 py-4 bg-opacity-50 flex justify-between items-center"
|
class="px-8 py-4 bg-opacity-50 flex justify-between items-center"
|
||||||
:class="[isDarkMode ? 'bg-gray-800' : 'bg-gray-100']"
|
:class="[isDarkMode ? 'bg-gray-800' : 'bg-gray-100']"
|
||||||
@@ -120,302 +71,85 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<transition name="drawer">
|
<!-- History Drawer Component -->
|
||||||
<div
|
<HistoryDrawer
|
||||||
v-if="showDrawer"
|
:show="showDrawer"
|
||||||
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"
|
:records="records"
|
||||||
:class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"
|
:is-dark-mode="isDarkMode"
|
||||||
>
|
@close="toggleDrawer"
|
||||||
<div
|
@view-details="viewDetails"
|
||||||
class="flex justify-between items-center p-6 border-b"
|
@download="downloadRecord"
|
||||||
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
|
@delete="deleteRecord"
|
||||||
>
|
/>
|
||||||
<h3 class="text-2xl font-bold" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
|
||||||
取件记录
|
|
||||||
</h3>
|
|
||||||
<button
|
|
||||||
@click="toggleDrawer"
|
|
||||||
class="hover:text-white transition duration-300"
|
|
||||||
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-800']"
|
|
||||||
>
|
|
||||||
<XIcon class="w-6 h-6" />
|
|
||||||
</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="bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-800 hover:bg-gray-700' : 'bg-gray-100 hover:bg-white']"
|
|
||||||
>
|
|
||||||
<div class="flex-shrink-0 mr-4">
|
|
||||||
<FileIcon
|
|
||||||
class="w-10 h-10"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow min-w-0 mr-4">
|
|
||||||
<p
|
|
||||||
class="font-medium text-lg truncate"
|
|
||||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
|
||||||
>
|
|
||||||
{{ record.filename }}
|
|
||||||
</p>
|
|
||||||
<p
|
|
||||||
class="text-sm truncate"
|
|
||||||
:class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']"
|
|
||||||
>
|
|
||||||
{{ record.date }} · {{ record.size }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 flex space-x-2">
|
|
||||||
<button
|
|
||||||
@click="viewDetails(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="w-5 h-5" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="downloadRecord(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="w-5 h-5" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="deleteRecord(record.id)"
|
|
||||||
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="w-5 h-5" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition-group>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<transition name="fade">
|
<!-- File Details Modal Component -->
|
||||||
<div
|
<FileDetailsModal
|
||||||
v-if="selectedRecord"
|
:record="selectedRecord"
|
||||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
:is-dark-mode="isDarkMode"
|
||||||
>
|
:base-url="baseUrl"
|
||||||
<div
|
@close="selectedRecord = null"
|
||||||
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 bg-opacity-70 overflow-hidden"
|
@show-preview="showContentPreview"
|
||||||
:class="[isDarkMode ? 'bg-gray-800' : 'bg-white']"
|
@download="downloadRecord"
|
||||||
>
|
/>
|
||||||
<h3
|
|
||||||
class="text-2xl font-bold mb-6 truncate"
|
|
||||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
|
||||||
>
|
|
||||||
文件详情
|
|
||||||
</h3>
|
|
||||||
<div class="space-y-4">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<FileIcon
|
|
||||||
class="w-6 h-6 mr-3 flex-shrink-0"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']"
|
|
||||||
class="truncate flex-grow"
|
|
||||||
>
|
|
||||||
<span class="font-medium">文件名:</span>{{ selectedRecord.filename }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<CalendarIcon
|
|
||||||
class="w-6 h-6 mr-3 flex-shrink-0"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']"
|
|
||||||
class="truncate flex-grow"
|
|
||||||
>
|
|
||||||
<span class="font-medium">取件日期:</span>{{ selectedRecord.date }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<HardDriveIcon
|
|
||||||
class="w-6 h-6 mr-3 flex-shrink-0"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']"
|
|
||||||
class="truncate flex-grow"
|
|
||||||
>
|
|
||||||
<span class="font-medium">文件大小:</span>{{ selectedRecord.size }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<DownloadIcon
|
|
||||||
class="w-6 h-6 mr-3"
|
|
||||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
|
||||||
/>
|
|
||||||
<p :class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']">
|
|
||||||
<span class="font-medium">文件内容:</span>
|
|
||||||
</p>
|
|
||||||
<div v-if="selectedRecord.content" class="ml-2">
|
|
||||||
<button
|
|
||||||
@click="showContentPreview"
|
|
||||||
class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"
|
|
||||||
>
|
|
||||||
预览内容
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<a
|
|
||||||
:href="`${baseUrl}${selectedRecord.downloadUrl}`"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"
|
|
||||||
>
|
|
||||||
点击下载
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-6 flex flex-col items-center">
|
<!-- Content Preview Modal Component -->
|
||||||
<h4
|
<ContentPreviewModal
|
||||||
class="text-lg font-semibold mb-3"
|
:show="showPreview"
|
||||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
:content="selectedRecord?.content"
|
||||||
>
|
:is-dark-mode="isDarkMode"
|
||||||
取件二维码
|
@close="showPreview = false"
|
||||||
</h4>
|
/>
|
||||||
<div class="bg-white p-2 rounded-lg shadow-md">
|
|
||||||
<QRCode :value="getQRCodeValue(selectedRecord)" :size="128" level="M" />
|
|
||||||
</div>
|
|
||||||
<p class="mt-2 text-sm" :class="[isDarkMode ? 'text-gray-400' : 'text-gray-600']">
|
|
||||||
扫描二维码快速取件
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="selectedRecord = null"
|
|
||||||
class="mt-8 w-full bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105"
|
|
||||||
>
|
|
||||||
关闭
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<!-- 新增内容预览弹框 -->
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="showPreview"
|
|
||||||
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 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 max-h-[80vh] overflow-y-auto"
|
|
||||||
:class="[isDarkMode ? 'bg-gray-800' : 'bg-white']"
|
|
||||||
>
|
|
||||||
<div class="flex justify-between items-center mb-4">
|
|
||||||
<h3 class="text-2xl font-bold" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
|
||||||
内容预览
|
|
||||||
</h3>
|
|
||||||
<button @click="showPreview = false" class="text-gray-500 hover:text-gray-700">
|
|
||||||
<XIcon class="w-6 h-6" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="prose max-w-none"
|
|
||||||
:class="[isDarkMode ? 'prose-invert' : '']"
|
|
||||||
v-html="renderedContent"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, inject, onMounted, watch, computed } from 'vue'
|
import { ref, inject, onMounted } from 'vue'
|
||||||
import {
|
|
||||||
BoxIcon,
|
|
||||||
EyeIcon,
|
|
||||||
ArrowRightIcon,
|
|
||||||
ShieldCheckIcon,
|
|
||||||
ClipboardListIcon,
|
|
||||||
XIcon,
|
|
||||||
TrashIcon,
|
|
||||||
FileIcon,
|
|
||||||
CalendarIcon,
|
|
||||||
HardDriveIcon,
|
|
||||||
DownloadIcon
|
|
||||||
} from 'lucide-vue-next'
|
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import QRCode from 'qrcode.vue'
|
|
||||||
import { useFileDataStore } from '@/stores/fileData'
|
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
import { useFileDataStore } from '@/stores/fileData'
|
||||||
|
import { useAlertStore } from '@/stores/alertStore'
|
||||||
import api from '@/utils/api'
|
import api from '@/utils/api'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import { marked } from 'marked'
|
import { BoxIcon, ShieldCheckIcon, ClipboardListIcon } from 'lucide-vue-next'
|
||||||
import { useAlertStore } from '@/stores/alertStore'
|
|
||||||
|
|
||||||
|
// Components
|
||||||
|
import FileInputForm from '@/components/retrievew/FileInputForm.vue'
|
||||||
|
import HistoryDrawer from '@/components/retrievew/HistoryDrawer.vue'
|
||||||
|
import FileDetailsModal from '@/components/retrievew/FileDetailsModal.vue'
|
||||||
|
import ContentPreviewModal from '@/components/retrievew/ContentPreviewModal.vue'
|
||||||
|
|
||||||
|
// Store and Router setup
|
||||||
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const fileStore = useFileDataStore()
|
||||||
const alertStore = useAlertStore()
|
const alertStore = useAlertStore()
|
||||||
|
const { receiveData: records } = storeToRefs(fileStore)
|
||||||
|
|
||||||
|
// Inject and Environment Variables
|
||||||
|
const isDarkMode = inject('isDarkMode')
|
||||||
const baseUrl =
|
const baseUrl =
|
||||||
import.meta.env.MODE === 'production'
|
import.meta.env.MODE === 'production'
|
||||||
? import.meta.env.VITE_API_BASE_URL_PROD
|
? import.meta.env.VITE_API_BASE_URL_PROD
|
||||||
: import.meta.env.VITE_API_BASE_URL_DEV
|
: import.meta.env.VITE_API_BASE_URL_DEV
|
||||||
|
|
||||||
const router = useRouter()
|
// Reactive References
|
||||||
const isDarkMode = inject('isDarkMode')
|
|
||||||
const fileStore = useFileDataStore()
|
|
||||||
const { receiveData } = storeToRefs(fileStore)
|
|
||||||
const code = ref('')
|
|
||||||
const inputStatus = ref({
|
|
||||||
readonly: false,
|
|
||||||
loading: false
|
|
||||||
})
|
|
||||||
const isInputFocused = ref(false)
|
|
||||||
const error = ref('')
|
|
||||||
const selectedRecord = ref(null)
|
|
||||||
const showDrawer = ref(false)
|
const showDrawer = ref(false)
|
||||||
const route = useRoute()
|
const selectedRecord = ref(null)
|
||||||
|
const showPreview = ref(false)
|
||||||
// 使用 receiveData 替代原来的 records
|
|
||||||
const records = receiveData
|
|
||||||
|
|
||||||
|
// Lifecycle Hooks
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const query_code = route.query.code
|
const queryCode = route.query.code
|
||||||
if (query_code) {
|
if (queryCode) {
|
||||||
code.value = query_code
|
handleSubmit(queryCode)
|
||||||
}
|
|
||||||
})
|
|
||||||
watch(code, (newVal) => {
|
|
||||||
if (newVal.length === 5) {
|
|
||||||
handleSubmit()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
// Methods
|
||||||
if (code.value.length !== 5) {
|
const handleSubmit = async (code) => {
|
||||||
alertStore.showAlert('请输入5位取件码', 'error')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
inputStatus.value.readonly = true
|
|
||||||
inputStatus.value.loading = true
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.post('/share/select/', {
|
const res = await api.post('/share/select/', { code })
|
||||||
code: code.value
|
|
||||||
})
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.detail) {
|
if (res.detail) {
|
||||||
const isFile = res.detail.text.startsWith('/share/download')
|
const isFile = res.detail.text.startsWith('/share/download')
|
||||||
@@ -429,16 +163,12 @@ const handleSubmit = async () => {
|
|||||||
date: new Date().toLocaleString()
|
date: new Date().toLocaleString()
|
||||||
}
|
}
|
||||||
|
|
||||||
let flag = true
|
// Check if file already exists in history
|
||||||
fileStore.receiveData.forEach((file) => {
|
const exists = fileStore.receiveData.some((file) => file.code === newFileData.code)
|
||||||
if (file.code === newFileData.code) {
|
if (!exists) {
|
||||||
flag = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (flag) {
|
|
||||||
fileStore.addReceiveData(newFileData)
|
fileStore.addReceiveData(newFileData)
|
||||||
}
|
}
|
||||||
|
|
||||||
showDrawer.value = true
|
showDrawer.value = true
|
||||||
alertStore.showAlert('文件获取成功', 'success')
|
alertStore.showAlert('文件获取成功', 'success')
|
||||||
} else {
|
} else {
|
||||||
@@ -450,10 +180,6 @@ const handleSubmit = async () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('取件失败:', err)
|
console.error('取件失败:', err)
|
||||||
alertStore.showAlert('取件失败,请稍后重试', 'error')
|
alertStore.showAlert('取件失败,请稍后重试', 'error')
|
||||||
} finally {
|
|
||||||
inputStatus.value.readonly = false
|
|
||||||
inputStatus.value.loading = false
|
|
||||||
code.value = ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,35 +210,23 @@ const toSend = () => {
|
|||||||
router.push('/send')
|
router.push('/send')
|
||||||
}
|
}
|
||||||
|
|
||||||
const getQRCodeValue = (record) => {
|
|
||||||
return `${baseUrl}${record.downloadUrl}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const downloadRecord = (record) => {
|
const downloadRecord = (record) => {
|
||||||
if (record.downloadUrl) {
|
if (record.downloadUrl) {
|
||||||
// 如果是文件,直接下载
|
// If it's a file, open in new tab for download
|
||||||
window.open(`${baseUrl}${record.downloadUrl}`, '_blank')
|
window.open(`${baseUrl}${record.downloadUrl}`, '_blank')
|
||||||
} else if (record.content) {
|
} else if (record.content) {
|
||||||
// 如果是文本,转成txt下载
|
// If it's text content, download as txt file
|
||||||
const blob = new Blob([record.content], { type: 'text/plain;charset=utf-8' })
|
const blob = new Blob([record.content], { type: 'text/plain;charset=utf-8' })
|
||||||
saveAs(blob, `${record.filename}.txt`)
|
saveAs(blob, `${record.filename}.txt`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showPreview = ref(false)
|
|
||||||
const renderedContent = computed(() => {
|
|
||||||
if (selectedRecord.value && selectedRecord.value.content) {
|
|
||||||
return marked(selectedRecord.value.content)
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const showContentPreview = () => {
|
const showContentPreview = () => {
|
||||||
showPreview.value = true
|
showPreview.value = true
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style>
|
||||||
@keyframes blob {
|
@keyframes blob {
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
@@ -528,23 +242,6 @@ const showContentPreview = () => {
|
|||||||
transform: translate(50px, 50px) scale(1.05);
|
transform: translate(50px, 50px) scale(1.05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (min-width: 640px) {
|
|
||||||
.sm\:w-120 {
|
|
||||||
width: 30rem; /* 480px */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.animate-blob-1 {
|
|
||||||
animation: blob 25s infinite;
|
|
||||||
}
|
|
||||||
.animate-blob-2 {
|
|
||||||
animation: blob 30s infinite;
|
|
||||||
}
|
|
||||||
.animate-blob-3 {
|
|
||||||
animation: blob 35s infinite;
|
|
||||||
}
|
|
||||||
.animate-blob-4 {
|
|
||||||
animation: blob 40s infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
.animate-spin-slow {
|
.animate-spin-slow {
|
||||||
animation: spin 8s linear infinite;
|
animation: spin 8s linear infinite;
|
||||||
@@ -559,58 +256,42 @@ const showContentPreview = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Media Queries */
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
.sm\:w-120 {
|
||||||
|
width: 30rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transitions */
|
||||||
.fade-enter-active,
|
.fade-enter-active,
|
||||||
.fade-leave-active {
|
.fade-leave-active {
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-enter-from,
|
.fade-enter-from,
|
||||||
.fade-leave-to {
|
.fade-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-enter-active,
|
|
||||||
.list-leave-active {
|
|
||||||
transition: all 0.5s ease;
|
|
||||||
}
|
|
||||||
.list-enter-from,
|
|
||||||
.list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(30px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-enter-active,
|
.drawer-enter-active,
|
||||||
.drawer-leave-active {
|
.drawer-leave-active {
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
.drawer-enter-from,
|
|
||||||
.drawer-leave-to {
|
.drawer-leave-to,
|
||||||
|
.drawer-enter-from {
|
||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
}
|
}
|
||||||
.w-97-100 {
|
|
||||||
width: 97%;
|
.list-enter-active,
|
||||||
|
.list-leave-active {
|
||||||
|
transition: all 0.5s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 添加 Markdown 样式 */
|
.list-enter-from,
|
||||||
:deep(.prose) {
|
.list-leave-to {
|
||||||
@apply text-left;
|
opacity: 0;
|
||||||
}
|
transform: translateX(30px);
|
||||||
:deep(.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6) {
|
|
||||||
@apply text-indigo-600 dark:text-indigo-400;
|
|
||||||
}
|
|
||||||
:deep(.prose a) {
|
|
||||||
@apply text-blue-600 dark:text-blue-400;
|
|
||||||
}
|
|
||||||
:deep(.prose code) {
|
|
||||||
@apply bg-gray-100 dark:bg-gray-700 rounded px-1;
|
|
||||||
}
|
|
||||||
:deep(.prose pre) {
|
|
||||||
@apply bg-gray-100 dark:bg-gray-700 rounded p-4 overflow-x-auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 添加新的宽度类 */
|
|
||||||
@media (min-width: 640px) {
|
|
||||||
.sm\:w-120 {
|
|
||||||
width: 30rem; /* 480px */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ import {
|
|||||||
ClipboardCopyIcon
|
ClipboardCopyIcon
|
||||||
} from 'lucide-vue-next'
|
} from 'lucide-vue-next'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import BorderProgressBar from '../components/BorderProgressBar.vue'
|
import BorderProgressBar from '@/components/common/BorderProgressBar.vue'
|
||||||
import QRCode from 'qrcode.vue'
|
import QRCode from 'qrcode.vue'
|
||||||
import SparkMD5 from 'spark-md5'
|
import SparkMD5 from 'spark-md5'
|
||||||
import { useFileDataStore } from '../stores/fileData'
|
import { useFileDataStore } from '../stores/fileData'
|
||||||
|
|||||||
Reference in New Issue
Block a user