|
@@ -0,0 +1,89 @@
|
|
|
+<template>
|
|
|
+ <div class="min-h-screen flex bg-gradient-to-r from-white to-purple-600">
|
|
|
+ <!-- Left Sidebar -->
|
|
|
+ <aside class="w-64 bg-gradient-to-r from-white to-purple-600 text-white flex flex-col">
|
|
|
+ <div class="p-6">
|
|
|
+ <h1 class="text-xl font-semibold">聊天历史记录</h1>
|
|
|
+ </div>
|
|
|
+ <nav class="flex-1 px-4">
|
|
|
+ <div class="space-y-2">
|
|
|
+ <div v-for="(message, index) in chatHistory" :key="index" class="flex items-center gap-3 px-3 py-2 text-gray-300 rounded-lg hover:bg-white/20">
|
|
|
+ <div class="w-8 h-8 bg-gray-600 rounded-full flex items-center justify-center">
|
|
|
+ <UserIcon class="w-5 h-5 text-white" />
|
|
|
+ </div>
|
|
|
+ <span>{{ message.timestamp }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+ </aside>
|
|
|
+
|
|
|
+ <!-- Main Content -->
|
|
|
+ <main class="flex-1 p-6 overflow-y-auto">
|
|
|
+ <div class="max-w-4xl mx-auto">
|
|
|
+ <!-- Chat Content -->
|
|
|
+ <div class="bg-white p-6 rounded-lg shadow-sm mb-6">
|
|
|
+ <div v-for="(message, index) in chatHistory" :key="index" class="mb-4">
|
|
|
+ <div v-if="message.sender === 'user'" class="flex justify-end">
|
|
|
+ <div class="max-w-sm p-3 rounded-lg bg-purple-600 text-white">
|
|
|
+ {{ message.content }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="flex justify-start">
|
|
|
+ <div class="max-w-sm p-3 rounded-lg bg-gray-200 text-gray-900">
|
|
|
+ {{ message.content }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Chat Input -->
|
|
|
+ <div class="flex gap-2">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ v-model="newMessage"
|
|
|
+ placeholder="Type a message..."
|
|
|
+ class="w-full p-3 pr-12 border rounded-lg"
|
|
|
+ />
|
|
|
+ <UploadIcon class="absolute right-10 top-1/2 -translate-y-1/2 text-gray-400 cursor-pointer" @click="uploadFile" />
|
|
|
+ </div>
|
|
|
+ <button class="p-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700" @click="sendMessage">
|
|
|
+ <SendIcon class="w-5 h-5" />
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+import { User as UserIcon, Upload as UploadIcon, Send as SendIcon } from 'lucide-vue-next'
|
|
|
+
|
|
|
+const chatHistory = ref([
|
|
|
+ { sender: 'user', content: 'Hello!', timestamp: '10:00 AM' },
|
|
|
+ { sender: 'bot', content: 'Hi there! How can I assist you today?', timestamp: '10:01 AM' }
|
|
|
+])
|
|
|
+
|
|
|
+const newMessage = ref('')
|
|
|
+
|
|
|
+const sendMessage = () => {
|
|
|
+ if (newMessage.value.trim()) {
|
|
|
+ chatHistory.value.push({ sender: 'user', content: newMessage.value, timestamp: new Date().toLocaleTimeString() })
|
|
|
+ newMessage.value = ''
|
|
|
+ // Simulate bot response
|
|
|
+ setTimeout(() => {
|
|
|
+ chatHistory.value.push({ sender: 'bot', content: 'Thank you for your message.', timestamp: new Date().toLocaleTimeString() })
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const uploadFile = () => {
|
|
|
+ // Handle file upload logic here
|
|
|
+ alert('File upload functionality is not implemented yet.')
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* Additional styles can be added here if needed */
|
|
|
+</style>
|