You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

86 lines
1.7 KiB

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
const emit = defineEmits(['toggle-sidebar'])
const route = useRoute()
const titles = {
monitor: '实时监控',
devices: '设备管理',
'device-detail': '设备详情',
control: '设备控制',
tasks: '任务管理',
replay: '任务回放',
media: '媒体中心',
alarms: '告警运维',
account: '账户中心',
users: '用户列表',
firmwares: '固件管理',
system: '系统管理',
logs: '操作日志',
}
const pageTitle = computed(() => titles[route.name] || '嘉谷低空智控平台')
</script>
<template>
<div :class="s.root">
<t-button :class="s.mobileMenu" shape="square" variant="text" type="button" title="打开导航" @click="emit('toggle-sidebar')">
<svg><use href="#i-menu" /></svg>
</t-button>
<div :class="s.title">{{ pageTitle }}</div>
<div :class="s.spacer" />
</div>
</template>
<style lang="less" module="s">
.root {
height: 56px;
padding: 0 16px;
display: flex;
align-items: center;
gap: 12px;
background: #fff;
border-bottom: 1px solid #e7edf2;
}
.mobileMenu {
display: none;
width: 36px;
height: 36px;
border: 0;
border-radius: 8px;
background: rgba(26, 43, 54, 0.76);
color: #fff;
align-items: center;
justify-content: center;
cursor: pointer;
svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
}
.title {
font-size: 16px;
font-weight: 600;
color: #1f2a33;
}
.spacer {
flex: 1;
}
@media (max-width: 1020px) {
.mobileMenu {
display: inline-flex;
}
}
</style>