From 446e503a51c904c9330fbd60043468e02a2e6b57 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期四, 03 四月 2025 16:27:34 +0800
Subject: [PATCH] sidebarIsShow

---
 src/layout/component/header/Header.vue |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/layout/component/header/Header.vue b/src/layout/component/header/Header.vue
index f0f7c8f..adfe5f8 100644
--- a/src/layout/component/header/Header.vue
+++ b/src/layout/component/header/Header.vue
@@ -1,8 +1,8 @@
 <template>
-	<div class="top_text flex justify-between px-6 items-center" :class="sidebarIsShow ? 'px-6' : 'pl-[unset] pr-6'">
-		<div class="flex-items-center">
+	<div class="top_text flex justify-between px-6 items-center pl-[unset] pr-6">
+		<div class="flex-items-center h-full">
 			<div class="nav-menu">
-				<router-link :to="{ path: '/ask_answer', query: { id: activeRoomId } }" class="nav-item" active-class="active">
+				<router-link :to="firstToPath" class="nav-item" active-class="active">
 					<i class="icon-park-outline-robot"></i>
 					鏅鸿兘鍔╂墜
 				</router-link>
@@ -34,7 +34,7 @@
 			</template>
 		</el-dialog>
 	</div>
-	<div class="notice" v-if="!isSharePage">
+	<div class="notice " v-if="!isSharePage">
 		<el-badge :value="`${state.announcementList.length}`" :hidden="announcementIsRead || state.announcementList?.length === 0">
 			<el-button link size="small" icon="ele-Message" class="set-notice" @click="handleAnnouncementClick">绯荤粺鍏憡</el-button>
 		</el-badge>
@@ -65,7 +65,7 @@
 import { systemNotifyList } from '/@/api/ai/chat';
 import router from '/@/router';
 import pinia from '/@/stores';
-import { activeRoomId, isSharePage, newChatRoomClick } from '/@/stores/chatRoom';
+import { activeChatRoom, activeRoomId, isSharePage, newChatRoomClick } from '/@/stores/chatRoom';
 import { useThemeConfig } from '/@/stores/themeConfig';
 import emitter from '/@/utils/mitt';
 import { userInfoKey } from '/@/utils/request';
@@ -79,8 +79,25 @@
 	announcementContent: '',
 	announcementTime: '',
 });
+const firstToPath = computed(() => {
+	if (!activeChatRoom.value)
+		return {
+			path: '/home',
+		};
+	const result = activeChatRoom.value.isInitial
+		? {
+				path: '/home',
+				query: {
+					id: activeChatRoom.value.id,
+				},
+		  }
+		: {
+				path: '/ask_answer',
+				query: { id: activeChatRoom.value.id },
+		  };
 
-
+	return result;
+});
 
 //#region ====================== 鍏憡鏄惁鐪嬭繃 ======================
 const userInfo = ref(Local.get(userInfoKey));
@@ -172,7 +189,7 @@
 
 .notice {
 	position: fixed;
-	top: 18px;
+	top: 12px;
 	right: 30px;
 	z-index: 1;
 	.set-notice {

--
Gitblit v1.9.3