Browse Source

hunk-2025-04-24 01:12:10

genlitex 3 weeks ago
parent
commit
043ca33017
6 changed files with 726 additions and 130 deletions
  1. 4 0
      dist/assets/index-BPeSp-1C.js
  2. 0 0
      dist/assets/index-bFp1Fx53.css
  3. 14 0
      dist/index.html
  4. 544 130
      package-lock.json
  5. 6 0
      src/router/index.js
  6. 158 0
      src/views/ChatbotView.vue

File diff suppressed because it is too large
+ 4 - 0
dist/assets/index-BPeSp-1C.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-bFp1Fx53.css


+ 14 - 0
dist/index.html

@@ -0,0 +1,14 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Vite + Vue</title>
+    <script type="module" crossorigin src="/ide/proxy/6005/assets/index-BPeSp-1C.js"></script>
+    <link rel="stylesheet" crossorigin href="/ide/proxy/6005/assets/index-bFp1Fx53.css">
+  </head>
+  <body>
+    <div id="app"></div>
+  </body>
+</html>

File diff suppressed because it is too large
+ 544 - 130
package-lock.json


+ 6 - 0
src/router/index.js

@@ -1,5 +1,6 @@
 import { createRouter, createWebHistory } from 'vue-router'
 import HomeView from '../views/HomeView.vue'
+import ChatbotView from '../views/ChatbotView.vue'
 import MinimalistView from '../assets/templates/ui-standard/MinimalistView.vue'
 import DarkModeView from '../assets/templates/ui-standard/DarkModeView.vue'
 import RetroView from '../assets/templates/ui-standard/RetroView.vue'
@@ -157,6 +158,11 @@ const routes = [
     name: 'Futuristic',
     component: FuturisticView
   },
