|
|
@@ -1,25 +1,22 @@
|
|
|
<template>
|
|
|
<div class="navbar">
|
|
|
- <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
|
|
+ <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container"
|
|
|
+ @toggleClick="toggleSideBar" />
|
|
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!settingsStore.topNav" />
|
|
|
<top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" />
|
|
|
|
|
|
<div class="right-menu flex align-center">
|
|
|
<template v-if="appStore.device !== 'mobile'">
|
|
|
- <el-select
|
|
|
- v-model="companyName"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- reserve-keyword
|
|
|
- :placeholder="$t('navbar.selectTenant')"
|
|
|
- v-if="userId === 1 && tenantEnabled"
|
|
|
- @change="dynamicTenantEvent"
|
|
|
- @clear="dynamicClearEvent"
|
|
|
- >
|
|
|
- <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"> </el-option>
|
|
|
+ <div style="margin-right: 100px;">
|
|
|
+ <el-button type="primary" @click="goHome()">大屏</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-select v-model="companyName" clearable filterable reserve-keyword :placeholder="$t('navbar.selectTenant')"
|
|
|
+ v-if="userId === 1 && tenantEnabled" @change="dynamicTenantEvent" @clear="dynamicClearEvent">
|
|
|
+ <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId">
|
|
|
+ </el-option>
|
|
|
<template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
|
|
|
</el-select>
|
|
|
-
|
|
|
<!-- <header-search id="header-search" class="right-menu-item" /> -->
|
|
|
<search-menu ref="searchMenuRef" />
|
|
|
<el-tooltip content="搜索" effect="dark" placement="bottom" v-if="false">
|
|
|
@@ -28,7 +25,7 @@
|
|
|
</div>
|
|
|
</el-tooltip>
|
|
|
<!-- 消息 -->
|
|
|
- <el-tooltip :content="$t('navbar.message')" effect="dark" placement="bottom" >
|
|
|
+ <el-tooltip :content="$t('navbar.message')" effect="dark" placement="bottom">
|
|
|
<div>
|
|
|
<el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
|
|
<template #reference>
|
|
|
@@ -147,6 +144,10 @@ const initTenantList = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const goHome = () =>{
|
|
|
+ window.open("/home")
|
|
|
+}
|
|
|
+
|
|
|
defineExpose({
|
|
|
initTenantList,
|
|
|
})
|
|
|
@@ -156,29 +157,29 @@ const toggleSideBar = () => {
|
|
|
}
|
|
|
|
|
|
const logout = async () => {
|
|
|
- await ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- await userStore.logout()
|
|
|
- location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
|
|
+ await ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ await userStore.logout()
|
|
|
+ location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
|
|
}
|
|
|
|
|
|
const emits = defineEmits(['setLayout'])
|
|
|
const setLayout = () => {
|
|
|
- emits('setLayout');
|
|
|
+ emits('setLayout');
|
|
|
}
|
|
|
// 定义Command方法对象 通过key直接调用方法
|
|
|
-const commandMap: {[key: string]: any} = {
|
|
|
- setLayout,
|
|
|
- logout
|
|
|
+const commandMap: { [key: string]: any } = {
|
|
|
+ setLayout,
|
|
|
+ logout
|
|
|
};
|
|
|
const handleCommand = (command: string) => {
|
|
|
- // 判断是否存在该方法
|
|
|
- if (commandMap[command]) {
|
|
|
- commandMap[command]();
|
|
|
- }
|
|
|
+ // 判断是否存在该方法
|
|
|
+ if (commandMap[command]) {
|
|
|
+ commandMap[command]();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//用深度监听 消息
|
|
|
@@ -188,13 +189,12 @@ watch(() => noticeStore.state.value.notices, (newVal, oldVal) => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
:deep(.el-select .el-input__wrapper) {
|
|
|
- height:30px;
|
|
|
+ height: 30px;
|
|
|
}
|
|
|
|
|
|
-:deep(.el-badge__content.is-fixed){
|
|
|
- top: 12px;
|
|
|
+:deep(.el-badge__content.is-fixed) {
|
|
|
+ top: 12px;
|
|
|
}
|
|
|
|
|
|
.flex {
|