Просмотр исходного кода

feat: 导航栏增加天眼和天梭平台跳转

ai0182 4 месяцев назад
Родитель
Сommit
bd8646ce66

+ 4 - 0
public/app.config.js

@@ -5,6 +5,10 @@ window.__PRODUCTION__SKYEYEADMIN__CONF__ = {
   // 接口前缀
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
 
+  VITE_GLOB_SKYEYE_PLATFORM: "https://wwww.baidu.com",
+
+  VITE_GLOB_TIANSUO_PLATFORM: "https://www.bing.com"
+
 };
 
 Object.freeze(window.__PRODUCTION__SKYEYEADMIN__CONF__);

+ 9 - 5
src/components/Nav.vue

@@ -8,20 +8,24 @@
         v-for="item in NAV_LIST"
         :key="item.path"
         :class="{ active: selectedKey === item.name }"
-        @click="handleNavClick(item)"
+        @click="item.name!=='Skyeye' && item.name!=='Tiansuo' && handleNavClick(item)"
       >
-        <span>{{ item.meta?.title }}</span>
+        
+        <a v-if="item.name==='Skyeye'" :href="skyeyeUrl" target="_blank" @click.stop>实时监控</a>
+        <a v-else-if="item.name==='Tiansuo'" :href="tiansuoUrl" target="_blank" @click.stop>物联集成</a>
+        <span v-else>{{ item.meta?.title }}</span>
       </div>
     </nav>
+    
     <SwitchTenant v-if="userStore.info.tenantId === SYS_TENANT_ID" />
     <div class="platform__right">
-      <div class="platform__right__search">
+      <!-- <div class="platform__right__search">
         <el-input v-model="searchValue" placeholder="搜索您想了解的" class="input-with-icon" clearable>
           <template #prepend>
             <img :src="searchIcon" alt="search" class="search-icon" @click="handleSearch" />
           </template>
         </el-input>
-      </div>
+      </div> -->
       <div class="platform__right__login">
         <span @click="userStore.showLogin = true" v-if="!userStore.info?.id">登录</span>
         <UserInfo v-else />
@@ -61,7 +65,7 @@
   };
 
   const currentRoute = useRoute();
-  const { title } = useGlobSetting();
+  const { title ,skyeyeUrl,tiansuoUrl} = useGlobSetting();
 
   const handleNavClick = (item: { name: string; path: string }) => {
     if (!item.path) {

+ 16 - 0
src/constant/nav.ts

@@ -58,4 +58,20 @@ export const NAV_LIST = [
       title: '平台管理',
     },
   },
+  {
+    name:"Skyeye",
+    path:'/skyeye-playform',
+    meta:{
+      title:"实时监控",
+    }
+  },
+   {
+    name:"Tiansuo",
+    path:'/Tiansuo',
+    meta:{
+      title:'物联集成',
+    }
+  },
+
+
 ];

+ 6 - 2
src/hooks/setting/index.ts

@@ -4,8 +4,8 @@ import { warn } from '@/utils/log';
 import { getAppEnvConfig } from '@/utils/env';
 
 export const useGlobSetting = (): Readonly<GlobConfig> => {
-  const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_DRILL_SIGN_URL } = getAppEnvConfig();
-
+  const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_DRILL_SIGN_URL,VITE_GLOB_SKYEYE_PLATFORM ,VITE_GLOB_TIANSUO_PLATFORM} = getAppEnvConfig();
+  
   // Take global configuration
   const glob: Readonly<GlobConfig> = {
     title: VITE_GLOB_APP_TITLE,
@@ -13,6 +13,10 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     urlPrefix: VITE_GLOB_API_URL_PREFIX || '',
 
     drillSignUrl: VITE_GLOB_DRILL_SIGN_URL || '',
+
+    skyeyeUrl:VITE_GLOB_SKYEYE_PLATFORM || "",
+
+    tiansuoUrl:VITE_GLOB_TIANSUO_PLATFORM || "",
   };
   return glob as Readonly<GlobConfig>;
 };

+ 1 - 1
src/utils/env.ts

@@ -16,8 +16,8 @@ export function getStorageShortName() {
 
 export function getAppEnvConfig() {
   const ENV_NAME = '__PRODUCTION__SKYEYEADMIN__CONF__';
-
   const ENV = window[ENV_NAME as any] as unknown as GlobEnvConfig;
+
   if (!ENV) {
     throw new Error('config not found');
   }

+ 8 - 0
types/config.d.ts

@@ -56,6 +56,10 @@ export interface GlobConfig {
   urlPrefix: string;
   // 签到二维码地址
   drillSignUrl: string;
+
+  skyeyeUrl:string;
+
+  tiansuoUrl:string;
 }
 
 export interface GlobEnvConfig {
@@ -65,6 +69,10 @@ export interface GlobEnvConfig {
   VITE_GLOB_API_URL_PREFIX: string;
   // 签到二维码地址
   VITE_GLOB_DRILL_SIGN_URL: string;
+
+  VITE_GLOB_SKYEYE_PLATFORM:string;
+
+  VITE_GLOB_TIANSUO_PLATFORM:string;
 }
 
 // export interface GlobConfig {

+ 4 - 0
utils/devProxy/staff/app.config.js

@@ -5,6 +5,10 @@ window.__PRODUCTION__SKYEYEADMIN__CONF__ = {
   // 接口前缀
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
 
+  VITE_GLOB_SKYEYE_PLATFORM: "wwww.baidu.com",
+
+  VITE_GLOB_TIANSUO_PLATFORM: "www.bing.com"
+
 };
 
 Object.freeze(window.__PRODUCTION__SKYEYEADMIN__CONF__);