wujingjing
2025-04-10 8aa7ffddc511138d61d64029157c11cfccc5431d
src/layout/component/header/Header.vue
@@ -1,18 +1,10 @@
<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="firstToPath" class="nav-item" active-class="active">
            <router-link v-for="item in menuList" :to="item.path" :key="item.label" 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">
               <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系统
               {{ item.label }}
            </router-link>
         </div>
      </div>
@@ -33,28 +25,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,8 +39,18 @@
import { systemNotifyList } from '/@/api/ai/chat';
import router from '/@/router';
import pinia from '/@/stores';
import { activeChatRoom, activeRoomId, isSharePage, newChatRoomClick } from '/@/stores/chatRoom';
import {
   activeChatRoom,
   activeRoomId,
   activeTopMenuStyle,
   isSharePage,
   newChatRoomClick,
   TopMenuStyle,
   sidebarIsShow,
} from '/@/stores/chatRoom';
import { useThemeConfig } from '/@/stores/themeConfig';
import { ParentRegister } from '/@/stores/global';
import emitter from '/@/utils/mitt';
import { userInfoKey } from '/@/utils/request';
import { Local } from '/@/utils/storage';
@@ -79,6 +63,44 @@
   announcementContent: '',
   announcementTime: '',
});
const menuList = computed(() => {
   const smartAssistant = {
      path: firstToPath.value,
      label: '智能助手',
   };
   const personalWorkbench = {
      path: '/workspace/situation',
      label: '个人工作台',
   };
   const gis = {
      path: '/gis/situation',
      label: 'GIS系统',
   };
   return [smartAssistant];
   switch (activeTopMenuStyle.value) {
      case TopMenuStyle.Normal:
         return [smartAssistant, personalWorkbench];
      case TopMenuStyle.Gis:
         return [smartAssistant, gis];
      default:
         return [smartAssistant];
   }
});
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 {
@@ -189,7 +211,7 @@
.notice {
   position: fixed;
   top: 18px;
   top: 12px;
   right: 30px;
   z-index: 1;
   .set-notice {