+  {
+    path: '/chatbot',
+    name: 'Chatbot',
+    component: ChatbotView
+  },
   {
     path: '/:pathMatch(.*)*',
     redirect: '/'

+ 158 - 0
src/views/ChatbotView.vue

@@ -0,0 +1,158 @@
+<template>
+  <div class="min-h-screen bg-gray-100 dark:bg-gray-900 flex flex-col">
+    <!-- Header Section -->
+    <header class="bg-white dark:bg-gray-800 shadow">
+      <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex justify-between items-center">
+        <div class="flex items-center">
+          <!-- Company Logo -->
+          <svg class="h-8 w-8 mr-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <circle cx="12" cy="12" r="10"></circle>
+            <line x1="12" y1="8" x2="12" y2="12"></line>
+            <line x1="12" y1="16" x2="12" y2="16"></line>
+          </svg>
+          <h1 class="text-2xl font-bold text-gray-900 dark:text-white">公司名称</h1>
+        </div>
+        <div class="flex space-x-4 items-center">
+          <!-- Language Selection Dropdown -->
+          <select v-model="language" class="rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
+            <option value="en">English</option>
+            <option value="es">Español</option>
+            <option value="zh">中文</option>
+          </select>
+          <!-- User Authentication Status -->
+          <span class="text-gray-700 dark:text-gray-300">{{ isAuthenticated ? 'Logged In' : 'Guest' }}</span>
+        </div>
+      </div>
+    </header>
+
+    <!-- Main Chat Interface -->
+    <main class="flex-grow flex relative">
+      <div class="w-full max-w-4xl mx-auto p-4">
+        <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 relative">
+          <div class="chat-window overflow-y-scroll max-h-96 mb-4">
+            <div v-for="(message, index) in messages" :key="index" class="mb-4">
+              <div v-if="message.type === 'user'" class="flex justify-end">
+                <div class="bg-blue-100 dark:bg-gray-700 p-3 rounded-l-lg rounded-tr-lg text-right">
+                  {{ message.text }}
+                </div>
+              </div>
+              <div v-else class="flex justify-start">
+                <div class="bg-gray-100 dark:bg-gray-700 p-3 rounded-r-lg rounded-tl-lg text-left">
+                  {{ message.text }}
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="flex items-center">
+            <input v-model="userInput" @keyup.enter="sendMessage" class="w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white mr-2" placeholder="Type your message...">
+            <button @click="sendMessage" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700">
+              Send
+            </button>
+          </div>
+          <div class="mt-2">
+            <p v-if="suggestions.length" class="text-gray-700 dark:text-gray-300">Suggestions:</p>
+            <ul>
+              <li v-for="(suggestion, index) in suggestions" :key="index" class="cursor-pointer text-blue-600 dark:text-blue-400" @click="sendSuggestion(suggestion)">
+                {{ suggestion }}
+              </li>
+            </ul>
+          </div>
+          <div class="mt-4">
+            <button @click="escalateIssue" class="bg-red-600 text-white px-4 py-2 rounded-md hover:bg-red-700">
+              Escalate Issue
+            </button>
+          </div>
+        </div>
+      </div>
+    </main>
+
+    <!-- Sidebar Section -->
+    <aside class="hidden lg:block w-64 bg-white dark:bg-gray-800 shadow">
+      <div class="p-4">
+        <h2 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Knowledge Base</h2>
+        <ul class="space-y-2">
+          <li v-for="(category, index) in knowledgeBaseCategories" :key="index" class="text-gray-700 dark:text-gray-300">
+            <strong>{{ category.title }}:</strong>
+            <ul class="ml-4 list-disc">
+              <li v-for="(article, idx) in category.articles" :key="idx" class="cursor-pointer text-blue-600 dark:text-blue-400" @click="openArticle(article)">
+                {{ article.title }}
+              </li>
+            </ul>
+          </li>
+        </ul>
+        <button @click="toggleLanguage" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700">
+          Toggle Language
+        </button>
+      </div>
+    </aside>
+
+    <!-- Footer Section -->
+    <footer class="bg-white dark:bg-gray-800 shadow">
+      <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 text-center">
+        <p class="text-gray-700 dark:text-gray-300">Status: Online</p>
+        <p class="text-gray-700 dark:text-gray-300">Contact IT Support: support@company.com</p>
+        <p class="text-gray-700 dark:text-gray-300">Version 1.0.0 © 2025 Company Name</p>
+      </div>
+    </footer>
+  </div>
+</template>
+
+<script setup>
+import { ref, computed } from 'vue'
+
+// State Variables
+const userInput = ref('')
+const messages = ref([])
+const language = ref('en')
+const isAuthenticated = ref(false)
+const suggestions = ref([
+  'How to reset a password?',
+  'How to set up VPN access?',
+  'How to install software?'
+])
+const knowledgeBaseCategories = ref([
+  {
+    title: 'Password Management',
+    articles: [
+      { title: 'Reset Password Guide', link: '#' },
+      { title: 'Change Password Policy', link: '#' }
+    ]
+  },
+  {
+    title: 'Software Installation',
+    articles: [
+      { title: 'Install Software Guide', link: '#' },
+      { title: 'Troubleshoot Installation Issues', link: '#' }
+    ]
+  }
+])
+
+// Methods
+const sendMessage = () => {
+  if (userInput.value.trim()) {
+    messages.value.push({ type: 'user', text: userInput.value })
+    // Simulate bot response
+    setTimeout(() => {
+      messages.value.push({ type: 'bot', text: 'Here is your answer...' })
+    }, 1000)
+    userInput.value = ''
+  }
+}
+
+const sendSuggestion = (suggestion) => {
+  userInput.value = suggestion
+  sendMessage()
+}
+
+const escalateIssue = () => {
+  alert('Escalating issue to IT support team...')
+}
+
+const openArticle = (article) => {
+  alert(`Opening article: ${article.title}`)
+}
+
+const toggleLanguage = () => {
+  language.value = language.value === 'en' ? 'es' : language.value === 'es' ? 'zh' : 'en'
+}
+</script>

Some files were not shown because too many files changed in this diff