Selaa lähdekoodia

zbytest003-2025-02-18 08:20:59

genlitex 2 kuukautta sitten
vanhempi
sitoutus
74e4b0761b

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4 - 0
dist/assets/index-CPiTYkM3.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/assets/index-Ccyppf37.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 4
dist/assets/index-malWbV8K.js


+ 2 - 2
dist/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>Prototype Design</title>
-    <script type="module" crossorigin src="/prototype/3000/assets/index-malWbV8K.js"></script>
-    <link rel="stylesheet" crossorigin href="/prototype/3000/assets/index-Btspm7_H.css">
+    <script type="module" crossorigin src="/ide/proxy/6003/assets/index-CPiTYkM3.js"></script>
+    <link rel="stylesheet" crossorigin href="/ide/proxy/6003/assets/index-Ccyppf37.css">
   </head>
   <body>
     <div id="app"></div>

+ 77 - 0
src/assets/chat-style.css

@@ -0,0 +1,77 @@
+/* Chat Interface Styles */
+.chat-container {
+  display: flex;
+  height: 100vh;
+}
+
+.sidebar {
+  width: 15%;
+  background-color: purple;
+  color: white;
+  padding: 10px;
+}
+
+.main-content {
+  flex-grow: 1;
+  display: flex;
+  flex-direction: column;
+}
+
+.chat-header {
+  background: linear-gradient(to right, #ff6b6b, #eb3349);
+  padding: 10px;
+  color: white;
+}
+
+.message-area {
+  flex-grow: 1;
+  padding: 10px;
+  overflow-y: scroll;
+}
+
+.user-message {
+  background-color: green;
+  color: white;
+  border-radius: 5px;
+  margin-bottom: 5px;
+  padding: 5px;
+}
+
+.bot-message {
+  background-color: lightgray;
+  color: black;
+  border-radius: 5px;
+  margin-bottom: 5px;
+  padding: 5px;
+}
+
+.input-area {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+}
+
+.input-area input {
+  flex-grow: 1;
+  border-radius: 5px;
+  padding: 5px;
+  margin-right: 10px;
+}
+
+.input-area button {
+  background-color: blue;
+  color: white;
+  border: none;
+  border-radius: 5px;
+  padding: 5px 10px;
+  cursor: pointer;
+  transition: background-color 0.3s ease;
+}
+
+.input-area button:hover {
+  background-color: darkblue;
+}
+
+.input-area input[type="file"] {
+  display: none;
+}

BIN
src/assets/img/a.png


+ 6 - 0
src/router/index.js

@@ -1,11 +1,17 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import HomeView from '../views/HomeView.vue'
+import ChatView from '../views/ChatView.vue'
 
 const routes = [
   {
     path: '/',
     name: 'home',
     component: HomeView
+  },
+  {
+    path: '/chat',
+    name: 'chat',
+    component: ChatView
   }
 ]
 

+ 137 - 0
src/views/ChatView.vue

@@ -0,0 +1,137 @@
+<template>
+  <div class="chat-container">
+    <div class="sidebar">
+      <h2>需求</h2>
+      <ul>
+        <li v-for="(item, index) in demandList" :key="index">
+          <span @click="viewDetail(item.id)">{{ item.name }}<i class="fas fa-eye"></i></span>
+        </li>
+      </ul>
+    </div>
+    <div class="main-content">
+      <div class="chat-header">聊天界面</div>
+      <div class="message-area">
+        <div v-for="(message, index) in messages" :key="index" :class="{ 'user-message': message.fromUser, 'bot-message': !message.fromUser }">
+          {{ message.text }}
+        </div>
+      </div>
+      <div class="input-area">
+        <input v-model="userInput" placeholder="在此输入消息...">
+        <button @click="sendMessage">发送</button>
+        <input type="file" @change="handleFileUpload">
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { ref } from 'vue';
+export default {
+  setup() {
+    const demandList = ref([
+      { id: 1, name: '需求1' },
+      { id: 2, name: '需求2' }
+    ]);
+    const messages = ref([]);
+    const userInput = ref('');
+    const sendMessage = () => {
+      messages.value.push({ fromUser: true, text: userInput.value });
+      messages.value.push({ fromUser: false, text: '正在建设中...' });
+      userInput.value = '';
+    };
+    const handleFileUpload = (event) => {
+      // Handle file upload logic
+    };
+    const viewDetail = (id) => {
+      // Logic for viewing demand detail
+    };
+    return {
+      demandList,
+      messages,
+      userInput,
+      sendMessage,
+      handleFileUpload,
+      viewDetail
+    };
+  }
+};
+</script>
+
+<style scoped>
+.chat-container {
+  display: flex;
+  height: 100vh;
+}
+
+.sidebar {
+  width: 15%;
+  background-color: purple;
+  color: white;
+  padding: 10px;
+}
+
+.main-content {
+  flex-grow: 1;
+  display: flex;
+  flex-direction: column;
+}
+
+.chat-header {
+  background: linear-gradient(to right, #ff6b6b, #eb3349);
+  padding: 10px;
+  color: white;
+}
+
+.message-area {
+  flex-grow: 1;
+  padding: 10px;
+  overflow-y: scroll;
+}
+
+.user-message {
+  background-color: green;
+  color: white;
+  border-radius: 5px;
+  margin-bottom: 5px;
+  padding: 5px;
+}
+
+.bot-message {
+  background-color: lightgray;
+  color: black;
+  border-radius: 5px;
+  margin-bottom: 5px;
+  padding: 5px;
+}
+
+.input-area {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+}
+
+.input-area input {
+  flex-grow: 1;
+  border-radius: 5px;
+  padding: 5px;
+  margin-right: 10px;
+}
+
+.input-area button {
+  background-color: blue;
+  color: white;
+  border: none;
+  border-radius: 5px;
+  padding: 5px 10px;
+  cursor: pointer;
+  transition: background-color 0.3s ease;
+}
+
+.input-area button:hover {
+  background-color: darkblue;
+}
+
+.input-area input[type="file"] {
+  display: none;
+}
+</style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä