完成大模型的输入传输

This commit is contained in:
锦恢 2025-04-07 02:08:44 +08:00
parent 7330889290
commit f5a0d75414

View File

@ -16,10 +16,10 @@
<div v-if="isLoading" class="message-item assistant"> <div v-if="isLoading" class="message-item assistant">
<div class="message-avatar"> <div class="message-avatar">
<el-avatar :icon="Comment" /> <span class="iconfont icon-chat"></span>
</div> </div>
<div class="message-content"> <div class="message-content">
<div class="message-role">AI</div> <div class="message-role">Agent</div>
<div class="message-text">{{ streamingContent }}<span class="typing-cursor">|</span></div> <div class="message-text">{{ streamingContent }}<span class="typing-cursor">|</span></div>
</div> </div>
</div> </div>
@ -35,7 +35,11 @@
placeholder="输入消息..." @keydown.enter="handleKeydown" resize="none" placeholder="输入消息..." @keydown.enter="handleKeydown" resize="none"
class="chat-input" /> class="chat-input" />
<el-button type="primary" :loading="isLoading" @click="handleSend" class="send-button" <el-button
type="primary"
:loading="isLoading"
@click="handleSend"
class="send-button"
:disabled="!userInput.trim()"> :disabled="!userInput.trim()">
<span class="iconfont icon-send"></span> <span class="iconfont icon-send"></span>
</el-button> </el-button>
@ -48,7 +52,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, defineComponent, defineProps, onUnmounted, computed } from 'vue'; import { ref, onMounted, defineComponent, defineProps, onUnmounted, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { Comment } from '@element-plus/icons-vue';
import { useMessageBridge } from "@/api/message-bridge"; import { useMessageBridge } from "@/api/message-bridge";
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { tabs } from '../panel'; import { tabs } from '../panel';
@ -296,9 +299,9 @@ onUnmounted(() => {
} }
.send-button { .send-button {
position: absolute; position: absolute !important;
right: 8px; right: 8px !important;
bottom: 8px; bottom: 8px !important;
height: auto; height: auto;
padding: 8px 12px; padding: 8px 12px;
font-size: 20px; font-size: 20px;