|
@@ -0,0 +1,163 @@
|
|
|
+<template>
|
|
|
+ <div class="flex h-screen bg-gray-50">
|
|
|
+ <!-- Sidebar -->
|
|
|
+ <aside class="w-64 bg-[#08002E] text-white flex flex-col">
|
|
|
+ <!-- Logo -->
|
|
|
+ <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-xl font-semibold">生成用户故事</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Navigation -->
|
|
|
+ <nav class="flex-1 px-4">
|
|
|
+ <div class="mb-8">
|
|
|
+ <div class="flex items-center justify-between mb-4">
|
|
|
+ <span class="text-sm">会话</span>
|
|
|
+ <button class="px-3 py-1 text-xs bg-purple-600 rounded-md hover:bg-purple-700">
|
|
|
+ + 新需求
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="space-y-6">
|
|
|
+ <div class="text-xs text-gray-400 uppercase">管理上下文</div>
|
|
|
+ <div class="space-y-2">
|
|
|
+ <a v-for="(item, index) in menuItems"
|
|
|
+ :key="index"
|
|
|
+ href="#"
|
|
|
+ class="flex items-center gap-3 px-3 py-2 text-gray-300 rounded-lg hover:bg-purple-600/20">
|
|
|
+ <component :is="item.icon" class="w-5 h-5" />
|
|
|
+ {{ item.name }}
|
|
|
+ <span v-if="item.badge"
|
|
|
+ class="ml-auto px-2 py-0.5 text-xs bg-purple-500 rounded-full">
|
|
|
+ {{ item.badge }}
|
|
|
+ </span>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+
|
|
|
+ <!-- User Profile -->
|
|
|
+ <div class="p-4 border-t border-gray-700">
|
|
|
+ <div class="flex items-center gap-3">
|
|
|
+ <div class="w-10 h-10 bg-gray-600 rounded-full"></div>
|
|
|
+ <div>
|
|
|
+ <div class="text-sm font-medium">用户名</div>
|
|
|
+ <div class="text-xs text-gray-400">平台管理员</div>
|
|
|
+ </div>
|
|
|
+ <ChevronRight class="w-4 h-4 ml-auto text-gray-400" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </aside>
|
|
|
+
|
|
|
+ <!-- Main Content -->
|
|
|
+ <main class="flex-1 overflow-auto bg-green-100">
|
|
|
+ <div class="max-w-4xl mx-auto p-8">
|
|
|
+ <!-- Header -->
|
|
|
+ <div class="flex justify-between items-center mb-8">
|
|
|
+ <div>
|
|
|
+ <h1 class="text-2xl font-semibold mb-2">你好, 用户名</h1>
|
|
|
+ <p class="text-gray-600">我是用户故事生成器,我在这里帮助你。</p>
|
|
|
+ </div>
|
|
|
+ <div class="w-64">
|
|
|
+ <select class="w-full p-2 border rounded-lg">
|
|
|
+ <option value="">选择模型</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Content -->
|
|
|
+ <div class="bg-white p-6 rounded-lg shadow-sm mb-6">
|
|
|
+ <p class="text-gray-600 mb-4">
|
|
|
+ 你可以上传相关的文档,这样我可以更好地理解背景并更准确地生成用户故事。
|
|
|
+ </p>
|
|
|
+ <p class="text-gray-600">
|
|
|
+ 你也可以通过对话不断澄清你的请求。
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Chat Messages -->
|
|
|
+ <div class="mb-8">
|
|
|
+ <div v-for="(message, index) in messages"
|
|
|
+ :key="index"
|
|
|
+ class="flex mb-4"
|
|
|
+ :class="{'justify-end': message.sender === 'user'}">
|
|
|
+ <div class="max-w-sm p-3 rounded-lg shadow-sm"
|
|
|
+ :class="{'bg-purple-200': message.sender === 'user', 'bg-gray-200': message.sender === 'bot'}">
|
|
|
+ <p>{{ message.text }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Chat Input -->
|
|
|
+ <div class="flex gap-2">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <input
|
|
|
+ v-model="inputMessage"
|
|
|
+ type="text"
|
|
|
+ placeholder="与用户故事生成器对话..."
|
|
|
+ class="w-full p-3 pr-12 border rounded-lg"
|
|
|
+ @keyup.enter="sendMessage"
|
|
|
+ />
|
|
|
+ <Upload class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-400" />
|
|
|
+ </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 {
|
|
|
+ PlaySquare,
|
|
|
+ ChevronRight,
|
|
|
+ Upload,
|
|
|
+ Send,
|
|
|
+ Home,
|
|
|
+ Briefcase,
|
|
|
+ Book,
|
|
|
+ MessageSquare,
|
|
|
+ Link,
|
|
|
+ User,
|
|
|
+ Bell
|
|
|
+} from 'lucide-vue-next'
|
|
|
+
|
|
|
+const menuItems = [
|
|
|
+ { name: '首页', icon: Home },
|
|
|
+ { name: '工作区', icon: Briefcase },
|
|
|
+ { name: '知识', icon: Book },
|
|
|
+ { name: '提示', icon: MessageSquare },
|
|
|
+ { name: '链接', icon: Link },
|
|
|
+ { name: '用户', icon: User },
|
|
|
+ { name: '通知', icon: Bell, badge: '0' },
|
|
|
+]
|
|
|
+
|
|
|
+const messages = [
|
|
|
+ { sender: 'bot', text: '欢迎使用用户故事生成器!请告诉我你的需求。' }
|
|
|
+]
|
|
|
+
|
|
|
+let inputMessage = ''
|
|
|
+
|
|
|
+const sendMessage = () => {
|
|
|
+ if (inputMessage.trim()) {
|
|
|
+ messages.push({ sender: 'user', text: inputMessage })
|
|
|
+ inputMessage = ''
|
|
|
+ // Simulate bot response
|
|
|
+ setTimeout(() => {
|
|
|
+ messages.push({ sender: 'bot', text: '好的,我将开始生成用户故事。' })
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* Additional styles can be added here if needed */
|
|
|
+</style>
|