mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-07 02:01:37 +00:00
refactor(chat): extract chat page into separate components
将AI聊天页面拆分为独立的组件模块,包括侧边栏、导航栏、消息列表和输入框,提升代码可维护性
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, nextTick, watch } from "vue";
|
import { ref, nextTick, watch } from "vue";
|
||||||
import WelcomeScreen from "./FaWelcomeScreen.vue";
|
import WelcomeScreen from "./FaWelcomeScreen.vue";
|
||||||
|
import FaMessageItem from "./FaMessageItem.vue";
|
||||||
import type { ChatMessage } from "../types";
|
import type { ChatMessage } from "../types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|||||||
import AiChatAPI, { ChatSession } from "@/api/module_ai/chat";
|
import AiChatAPI, { ChatSession } from "@/api/module_ai/chat";
|
||||||
import { Auth } from "@utils/auth";
|
import { Auth } from "@utils/auth";
|
||||||
import type { ChatMessage, UploadedFile } from "./types";
|
import type { ChatMessage, UploadedFile } from "./types";
|
||||||
|
import FaSidebar from "./components/FaSidebar.vue";
|
||||||
|
import FaChatNavbar from "./components/FaChatNavbar.vue";
|
||||||
|
import FaChatMessages from "./components/FaChatMessages.vue";
|
||||||
|
import FaChatInput from "./components/FaChatInput.vue";
|
||||||
|
|
||||||
// 状态
|
// 状态
|
||||||
const messages = ref<ChatMessage[]>([]);
|
const messages = ref<ChatMessage[]>([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user