gerson
2025-04-02 9569b71af760325bea5d0fb3b2b3f6ba510586ac
src/layout/component/header/Header.vue
@@ -1,19 +1,19 @@
<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="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>
            <router-link to="/workspace/situation" class="nav-item" active-class="active">
            <!-- <router-link to="/workspace/situation" class="nav-item" active-class="active">
               <i class="icon-park-outline-workbench"></i>
               个人工作台
            </router-link>
            <router-link to="/gis/situation" class="nav-item" active-class="active">
               <i class="icon-park-outline-system"></i>
               GIS系统
            </router-link>
            </router-link> -->
         </div>
      </div>
      <el-dialog
@@ -33,28 +33,10 @@
            </p>
         </template>
      </el-dialog>
   </div>
   <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>
      <div class="notice_box notice_box_show" v-show="state.isShowAnnouncement" ref="noticeRef">
         <div class="notice_box_header">
            <span>最新公告</span>
         </div>
         <div class="notice_box_body">
            <div class="notice_item" v-for="item in state.announcementList" :key="item.notify_id" @click="announcementContentClick(item)">
               <div class="flex items-center">
                  <p class="set-circle"></p>
                  <p>{{ item.notify_message }}</p>
               </div>
               <p class="text-right mr-[19px]">
                  <span>{{ item.notify_time }}</span>
               </p>
            </div>
         </div>
      </div>
      <el-tooltip content="最小化" placement="bottom">
         <span class="cursor-pointer ywifont ywicon-tuichuquanping" size="15px" @click="smallScreenClick" />
      </el-tooltip>
   </div>
</template>
@@ -65,7 +47,8 @@
import { systemNotifyList } from '/@/api/ai/chat';
import router from '/@/router';
import pinia from '/@/stores';
import { activeRoomId, isSharePage, newChatRoomClick } from '/@/stores/chatRoom';
import { activeChatRoom, newChatRoomClick, sidebarIsShow } from '/@/stores/chatRoom';
import { ParentRegister } from '/@/stores/global';
import { useThemeConfig } from '/@/stores/themeConfig';
import emitter from '/@/utils/mitt';
import { userInfoKey } from '/@/utils/request';
@@ -80,7 +63,34 @@
   announcementTime: '',
});
const smallScreenClick = () => {
   const pathname = window.location.pathname;
   const basePath = pathname.replace(/\/web\/index\.html$/, '');
   window.location.href = basePath || '/';
   ParentRegister.notify?.({
      type: 'fullScreen',
      value: false,
   });
};
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 +182,7 @@
.notice {
   position: fixed;
   top: 18px;
   top: 12px;
   right: 30px;
   z-index: 1;
   .set-notice {