|
@@ -0,0 +1,118 @@
|
|
|
+<template>
|
|
|
+ <div class="flex h-screen bg-gradient-to-br from-white to-purple-600">
|
|
|
+ <!-- Sidebar -->
|
|
|
+ <aside class="w-64 bg-[#08002E] text-white flex flex-col">
|
|
|
+ <div class="p-6">
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
+ <div class="w-8 h-8 bg-purple-500 rounded-lg flex items-center justify-center">
|
|
|
+ <PlaySquare class="w-5 h-5" />
|
|
|
+ </div>
|
|
|
+ <span class="text-18px font-bold">门户</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <nav class="flex-1 px-4">
|
|
|
+ <div class="space-y-2">
|
|
|
+ <a href="#/portal" class="flex items-center gap-3 px-3 py-2 text-white rounded-lg hover:bg-[#1A103C]/80">
|
|
|
+ <span>返回门户网站</span>
|
|
|
+ </a>
|
|
|
+ <a href="#/user-story" class="flex items-center gap-3 px-3 py-2 text-white rounded-lg hover:bg-[#1A103C]/80">
|
|
|
+ <span>生成用户故事模块</span>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mt-8 mb-4 text-xs text-white px-3">聊天历史记录</div>
|
|
|
+ <div class="space-y-2">
|
|
|
+ <a v-for="(item, index) in chatHistory"
|
|
|
+ :key="index"
|
|
|
+ href="#"
|
|
|
+ class="flex items-center gap-3 px-3 py-2 text-white rounded-lg hover:bg-[#1A103C]/80">
|
|
|
+ <span>{{ item }}</span>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+ </aside>
|
|
|
+
|
|
|
+ <!-- Main Content -->
|
|
|
+ <main class="flex-1 overflow-auto bg-gradient-to-br from-white to-purple-600">
|
|
|
+ <div class="max-w-4xl mx-auto p-8">
|
|
|
+ <div class="flex justify-between items-center mb-8">
|
|
|
+ <div>
|
|
|
+ <h1 class="text-2xl font-semibold mb-2">用户故事生成</h1>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-white p-6 rounded-lg shadow-sm mb-6">
|
|
|
+ <p class="text-gray-600">在这个区域进行聊天,我可以帮助你生成用户故事。</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex flex-col space-y-4">
|
|
|
+ <div v-for="(message, index) in messages"
|
|
|
+ :key="index"
|
|
|
+ class="flex"
|
|
|
+ :class="{ 'justify-end': message.user === 'user' }">
|
|
|
+ <div class="p-3 rounded-lg"
|
|
|
+ :class="{ 'bg-blue-200': message.user === 'user', 'bg-gray-200': message.user === 'system' }">
|
|
|
+ <p>{{ message.text }}</p>
|
|
|
+ <p v-if="message.file" class="text-sm text-gray-500">上传文件: {{ message.file }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex gap-2 mt-4">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <input
|
|
|
+ v-model="userInput"
|
|
|
+ type="text"
|
|
|
+ placeholder="输入你的消息..."
|
|
|
+ class="w-full p-3 pr-12 border rounded-lg"
|
|
|
+ />
|
|
|
+ <label for="file-upload" class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 cursor-pointer">
|
|
|
+ <Upload class="w-5 h-5" />
|
|
|
+ </label>
|
|
|
+ <input
|
|
|
+ id="file-upload"
|
|
|
+ type="file"
|
|
|
+ class="hidden"
|
|
|
+ @change="handleFileUpload"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <button class="p-3 bg-purple-500 text-white rounded-lg hover:bg-purple-600"
|
|
|
+ @click="sendMessage">
|
|
|
+ <Send class="w-5 h-5" />
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+import { PlaySquare, Upload, Send } from 'lucide-vue-next'
|
|
|
+
|
|
|
+const userInput = ref('')
|
|
|
+const messages = ref([])
|
|
|
+const chatHistory = ref(['会话1', '会话2'])
|
|
|
+
|
|
|
+const sendMessage = () => {
|
|
|
+ if (userInput.value.trim()) {
|
|
|
+ messages.value.push({ user: 'user', text: userInput.value })
|
|
|
+ userInput.value = ''
|
|
|
+ setTimeout(() => {
|
|
|
+ messages.value.push({ user: 'system', text: '这是系统的回复。' })
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleFileUpload = (event) => {
|
|
|
+ const file = event.target.files[0]
|
|
|
+ if (file) {
|
|
|
+ messages.value.push({ user: 'user', text: '上传了文件', file: file.name })
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|