feat: 完善对话功能,自动设置默认模型账户并优化界面布局
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<div class="flex flex-col h-full py-6 px-6 overflow-hidden">
|
||||
<div class="flex flex-col flex-1 py-6 px-6 overflow-hidden">
|
||||
<!-- 空状态 -->
|
||||
<template v-if="isEmpty">
|
||||
<ChatEmpty @click-tag="onQuickTag">
|
||||
<template #task-center>
|
||||
<TaskCenter />
|
||||
</template>
|
||||
</ChatEmpty>
|
||||
<ChatEmpty @click-tag="onQuickTag" />
|
||||
</template>
|
||||
|
||||
<!-- 消息列表 -->
|
||||
@@ -35,11 +31,6 @@
|
||||
|
||||
<!-- 输入区 -->
|
||||
<div class="flex flex-col gap-3 mt-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="inline-flex items-center justify-center w-[108px] px-3 py-1.5 rounded-2xl border border-[#E5E8EE] text-[13px] text-[#333] cursor-pointer hover:bg-[#2B7FFF] hover:text-[#fff] hover:border-[#2B7FFF]">
|
||||
智能问数
|
||||
</div>
|
||||
</div>
|
||||
<ChatInput
|
||||
v-model="inputMessage"
|
||||
:is-sending="chatStore.sending"
|
||||
@@ -69,7 +60,6 @@ import ChatEmpty from './components/chat/ChatEmpty.vue'
|
||||
import ChatErrorBar from './components/chat/ChatErrorBar.vue'
|
||||
import ChatTypingIndicator from './components/chat/ChatTypingIndicator.vue'
|
||||
import ChatActivityIndicator from './components/chat/ChatActivityIndicator.vue'
|
||||
import TaskCenter from './TaskCenter.vue'
|
||||
|
||||
const chatStore = useChatStore()
|
||||
const inputMessage = ref('')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="h-full">
|
||||
<aside :class="['h-full box-border flex flex-col transition-all duration-300', sidebarCollapsed ? 'w-16' : 'w-50']">
|
||||
<div :class="['h-full transition-all duration-300', sidebarCollapsed ? 'w-16' : 'w-50']">
|
||||
<aside class="h-full box-border flex flex-col w-full">
|
||||
<div class="flex items-center justify-center m-2">
|
||||
<img v-if="!sidebarCollapsed" class="w-10 h-10 rounded-md" src="@assets/images/login/white_logo.png" />
|
||||
<div v-if="!sidebarCollapsed" class="font-bold text-gray-80">YINIAN</div>
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<div class="flex-1 pb-6">
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<div class="pl-6 pr-6 pb-6">
|
||||
<div class="flex justify-between items-center pb-4">
|
||||
<h3 class="text-base font-semibold">任务中心</h3>
|
||||
<!-- <a class="text-[#3b82f6] text-[13px] cursor-pointer">
|
||||
编辑
|
||||
</a> -->
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 max-[800px]:grid-cols-1">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-auto">
|
||||
<slot name="task-center" />
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<!-- Markdown text -->
|
||||
<div
|
||||
v-if="markdownHtml"
|
||||
class="bg-[#f7f9fc] rounded-md px-3 py-2 prose prose-sm max-w-none"
|
||||
class="bg-[#f7f9fc] rounded-md px-3 py-2 prose prose-sm"
|
||||
v-html="markdownHtml"
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<layout>
|
||||
<div class="flex h-full w-full flex-col md:flex-row">
|
||||
<ChatHistory class="flex-none w-50" @new-chat="handleNewChat" @select-chat="handleSelectChat" />
|
||||
<div class="flex-1 mr-2 overflow-hidden bg-white rounded-xl">
|
||||
<ChatBox />
|
||||
<ChatHistory class="flex-none" @new-chat="handleNewChat" @select-chat="handleSelectChat" />
|
||||
<div class="flex-1 mr-2 overflow-hidden bg-white rounded-xl flex flex-col">
|
||||
<ChatBox class="flex-1" />
|
||||
<TaskCenter />
|
||||
</div>
|
||||
<TaskList />
|
||||
</div>
|
||||
@@ -18,20 +19,23 @@ import TaskList from '@src/components/TaskList/index.vue'
|
||||
import TaskOperationDialog from './components/TaskOperationDialog.vue'
|
||||
import ChatHistory from './ChatHistory.vue'
|
||||
import ChatBox from './ChatBox.vue'
|
||||
import TaskCenter from './TaskCenter.vue'
|
||||
import { useChatStore } from '@store/chat'
|
||||
import { useProviderStore } from '@store/providers'
|
||||
import emitter from '@src/utils/emitter'
|
||||
|
||||
const chatStore = useChatStore()
|
||||
const providerStore = useProviderStore()
|
||||
const taskOperationDialog = ref()
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await providerStore.init()
|
||||
chatStore.loadSessions()
|
||||
chatStore.initConnection()
|
||||
chatStore.subscribeToGateway()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
chatStore.cleanupEmptySession()
|
||||
chatStore.closeConnection()
|
||||
})
|
||||
|
||||
const handleNewChat = () => {
|
||||
|
||||
Reference in New Issue
Block a user