2026-04-12 09:44:32 +08:00
|
|
|
<!-- 入口 -->
|
|
|
|
|
<template>
|
2026-04-13 10:30:03 +08:00
|
|
|
<div class="nav-container">
|
|
|
|
|
<div
|
|
|
|
|
class="top-nav"
|
|
|
|
|
:style="{ 'background-image': `url(${backgroundImage})` }"
|
|
|
|
|
>
|
|
|
|
|
<div class="logo-img">
|
|
|
|
|
<img :src="mainLogo" alt="西安应急智慧logo" id="main_logo" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-list">
|
|
|
|
|
<router-link
|
|
|
|
|
@click="useViewerStore().setViewerLoadingCompleted(false)"
|
|
|
|
|
v-for="(item, index) in topNavMap"
|
|
|
|
|
:key="index"
|
|
|
|
|
:to="{ name: item.name, query: item.query }"
|
|
|
|
|
class="nav-item"
|
|
|
|
|
:class="{ active: isActive(item.query.identification) }"
|
|
|
|
|
>
|
|
|
|
|
{{ item.title }}
|
|
|
|
|
</router-link>
|
|
|
|
|
</div>
|
2026-04-12 09:44:32 +08:00
|
|
|
</div>
|
2026-04-13 10:30:03 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="content-container">
|
|
|
|
|
<RouterView />
|
|
|
|
|
</div>
|
2026-04-12 09:44:32 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-04-13 10:30:03 +08:00
|
|
|
import { useViewerStore } from '@/stores/useViewerStore';
|
|
|
|
|
import { RouterView, useRoute } from 'vue-router';
|
|
|
|
|
import mainLogo from '@/assets/images/main-logo.png';
|
|
|
|
|
import backgroundImage from '@/assets/images/background-image.png';
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
useViewerStore().setViewerLoadingCompleted(true);
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
const route = useRoute();
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
const topNavMap = [
|
2026-04-12 09:44:32 +08:00
|
|
|
{ title: '暴雨灾害链', name: 'rainstorm', query: { identification: 1 } },
|
|
|
|
|
{ title: '地震灾害链', name: 'earthquake', query: { identification: 2 } },
|
|
|
|
|
{ title: '多灾种灾害链分析', name: 'index', query: { identification: 3 } },
|
|
|
|
|
{ title: '灾害链情景推演', name: 'index', query: { identification: 4 } },
|
|
|
|
|
{ title: '数据管理', name: 'index', query: { identification: 5 } },
|
2026-04-13 10:30:03 +08:00
|
|
|
{ title: '文件管理', name: 'index', query: { identification: 6 } },
|
|
|
|
|
];
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
// 判断当前导航项是否激活
|
|
|
|
|
const isActive = (identification: number) => {
|
2026-04-12 09:44:32 +08:00
|
|
|
const targetId = identification.toString();
|
|
|
|
|
let currentId = route.query.identification;
|
2026-04-13 10:30:03 +08:00
|
|
|
if (!currentId) return targetId === '1';
|
2026-04-12 09:44:32 +08:00
|
|
|
if (Array.isArray(currentId)) currentId = currentId[0];
|
|
|
|
|
return currentId === targetId || route.query.identification === targetId;
|
2026-04-13 10:30:03 +08:00
|
|
|
};
|
2026-04-12 09:44:32 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-04-13 10:30:03 +08:00
|
|
|
.nav-container {
|
2026-04-12 09:44:32 +08:00
|
|
|
height: 50px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
position: relative;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
z-index: 10000000;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.top-nav {
|
2026-04-12 09:44:32 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 50px;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
padding: 0 40px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
display: flex;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.nav-list {
|
2026-04-12 09:44:32 +08:00
|
|
|
margin-left: 100px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.nav-item {
|
2026-04-12 09:44:32 +08:00
|
|
|
color: white;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
transition: background-color 0.3s;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.nav-item:hover {
|
2026-04-12 09:44:32 +08:00
|
|
|
background-color: rgba(255, 255, 255, 0.3);
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.content-container {
|
2026-04-12 09:44:32 +08:00
|
|
|
height: 100vh;
|
|
|
|
|
width: 100vw;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
#main_logo {
|
2026-04-12 09:44:32 +08:00
|
|
|
height: 50px;
|
|
|
|
|
margin-right: 100px;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
2026-04-12 09:44:32 +08:00
|
|
|
|
2026-04-13 10:30:03 +08:00
|
|
|
.nav-item.active {
|
2026-04-12 09:44:32 +08:00
|
|
|
background-color: rgba(255, 255, 255, 0.3);
|
|
|
|
|
border-bottom: 3px solid #409eff;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
box-sizing: border-box;
|
2026-04-13 10:30:03 +08:00
|
|
|
}
|
|
|
|
|
</style>
|