feat: 对话功能开发

This commit is contained in:
2026-04-12 11:47:48 +08:00
parent d6491ecba4
commit 6ca081afa8
4 changed files with 143 additions and 12 deletions

View File

@@ -3,8 +3,22 @@ import { ref, computed } from 'vue';
import { sseManager } from '@/http/sse.js';
export const useAppStore = defineStore('app', () => {
// 服务运行状态常量
const SERVICE_STATUS = {
IDLE: 'idle', // 未启动
CONNECTING: 'connecting', // 连接中
RUNNING: 'running', // 服务运行中
FAILED: 'failed', // 连接失败
};
const title = ref('智聚超脑');
const collapsed = ref(false);
const serviceStatus = ref(SERVICE_STATUS.IDLE);
const startServiceFlag = ref(0); // 用于触发外部启动服务的标记
function triggerStartService() {
startServiceFlag.value++;
}
// SSE 相关状态
const sseConnected = ref(false);
@@ -134,5 +148,10 @@ export const useAppStore = defineStore('app', () => {
isAssistantMessage,
addAssistantMessageId,
clearAssistantMessageIds,
// 服务运行状态
serviceStatus,
SERVICE_STATUS,
startServiceFlag,
triggerStartService,
};
});