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.
110 lines
2.4 KiB
110 lines
2.4 KiB
<template>
|
|
<div class="screen-header" @click="handelClearMap">
|
|
<div class="left"><span>{{ showYear }}</span> <span>{{ showYearZh }}</span> </div>
|
|
<div class="center">
|
|
<div class="title">数字移风分析展示平台</div>
|
|
</div>
|
|
<div class="right"> <span>{{ showWeek }}</span> <span>{{ showTime }}</span></div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapGetters, mapActions } from 'vuex'
|
|
export default {
|
|
name: 'screen-header',
|
|
data() {
|
|
return {
|
|
showWeek: "",
|
|
showTime: "",
|
|
showYear: "",
|
|
showYearZh: ""
|
|
}
|
|
},
|
|
created() {
|
|
const pollTime = async () => {
|
|
this.computeCurrentTime();
|
|
setTimeout(() => {
|
|
pollTime();
|
|
}, 1000)
|
|
};
|
|
pollTime();
|
|
},
|
|
computed: {
|
|
...mapGetters(['navId'])
|
|
},
|
|
methods: {
|
|
...mapActions({
|
|
set_nav: 'SET_NAV',
|
|
|
|
}),
|
|
computeCurrentTime() {
|
|
let year = new Intl.DateTimeFormat('zh-CN-u-ca-chinese', { dateStyle: 'full' }).format(new Date());
|
|
this.showYearZh = '农历' + year.match(/年(.+)星期/)[1];
|
|
this.showYear = this.$moment().format("yyyy年MMMDo");
|
|
this.showWeek = this.$moment().format("dddd");
|
|
this.showTime = this.$moment().format("LT");
|
|
},
|
|
handelClearMap(){
|
|
if(this.navId == 'whyf'){
|
|
this.set_nav('sy')
|
|
}else{
|
|
this.$EventBus.$emit('switcMapType','Emap')
|
|
|
|
}
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.screen-header {
|
|
width: 100%;
|
|
height: 68.8px;
|
|
background-size: 100% 100%;
|
|
background: url("~@/assets/images/home/header.png") no-repeat;
|
|
background-position: 2.6% 0%;
|
|
position: absolute;
|
|
z-index: 10;
|
|
top: 0;
|
|
left: 0px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 14px;
|
|
padding: 0 16px;
|
|
box-sizing: border-box;
|
|
color: #ACBBD4;
|
|
cursor: pointer;
|
|
.left,
|
|
.right {
|
|
padding: 8px 0 0 0;
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
top: -4px;
|
|
}
|
|
|
|
.center {
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
left: -45px;
|
|
|
|
.logo {
|
|
width: 131px;
|
|
height: 44px;
|
|
}
|
|
|
|
.title {
|
|
font-style: italic;
|
|
font-family: "zaozigongfang";
|
|
background: #f8fdfe;
|
|
background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
color: transparent;
|
|
font-weight: 300;
|
|
font-size: 28px;
|
|
letter-spacing: 2px;
|
|
}
|
|
}
|
|
}</style>
|
|
|