Files
xian_vue_new/src/views/IndexView.vue
T

103 lines
2.1 KiB
Vue
Raw Normal View History

2026-04-12 09:44:32 +08:00
<!-- 入口 -->
<template>
<div class="nav-container">
<div
class="top-nav"
:style="{ 'background-image': `url(${backgroundImage})` }"
>
<div class="logo-img">
2026-04-13 20:55:32 +08:00
<img :src="mainLogoImage" alt="西安应急智慧logo" id="main_logo" />
</div>
<div class="nav-list">
<router-link
2026-05-06 18:17:54 +08:00
@click="
isActive(item.query.identification)
? ''
: (useStatusStore().appLoadingCompleted = 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>
</div>
<div class="content-container">
<RouterView />
</div>
2026-04-12 09:44:32 +08:00
</template>
<script setup lang="ts">
2026-04-14 08:59:05 +08:00
import { useStatusStore } from '@/stores/useStatusStore';
import { RouterView } from 'vue-router';
2026-04-13 20:55:32 +08:00
import { backgroundImage, mainLogoImage } from '@/assets';
import { useIndex } from '@/hooks/useIndex';
2026-04-12 09:44:32 +08:00
// 获取钩子函数
const { topNavMap, isActive } = useIndex();
2026-04-12 09:44:32 +08:00
</script>
<style scoped>
.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-12 09:44:32 +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-12 09:44:32 +08:00
.nav-list {
2026-04-12 09:44:32 +08:00
margin-left: 100px;
display: flex;
align-items: center;
}
2026-04-12 09:44:32 +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-12 09:44:32 +08:00
.nav-item:hover {
2026-04-12 09:44:32 +08:00
background-color: rgba(255, 255, 255, 0.3);
}
2026-04-12 09:44:32 +08:00
.content-container {
2026-04-12 09:44:32 +08:00
height: 100vh;
width: 100vw;
position: absolute;
top: 0;
left: 0;
}
2026-04-12 09:44:32 +08:00
#main_logo {
2026-04-12 09:44:32 +08:00
height: 50px;
margin-right: 100px;
}
2026-04-12 09:44:32 +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;
}
</style>