Преглед изворни кода

feat: 添加跳转天眼天梭的外链和代理

ai0197 пре 4 месеци
родитељ
комит
913b7e8335

+ 5 - 2
public/app.config.js

@@ -5,9 +5,12 @@ window.__PRODUCTION__SKYEYEADMIN__CONF__ = {
   // 接口前缀
   // 接口前缀
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
 
 
-  VITE_GLOB_SKYEYE_PLATFORM: "http://wwww.baidu.com",
+  VITE_GLOB_SKYEYE_LOGIN_URL: "/skyeye-login/",
+  VITE_GLOB_SKYEYE_PLATFORM_URL: "/skyeye-pc/",
+  VITE_GLOB_SKYEYE_ADMIN_URL: "/skyeye-admin/",
+  VITE_GLOB_SKYEYE_H5_URL: "/skyeye-h5/",
 
 
-  VITE_GLOB_TIANSUO_PLATFORM: "http://www.bing.com"
+  VITE_GLOB_TIANSUO_PLATFORM: "/tiansuo/"
 
 
 };
 };
 
 

+ 6 - 3
src/App.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div id="app">
   <div id="app">
-    <el-watermark :content="[username, realname]" :font="font" :width="90" :gap="[150, 150]">
+    <el-watermark class="viewport-watermark" :content="[username, realname]" :font="font" :width="90" :gap="[200, 200]">
       <Nav v-if="!isFixedScreen" />
       <Nav v-if="!isFixedScreen" />
       <div class="content" :class="{ 'fixed-screen': isFixedScreen }">
       <div class="content" :class="{ 'fixed-screen': isFixedScreen }">
         <router-view />
         <router-view />
@@ -15,7 +15,6 @@
   import { storeToRefs } from 'pinia';
   import { storeToRefs } from 'pinia';
   import { useUserStore } from '@/store/modules/user';
   import { useUserStore } from '@/store/modules/user';
   import Nav from '@/components/Nav.vue';
   import Nav from '@/components/Nav.vue';
-  import WatermarkWrapper from '@/components/Waterwrapper.vue';
 
 
   const userStore = useUserStore();
   const userStore = useUserStore();
   const { getUserInfo } = storeToRefs(userStore);
   const { getUserInfo } = storeToRefs(userStore);
@@ -24,7 +23,7 @@
   const realname = computed(() => getUserInfo.value.realname);
   const realname = computed(() => getUserInfo.value.realname);
 
 
   const font = reactive({
   const font = reactive({
-    color: 'rgba(0,0,0,.05)',
+    color: 'rgba(0,0,0,.03)',
   });
   });
 
 
   const route = useRoute();
   const route = useRoute();
@@ -40,6 +39,10 @@
     width: 100vw;
     width: 100vw;
     height: 100vh;
     height: 100vh;
   }
   }
