济菏高速业务端
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.

571 lines
16 KiB

1 year ago
<template>
1 year ago
<div>
1 year ago
<template v-if="sideTheme == 'theme-dark' ||
sideTheme == 'theme-light' ||
sideTheme == 'theme-blue'
">
1 year ago
<div :class="classObj" class="app-wrapper">
1 year ago
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg mapBox" @click="handleClickOutside" />
1 year ago
<!-- 左右结构 -->
1 year ago
<template v-if="topNav == false">
<sidebar class="sidebar-container" />
1 year ago
<div :class="{ hasTagsView: needTagsView }" class="main-container" :style="fixedHeaderClass">
<div :class="{ 'fixed-header': fixedHeader }" :style="fixedHeader ? 'background-color:white;' : ''">
1 year ago
<navbar style="display: block; height: 7.6vh" />
<!-- <tags-view v-if="needTagsView" /> -->
1 year ago
</div>
1 year ago
<div :class="getRoute2($route.path) ? '' : 'breadcrumbAppmainBox'" style="height: 100%">
<breadcrumb :style="'display:' + getRoute($route.path) + ';'" ref="Breadcrumb" id="breadcrumb-container"
class="breadcrumb-container" />
1 year ago
<app-main />
</div>
1 year ago
<right-panel>
<settings />
</right-panel>
</div>
</template>
1 year ago
<!-- 上下结构 -->
1 year ago
<template v-else>
1 year ago
<div :class="{ 'fixed-header': fixedHeader }" :style="fixedHeader ? 'width:100%;' : ''"
v-if="titleHeader == '0'">
<div :class="$route.path == '/map/map3d/index'
? 'topNav_head mapBox'
: $route.path == '/energy'
1 year ago
? 'topNav_head mapBox'
: 'topNav_head'
1 year ago
">
<sidebar class="sidebar-container index_menu blue_index_menu" style="
1 year ago
width: 75% !important;
position: relative;
box-shadow: unset;
float: left;
display: flex;
align-items: center;
1 year ago
" />
1 year ago
<template v-if="weatherView">
<div class="weather">
<img :src="weather_weatherimg" />
<p>{{ weather_weather }}</p>
</div>
</template>
1 year ago
<navbar :class="sideTheme == 'theme-light'
? 'theme-light-navbar'
: 'theme-dark-navbar'
" :style="weatherView
? 'width: 15%!important;justify-content:right;'
: 'width: 25%;justify-content:right;display:flex'
" />
1 year ago
</div>
</div>
1 year ago
<!-- 标题放中间 -->
1 year ago
<div :class="{ 'fixed-header': fixedHeader }" :style="fixedHeader ? 'width:100%;' : ''"
v-if="titleHeader == '1'">
<div :class="$route.path == ('/map/map3d/index' || '/energy')
? 'topNav_head_center mapBox'
: 'topNav_head_center'
" :style="{
backgroundColor: sideTheme == 'theme-dark' ? ($route.path == '/index' ? '#010913' : '#004375') : '#100A43'
}">
<centerbar style="
1 year ago
width: 100% !important;
height: 7.6vh;
position: relative;
box-shadow: unset;
display: flex;
1 year ago
"></centerbar>
1 year ago
<!-- <sidebar
class="sidebar-container index_menu blue_index_menu"
style="
width: 75% !important;
position: relative;
box-shadow: unset;
float: left;
display: flex;
align-items: center;
"
/> -->
</div>
</div>
1 year ago
<div :class="{ hasTagsView: needTagsView }" class="main-container" :style="fixedHeader
? 'padding-top:50px;margin-left:0px;'
: 'margin-left:0px;'
">
1 year ago
<!-- <div :class=""> -->
<div :class="getRoute2($route.path) ? 'noSeparate' : 'separate'">
1 year ago
<breadcrumb :style="'display:' + getRoute($route.path) + ';'" ref="Breadcrumb" id="breadcrumb-container"
class="breadcrumb-container" />
1 year ago
<app-main />
<right-panel>
<settings />
</right-panel>
<!-- <el-badge
:value="eventValue"
class="eventIcon"
:hidden="badgeHidden"
>
<div
class="el-icon-s-order"
@click="openEventTitleDialog"
></div>
</el-badge> -->
<evtDialogOneThing v-if="evtDialogOneThing"></evtDialogOneThing>
1 year ago
<event-dialog v-if="eventDialogPic" ref="picDialog"></event-dialog>
1 year ago
<event-dialogTable v-if="eventDialogTable"></event-dialogTable>
<evtDialogVideo v-if="evtDialogVideo"></evtDialogVideo>
</div>
1 year ago
</div>
</template>
1 year ago
</div>
1 year ago
</template>
1 year ago
<!-- add -->
1 year ago
<template v-else>
<div :class="classObj" class="app-wrapper">
1 year ago
<div :class="{ 'fixed-header': fixedHeader }">
<div class="topNavHeadBlue">
1 year ago
<sidebarblue class="sidebar-container index_menu blue_index_menu"
style="width: 73% !important; float: left" />
1 year ago
<template v-if="weatherView == true">
<div class="weather">
<img :src="weather_weatherimg" />
<p>{{ weather_weather }}</p>
</div>
</template>
1 year ago
<navbar class="theme-blue-navbar" :style="weatherView
? 'width: 12%!important;height:50px;float:left;'
: 'margin-left:10%;width: 12%!important;height:50px;float:left;'
" />
1 year ago
<div class="clear"></div>
</div>
1 year ago
</div>
1 year ago
<div :class="{ hasTagsView: needTagsView }" class="main-container" :style="fixedHeaderClass">
1 year ago
<div :class="{ 'fixed-header': fixedHeader }"></div>
<template v-if="is_breadcrumb == 'true' && $route.path != '/index'">
1 year ago
<breadcrumb ref="Breadcrumb" id="breadcrumb-container" class="breadcrumb-container"
style="margin-top: 20px; margin-left: 20px" />
1 year ago
</template>
<app-main />
1 year ago
<right-panel>
<settings />
</right-panel>
</div>
</div>
</template>
1 year ago
</div>
</template>
<script>
1 year ago
import Breadcrumb from "@/components/Breadcrumb";
import RightPanel from "@/components/RightPanel";
import TopNav from "@/components/TopNav";
import centerbar from "@/components/centerbar";
import {
AppMain,
Navbar,
Settings,
Sidebar,
TagsView,
Sidebarblue,
} from "./components";
// import {reproductionImage } from '@/components/reproductionImage'
import ResizeMixin from "./mixin/ResizeHandler";
import { mapState } from "vuex";
import variables from "@/assets/styles/variables.scss";
import axios from "axios";
import navBg from "@/assets/logo/nav_bg.png";
import bus from "@/utils/bus";
1 year ago
export default {
1 year ago
name: "Layout",
1 year ago
components: {
1 year ago
Sidebarblue,
Breadcrumb,
1 year ago
AppMain,
Navbar,
RightPanel,
Settings,
Sidebar,
1 year ago
TagsView,
1 year ago
TopNav,
centerbar,
// reproductionImage
1 year ago
},
data() {
return {
1 year ago
// this.$cache.local.get("navigationBar")
titleHeader: this.$cache.local.get("navigationBar"),
evtDialogOneThing: false,
badgeHidden: true,
eventValue: 0,
mapStyle: "",
1 year ago
// 天气
1 year ago
weather_weather: "",
1 year ago
// 天气图标
1 year ago
weather_weatherimg: "",
1 year ago
navBg: navBg,
is_weather: null,
1 year ago
is_breadcrumb: null,
tunnelStyle: null,
eventDialogPic: true,
eventDialogTable: false,
evtDialogVideo: false,
routePath: [
"/index",
"/map/map/index",
"/emergency/administration/dispatch",
"/map/map3d/index",
"/energy",
],
};
1 year ago
},
mixins: [ResizeMixin],
computed: {
...mapState({
1 year ago
sdEventList: (state) => state.websocket.sdEventList,
theme: (state) => state.settings.theme,
sideTheme: (state) => state.settings.sideTheme,
sidebar: (state) => state.app.sidebar,
device: (state) => state.app.device,
needTagsView: (state) => state.settings.tagsView,
weatherView: (state) => state.settings.weatherView,
fixedHeader: (state) => state.settings.fixedHeader,
1 year ago
}),
classObj() {
return {
hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation,
1 year ago
mobile: this.device === "mobile",
};
1 year ago
},
variables() {
1 year ago
return variables;
1 year ago
},
topNav() {
1 year ago
return this.$store.state.settings.topNav;
},
weatherView() {
return this.$store.state.settings.weatherView;
},
fixedHeaderClass() {
let h = 0;
if (this.$route.path == "/index") {
if (this.topNav) {
if (this.fixedHeader) {
h = 50;
}
} else {
if (this.fixedHeader) {
this.needTagsView ? (h = 84) : (h = 50);
}
}
} else {
if (this.topNav) {
if (this.fixedHeader) {
h = 104;
}
} else {
if (this.fixedHeader) {
this.needTagsView ? (h = 84) : (h = 50);
}
}
}
return "padding-top:" + h + "px;";
},
1 year ago
},
created() {
1 year ago
if (this.$route.path == "/tunnel") {
if (
this.sideTheme == "theme-blue" ||
(this.sideTheme == "theme-dark" && this.topNav) ||
(this.sideTheme == "theme-light" && this.topNav)
) {
this.tunnelStyle = "margin-left:0px;background-color:#181b2c;";
} else {
this.tunnelStyle = "margin-left:0px;";
}
} else {
this.tunnelStyle = "margin-left:0px;";
1 year ago
}
},
methods: {
1 year ago
// openEventTitleDialog() {
// if (this.eventDialogTable == false) {
// bus.$emit("openTableDialog");
// this.eventDialogTable = true;
// }
// },
getRoute(path) {
// console.log(path,"path");
var arr = [
"/index",
"/map/map/index",
"/emergency/administration/dispatch",
"/map/map3d/index",
"/energy",
"/map/trafficChart",
"/map/emphasisCars",
"/map/deviceMonitor",
"/map/trackPlayback",
"/map/analyse",
"/zeroCarbon",
];
if (arr.includes(path)) {
return "none";
} else {
return "block";
}
1 year ago
},
1 year ago
getRoute2(path) {
var arr = [
"/index",
"/map/map/index",
"/emergency/administration/dispatch",
"/map/map3d/index",
"/energy",
"/map/trafficChart",
"/map/emphasisCars",
"/map/deviceMonitor",
"/map/trackPlayback",
"/map/analyse",
];
if (arr.includes(path)) {
return true;
} else {
return false;
}
1 year ago
},
1 year ago
// style="$route.path == '/index'?'display:none;':$route.path == '/map/map/index' ?
// 'display:none;':$route.path == '/emergency/administration/dispatch' ?
// 'display:none;':$route.path == '/map/map3d/index'?'display:none;':''"
getWeather() {
let city = "city=济南";
let word = "tianqi";
const key = "key=0c7ebab2461621aeb2c34b3a82e4c702";
const header = "http://api.tianapi.com/txapi";
const url = `${header}/${word}/?${key}&${city}`;
axios.get(url).then((res) => {
if (res.data.newslist) {
const data = res.data.newslist[0];
this.weather_weather =
data.area +
":" +
data.weather +
data.lowest +
data.wind +
data.windsc;
this.weather_weatherimg = require("@/assets/weather/" +
data.weatherimg +
"");
1 year ago
}
1 year ago
});
},
handleClickOutside() {
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
1 year ago
},
1 year ago
},
watch: {
sideTheme(val) {
1 year ago
document.getElementsByTagName("body")[0].className = val;
},
sdEventList(event) {
if (event.length > 0) {
this.evtDialogOneThing = true;
}
// this.eventValue += event.length;
// if (this.eventValue > 0) {
// this.$forceUpdate();
// // this.badgeHidden = false;
// this.eventDialogPic = true;
// }
},
1 year ago
},
mounted() {
1 year ago
if (this.weatherView == undefined) {
this.weatherView = false;
}
this.getWeather();
document.getElementsByTagName("body")[0].className = this.sideTheme;
this.is_breadcrumb = systemConfig.navBarShow(systemConfig.systemType)[
"breadcrumb"
];
// 打开列表弹窗
bus.$on("openTableDialog", () => {
this.eventDialogTable = true;
});
// 关闭列表弹窗
bus.$on("closeDialog", () => {
console.log("关闭一件事弹窗");
this.eventDialogTable = false;
this.evtDialogOneThing = false;
});
// 打开三图一视弹窗
bus.$on("openPicDialog", () => {
this.eventDialogPic = true;
});
// 关闭三图一视弹窗
bus.$on("closePicDialog", () => {
this.eventDialogPic = false;
});
// 打开视频弹窗
bus.$on("openVideoDialog", () => {
this.evtDialogVideo = true;
});
// 关闭视频弹窗
bus.$on("closeVideoDialog", () => {
this.evtDialogVideo = false;
});
// 事件表格忽略后 右上角数字跟着改
// bus.$on("getEvtList", () => {
// this.eventValue = this.eventValue - 1;
// if (this.eventValue == 0) {
// this.badgeHidden = false;
// }
// });
},
};
1 year ago
</script>
<style lang="scss" scoped>
1 year ago
@import "~@/assets/styles/mixin.scss";
@import "~@/assets/styles/variables.scss";
1 year ago
1 year ago
// 区分不同主题下导航栏颜色
1 year ago
.mapBox {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
z-index: 999;
1 year ago
}
1 year ago
1 year ago
// .theme-light-navbar {
// background-color: white;
// }
1 year ago
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
1 year ago
1 year ago
// overflow: hidden;
&.mobile.openSidebar {
1 year ago
position: fixed;
top: 0;
}
1 year ago
}
1 year ago
1 year ago
.topNav_head .has-logo {
background: transparent !important;
}
1 year ago
1 year ago
.has-logo {
background: rgb(0, 67, 117);
}
1 year ago
1 year ago
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
}
.fixed-header {
position: fixed;
top: 0;
right: 0;
z-index: 9;
width: calc(100% - #{$base-sidebar-width});
1 year ago
// transition: width 0.28s;
1 year ago
}
1 year ago
1 year ago
.hideSidebar .fixed-header {
width: calc(100% - 54px);
}
.mobile .fixed-header {
width: 100%;
}
1 year ago
1 year ago
// .theme-light .topNav_head{background-color: #ffffff}
1 year ago
.topNavHeadBlue {
box-shadow: 2px 0 6px rgb(0 21 41 / 35%);
background-size: 100% 100%;
1 year ago
width: 100%;
1 year ago
}
1 year ago
1 year ago
.topNavHeadBlue .index_menu .theme-blue {
background-color: unset !important;
}
1 year ago
1 year ago
.theme-blue-navbar {
box-shadow: unset;
}
1 year ago
1 year ago
.theme-blue {
.theme-blue-navbar {
background-color: unset;
}
1 year ago
}
1 year ago
1 year ago
.weather p {
color: white;
1 year ago
height: 50px;
line-height: 50px;
1 year ago
text-indent: 10px;
white-space: nowrap;
font-size: 14px;
}
1 year ago
1 year ago
.weather img {
width: 25px;
height: 25px;
}
1 year ago
1 year ago
.weather {
display: flex;
justify-content: center;
align-items: center;
1 year ago
width: 11%;
float: left;
1 year ago
}
1 year ago
1 year ago
.theme-blue-box {
height: 100%;
}
1 year ago
1 year ago
.theme-light {
.weather {
p {
color: #000000;
}
1 year ago
}
1 year ago
}
1 year ago
1 year ago
.eventIcon {
1 year ago
position: absolute;
1 year ago
top: calc(100% - 50px);
left: calc(100% - 60px);
width: 40px;
height: 40px;
border-radius: 20px;
z-index: 100;
background: linear-gradient(177deg, #3b87bb, #2b65ae);
text-align: center;
line-height: 40px;
color: white;
1 year ago
}
1 year ago
1 year ago
.el-icon-s-order:before {
font-size: 24px;
1 year ago
}
1 year ago
.main-container>div {
1 year ago
background: rgb(0, 67, 117);
1 year ago
}
1 year ago
</style>