+  .viewport-watermark {
+    width: 100%;
+    height: 100%;
+  }
   .content {
   .content {
     height: 100%;
     height: 100%;
     flex: 1;
     flex: 1;

+ 183 - 182
src/components/Nav.vue

@@ -3,8 +3,13 @@
     <img :src="logo" alt="logo" class="header__logo" />
     <img :src="logo" alt="logo" class="header__logo" />
     <span class="platform-name">{{ title }}</span>
     <span class="platform-name">{{ title }}</span>
     <nav class="header__nav">
     <nav class="header__nav">
-      <div class="header__nav--item" v-for="item in NAV_LIST" :key="item.path"
-        :class="{ active: selectedKey === item.name }" @click="handleNavClick(item)">
+      <div
+        class="header__nav--item"
+        v-for="item in NAV_LIST"
+        :key="item.path"
+        :class="{ active: selectedKey === item.name }"
+        @click="handleNavClick(item)"
+      >
         <span>{{ item.meta?.title }}</span>
         <span>{{ item.meta?.title }}</span>
       </div>
       </div>
     </nav>
     </nav>
@@ -23,206 +28,202 @@
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { ref, computed } from 'vue';
-import { useRouter, useRoute } from 'vue-router';
-import UpdatePwd from '@/components/UpdatePwd.vue';
-import UserInfo from '@/components/UserInfo.vue';
-import Login from '@/components/Login/Login.vue';
-import SwitchAccount from '@/components/Login/SwitchAccount.vue';
-import SwitchTenant from '@/layout/components/SwitchTenant.vue';
-import { useUserStore } from '@/store/modules/user';
-import { useGlobSetting } from '@/hooks/setting';
-import { SYS_TENANT_ID } from '@/utils/useTargetTenantIdSetting';
-import { NAV_LIST } from '@/constant/nav';
-import logo from 'assets/images/home/comac-logo@1X.png';
-import searchIcon from 'assets/svg/search.svg';
-
-const userStore = useUserStore();
-const activeNav = ref(NAV_LIST[0].name);
-const router = useRouter();
-const searchValue = ref('');
-
-const props = withDefaults(defineProps<{ usePx?: boolean }>(), { usePx: false });
-const usePx = computed(() => props.usePx === true);
-
-const handleSearch = () => {
-  console.log('searchValue', searchValue.value);
-};
-
-const currentRoute = useRoute();
-const { title } = useGlobSetting();
-
-const handleNavClick = (item: { name: string; path: string; isRedrect?: boolean }) => {
-
-  if (!item.path) {
-    router.replace({ name: 'StayTune' });
-    // ElMessage.warning({ message: `${item.name}功能建设中,暂无法访问`, offset: 100, grouping: true });
-    return;
-  }
+  import { ref, computed } from 'vue';
+  import { useRouter, useRoute } from 'vue-router';
+  import UpdatePwd from '@/components/UpdatePwd.vue';
+  import UserInfo from '@/components/UserInfo.vue';
+  import Login from '@/components/Login/Login.vue';
+  import SwitchAccount from '@/components/Login/SwitchAccount.vue';
+  import SwitchTenant from '@/layout/components/SwitchTenant.vue';
+  import { useUserStore } from '@/store/modules/user';
+  import { useGlobSetting } from '@/hooks/setting';
+  import { SYS_TENANT_ID } from '@/utils/useTargetTenantIdSetting';
+  import { NAV_LIST } from '@/constant/nav';
+  import logo from 'assets/images/home/comac-logo@1X.png';
+  import searchIcon from 'assets/svg/search.svg';
+
+  const userStore = useUserStore();
+  const activeNav = ref(NAV_LIST[0].name);
+  const router = useRouter();
+  const searchValue = ref('');
+
+  const props = withDefaults(defineProps<{ usePx?: boolean }>(), { usePx: false });
+  const usePx = computed(() => props.usePx === true);
+
+  const handleSearch = () => {
+    console.log('searchValue', searchValue.value);
+  };
+
+  const currentRoute = useRoute();
+  const { title } = useGlobSetting();
+
+  const handleNavClick = (item: { name: string; path: string; isRedrect?: boolean }) => {
+    if (item.isRedrect) {
+      window.open(item.path, '_blank');
+      return;
+    }
+    if (!item.path) {
+      router.replace({ name: 'StayTune' });
+      // ElMessage.warning({ message: `${item.name}功能建设中,暂无法访问`, offset: 100, grouping: true });
+      return;
+    }
+    router.push(item.path);
+  };
+
+  const selectedKey = computed(() => {
+    return currentRoute.matched[0]?.name;
+  });
+</script>
 
 
-  if (item.isRedrect) {
-    window.open(item.path, '_blank');
-    return;
+<style lang="scss" scoped>
+  .header {
+    display: flex;
+    align-items: center;
+    position: relative;
+    width: 100%;
+    height: 78cpx;
+    background: url('assets/images/home/nav-bg@1X.png') no-repeat center center / cover;
+    z-index: 2;
+
+    &__nav {
+      @include flex-center;
+      gap: 20cpx;
+      height: 100%;
+      margin-left: 32cpx;
+
+      &--item {
+        @include flex-center;
+        height: 45cpx;
+        padding: 10cpx 20cpx;
+        gap: 8cpx;
+        font-size: 18cpx;
+        color: #333;
+        border-radius: 4cpx;
+        cursor: pointer;
+        border: 1px solid transparent;
+        border-radius: 4px;
+
+        // transition: all 0.3s ease-in-out;
+        &.active,
+        &:hover {
+          background: linear-gradient(180deg, #33afff, $primary-color);
+          color: $white-color;
+        }
+      }
+    }
   }
   }
-  router.push(item.path);
-};
 
 
-const selectedKey = computed(() => {
-  return currentRoute.matched[0]?.name;
-});
+  .header__logo {
+    width: 34cpx;
+    height: 34cpx;
+    margin-left: 38cpx;
+  }
 
 
-</script>
+  .platform-name {
+    font-size: 18cpx;
+    font-weight: 550;
+    margin-left: 9cpx;
+  }
 
 
-<style lang="scss" scoped>
-.header {
-  display: flex;
-  align-items: center;
-  position: relative;
-  width: 100%;
-  height: 78cpx;
-  background: url('assets/images/home/nav-bg@1X.png') no-repeat center center / cover;
-  z-index: 2;
-
-  &__nav {
+  .platform__right {
     @include flex-center;
     @include flex-center;
-    gap: 20cpx;
-    height: 100%;
-    margin-left: 32cpx;
+    position: absolute;
+    top: 0;
+    right: 0;
+    height: 73cpx;
+
+    &__search {
+      @include flex-center;
+      width: 210cpx;
+      height: 100%;
+      padding: 28cpx 26cpx;
+      background: rgba($white-color, 0.4);
+    }
 
 
-    &--item {
+    &__login {
       @include flex-center;
       @include flex-center;
-      height: 45cpx;
-      padding: 10cpx 20cpx;
-      gap: 8cpx;
+      gap: 10cpx;
+      height: 100%;
+      padding: 27cpx 40cpx 26cpx 40cpx;
       font-size: 18cpx;
       font-size: 18cpx;
-      color: #333;
-      border-radius: 4cpx;
+      color: $primary-color;
       cursor: pointer;
       cursor: pointer;
-      border: 1px solid transparent;
-      border-radius: 4px;
-
-      // transition: all 0.3s ease-in-out;
-      &.active,
-      &:hover {
-        background: linear-gradient(180deg, #33afff, $primary-color);
-        color: $white-color;
-      }
     }
     }
   }
   }
-}
-
-.header__logo {
-  width: 34cpx;
-  height: 34cpx;
-  margin-left: 38cpx;
-}
-
-.platform-name {
-  font-size: 18cpx;
-  font-weight: 550;
-  margin-left: 9cpx;
-}
-
-.platform__right {
-  @include flex-center;
-  position: absolute;
-  top: 0;
-  right: 0;
-  height: 73cpx;
-
-  &__search {
-    @include flex-center;
-    width: 210cpx;
-    height: 100%;
-    padding: 28cpx 26cpx;
-    background: rgba($white-color, 0.4);
+
+  .input-with-icon {
+    :deep(.el-input__wrapper),
+    :deep(.el-input-group__prepend) {
+      background-color: transparent;
+      box-shadow: none;
+      padding: 0;
+    }
+
+    :deep(.el-input__inner) {
+      width: 120cpx;
+      margin-left: 5cpx;
+      font-size: 16cpx;
+      color: #909399;
+    }
+
+    .search-icon {
+      width: 28cpx;
+      height: 28cpx;
+      cursor: pointer;
+    }
   }
   }
 
 
-  &__login {
-    @include flex-center;
-    gap: 10cpx;
-    height: 100%;
-    padding: 27cpx 40cpx 26cpx 40cpx;
-    font-size: 18cpx;
-    color: $primary-color;
-    cursor: pointer;
+  /* 使用 px 的样式覆盖(用于固定画布布局) */
+  .header.use-px {
+    height: 78px;
+  }
+
+  .header.use-px .header__nav {
+    gap: 14px;
+    margin-left: 32px;
   }
   }
-}
 
 
-.input-with-icon {
+  .header.use-px .header__nav--item {
+    height: 45px;
+    padding: 10px 20px;
+    font-size: 18px;
+    border-radius: 4px;
+  }
+
+  .header.use-px .header__logo {
+    width: 34px;
+    height: 34px;
+    margin-left: 38px;
+  }
+
+  .header.use-px .platform-name {
+    font-size: 18px;
+    margin-left: 9px;
+  }
+
+  .header.use-px .platform__right {
+    height: 73px;
+  }
+
+  .header.use-px .platform__right__search {
+    width: 210px;
+    padding: 28px 26px;
+  }
 
 
-  :deep(.el-input__wrapper),
-  :deep(.el-input-group__prepend) {
-    background-color: transparent;
-    box-shadow: none;
-    padding: 0;
+  .header.use-px .platform__right__login {
+    gap: 10px;
+    padding: 27px 40px 26px 40px;
+    font-size: 18px;
   }
   }
 
 
-  :deep(.el-input__inner) {
-    width: 120cpx;
-    margin-left: 5cpx;
-    font-size: 16cpx;
-    color: #909399;
+  .header.use-px .input-with-icon :deep(.el-input__inner) {
+    width: 120px;
+    margin-left: 5px;
+    font-size: 16px;
   }
   }
 
 
-  .search-icon {
-    width: 28cpx;
-    height: 28cpx;
-    cursor: pointer;
+  .header.use-px .input-with-icon .search-icon {
+    width: 28px;
+    height: 28px;
   }
   }
-}
-
-/* 使用 px 的样式覆盖(用于固定画布布局) */
-.header.use-px {
-  height: 78px;
-}
-
-.header.use-px .header__nav {
-  gap: 14px;
-  margin-left: 32px;
-}
-
-.header.use-px .header__nav--item {
-  height: 45px;
-  padding: 10px 20px;
-  font-size: 18px;
-  border-radius: 4px;
-}
-
-.header.use-px .header__logo {
-  width: 34px;
-  height: 34px;
-  margin-left: 38px;
-}
-
-.header.use-px .platform-name {
-  font-size: 18px;
-  margin-left: 9px;
-}
-
-.header.use-px .platform__right {
-  height: 73px;
-}
-
-.header.use-px .platform__right__search {
-  width: 210px;
-  padding: 28px 26px;
-}
-
-.header.use-px .platform__right__login {
-  gap: 10px;
-  padding: 27px 40px 26px 40px;
-  font-size: 18px;
-}
-
-.header.use-px .input-with-icon :deep(.el-input__inner) {
-  width: 120px;
-  margin-left: 5px;
-  font-size: 16px;
-}
-
-.header.use-px .input-with-icon .search-icon {
-  width: 28px;
-  height: 28px;
-}
 </style>
 </style>

+ 3 - 3
src/constant/nav.ts

@@ -4,7 +4,7 @@
 
 
 import { HOME_PAGE } from '@/router/full-routes';
 import { HOME_PAGE } from '@/router/full-routes';
 import { useGlobSetting } from '@/hooks/setting';
 import { useGlobSetting } from '@/hooks/setting';
-const { skyeyeUrl, tiansuoUrl } = useGlobSetting();
+const { skyeyePlatformHost, tiansuoHost } = useGlobSetting();
 // 首页导航列表 根据后端返回权限控制(首页永远存在)
 // 首页导航列表 根据后端返回权限控制(首页永远存在)
 export const NAV_LIST = [
 export const NAV_LIST = [
   {
   {
@@ -61,7 +61,7 @@ export const NAV_LIST = [
   },
   },
   {
   {
     name: 'Skyeye',
     name: 'Skyeye',
-    path: skyeyeUrl,
+    path: skyeyePlatformHost,
     isRedrect: true,
     isRedrect: true,
     meta: {
     meta: {
       title: '实时监控',
       title: '实时监控',
@@ -69,7 +69,7 @@ export const NAV_LIST = [
   },
   },
   {
   {
     name: 'Tiansuo',
     name: 'Tiansuo',
-    path: tiansuoUrl,
+    path: tiansuoHost,
     isRedrect: true,
     isRedrect: true,
     meta: {
     meta: {
       title: '物联集成',
       title: '物联集成',

+ 9 - 3
src/hooks/setting/index.ts

@@ -9,7 +9,10 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     VITE_GLOB_API_URL_PREFIX,
     VITE_GLOB_API_URL_PREFIX,
     VITE_GLOB_DRILL_SIGN_URL,
     VITE_GLOB_DRILL_SIGN_URL,
     // VITE_GLOB_TENANT_CODE,
     // VITE_GLOB_TENANT_CODE,
-    VITE_GLOB_SKYEYE_PLATFORM,
+    VITE_GLOB_SKYEYE_LOGIN_URL,
+    VITE_GLOB_SKYEYE_PLATFORM_URL,
+    VITE_GLOB_SKYEYE_ADMIN_URL,
+    VITE_GLOB_SKYEYE_H5_URL,
     VITE_GLOB_TIANSUO_PLATFORM,
     VITE_GLOB_TIANSUO_PLATFORM,
   } = getAppEnvConfig();
   } = getAppEnvConfig();
 
 
@@ -23,9 +26,12 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
 
 
     // tenantCode: VITE_GLOB_TENANT_CODE,
     // tenantCode: VITE_GLOB_TENANT_CODE,
 
 
-    skyeyeUrl: VITE_GLOB_SKYEYE_PLATFORM || '',
+    skyeyeLoginHost: VITE_GLOB_SKYEYE_LOGIN_URL,
+    skyeyePlatformHost: VITE_GLOB_SKYEYE_PLATFORM_URL,
+    skyeyeAdminHost: VITE_GLOB_SKYEYE_ADMIN_URL,
+    skyeyeH5Host: VITE_GLOB_SKYEYE_H5_URL,
 
 
-    tiansuoUrl: VITE_GLOB_TIANSUO_PLATFORM || '',
+    tiansuoHost: VITE_GLOB_TIANSUO_PLATFORM,
   };
   };
   return glob as Readonly<GlobConfig>;
   return glob as Readonly<GlobConfig>;
 };
 };

+ 9 - 3
types/config.d.ts

@@ -61,10 +61,13 @@ export interface GlobConfig {
   // tenantCode?: string;
   // tenantCode?: string;
 
 
   // 天眼外链地址
   // 天眼外链地址
-  skyeyeUrl: string;
+  skyeyeLoginHost: string | undefined;
+  skyeyePlatformHost: string | undefined;
+  skyeyeAdminHost: string | undefined;
+  skyeyeH5Host: string | undefined;
 
 
   // 天梭外链地址
   // 天梭外链地址
-  tiansuoUrl: string;
+  tiansuoHost: string | undefined;
 }
 }
 
 
 export interface GlobEnvConfig {
 export interface GlobEnvConfig {
@@ -78,7 +81,10 @@ export interface GlobEnvConfig {
   VITE_GLOB_TENANT_CODE: string;
   VITE_GLOB_TENANT_CODE: string;
 
 
   // 天眼外链地址
   // 天眼外链地址
-  VITE_GLOB_SKYEYE_PLATFORM: string;
+  VITE_GLOB_SKYEYE_LOGIN_URL: string;
+  VITE_GLOB_SKYEYE_PLATFORM_URL: string;
+  VITE_GLOB_SKYEYE_ADMIN_URL: string;
+  VITE_GLOB_SKYEYE_H5_URL: string;
 
 
   // 天梭外链地址
   // 天梭外链地址
   VITE_GLOB_TIANSUO_PLATFORM: string;
   VITE_GLOB_TIANSUO_PLATFORM: string;

+ 5 - 2
utils/devProxy/staff/app.config.js

@@ -5,9 +5,12 @@ window.__PRODUCTION__SKYEYEADMIN__CONF__ = {
   // 接口前缀
   // 接口前缀
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
   VITE_GLOB_API_URL_PREFIX: './safety_api/api',
 
 
-  VITE_GLOB_SKYEYE_PLATFORM: "wwww.baidu.com",
+  VITE_GLOB_SKYEYE_LOGIN_URL: "/skyeye-login/",
+  VITE_GLOB_SKYEYE_PLATFORM_URL: "/skyeye-pc/",
+  VITE_GLOB_SKYEYE_ADMIN_URL: "/skyeye-admin/",
+  VITE_GLOB_SKYEYE_H5_URL: "/skyeye-h5/",
 
 
-  VITE_GLOB_TIANSUO_PLATFORM: "www.bing.com"
+  VITE_GLOB_TIANSUO_PLATFORM: "/tiansuo/"
 
 
 };
 };
 
 

+ 5 - 3
utils/devProxy/staff/proxy.ts

@@ -4,9 +4,11 @@ import path from 'path';
 // staff环境
 // staff环境
 const proxyStaff: PROXY_TYPE = {
 const proxyStaff: PROXY_TYPE = {
   serverHost: 'http://192.168.13.68:8802/',
   serverHost: 'http://192.168.13.68:8802/',
-  // serverHost: 'http://192.168.22.121:8802/',
-  // serverHost: 'http://192.168.21.223:8802/',
-  loginHost: 'http://192.168.13.68:7200/login/#/',
+  skyeyeLoginHost: 'http://192.168.13.68:7000/skyeye-login/#/',
+  skyeyePlatformHost: 'http://192.168.13.68:7000/skyeye-pc/#/',
+  skyeyeAdminHost: 'http://192.168.13.68:7000/skyeye-admin/#/',
+  skyeyeH5Host: 'http://192.168.13.68:7000/skyeye-h5/#/',
+  tiansuoHost: 'http://192.168.6.33:91/',
   fileUploadHost: 'http://192.168.13.102:9000/',
   fileUploadHost: 'http://192.168.13.102:9000/',
   violation_src: 'http://192.168.13.102:62/violation_src',
   violation_src: 'http://192.168.13.102:62/violation_src',
   push_stream_host: 'http://192.168.13.68:7000/skyeye-admin/push_stream_host/',
   push_stream_host: 'http://192.168.13.68:7000/skyeye-admin/push_stream_host/',

+ 10 - 1
utils/devProxy/types.ts

@@ -2,8 +2,17 @@ export interface PROXY_TYPE {
   /** 后端服务的地址 */
   /** 后端服务的地址 */
   serverHost: string;
   serverHost: string;
 
 
+  /** 天眼地址 */
+  skyeyeLoginHost: string;
+  skyeyePlatformHost: string;
+  skyeyeAdminHost: string;
+  skyeyeH5Host: string;
+
+  /** 天梭地址 */
+  tiansuoHost: string;
+
   /** 登录地址 */
   /** 登录地址 */
-  loginHost: string;
+  // loginHost: string;
   /** 文件存储服务minio */
   /** 文件存储服务minio */
   fileUploadHost: string;
   fileUploadHost: string;
   /** 流媒体服务 */
   /** 流媒体服务 */

+ 5 - 0
utils/devProxy/utils.ts

@@ -7,6 +7,11 @@ export const createProxyList = (devProxy: PROXY_TYPE) =>
   [
   [
     ['/ws_api_bak/', devProxy.serverHost],
     ['/ws_api_bak/', devProxy.serverHost],
     ['/safety_api/', devProxy.serverHost],
     ['/safety_api/', devProxy.serverHost],
+    ['/skyeye-login/', devProxy.skyeyeLoginHost],
+    ['/skyeye-pc/', devProxy.skyeyePlatformHost],
+    ['/skyeye-admin/', devProxy.skyeyeAdminHost],
+    ['/skyeye-h5/', devProxy.skyeyeH5Host],
+    ['/tiansuo/', devProxy.tiansuoHost],
     ['/skyeye-file-upload/', devProxy.fileUploadHost],
     ['/skyeye-file-upload/', devProxy.fileUploadHost],
     ['/push_stream_host/', devProxy.push_stream_host],
     ['/push_stream_host/', devProxy.push_stream_host],
     ['/violation_src/', devProxy.violation_src],
     ['/violation_src/', devProxy.violation_src],