<template>
|
<div class="pageHeader">
|
<div class="headTitle">电机试验集中测控平台</div>
|
<div class="headInfoCon">
|
<div class="info">网络状态:正常<div class="tai"
|
style="background:#82e866;width:12px;height:12px;border-radius:50%;margin-left:4px;">
|
</div>
|
</div>
|
<div class="scrollCon">
|
<div :class="{'active':isaralm}" :style="{'marginLeft':nomargin?'0':'100%'}"><i
|
class="el-icon-message-solid" @click="showAlarm"></i><span v-html="notice" v-if="alarmTextFlag"></span>
|
</div>
|
</div>
|
</div>
|
<div class="headToolsCon">
|
<div class="avatar">
|
<span class="avatar-icon">
|
<i class="el-icon-s-home"></i>
|
</span>
|
<span class="avatar-text" @click="logout">退出登录</span>
|
</div>
|
<div class="avatar">
|
<span class="avatar-icon">
|
<i class="el-icon-user-solid"></i>
|
</span>
|
<el-dropdown @command="commandClick">
|
<span class="avatar-text">
|
{{username}}<i class="el-icon-arrow-down el-icon--right"></i>
|
</span>
|
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-item command="passwordChange">密码修改</el-dropdown-item>
|
</el-dropdown-menu>
|
</el-dropdown>
|
</div>
|
</div>
|
|
<!-- 密码修改 -->
|
<el-dialog title="密码修改" width="400px" :visible.sync="pwd.show" :close-on-click-modal="false" top="0"
|
class="dialog-center" :modal-append-to-body="false">
|
<pwd-change v-if="pwd.show" :visible.sync="pwd.show"></pwd-change>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import PwdChange from "@/components/PwdChange";
|
export default {
|
components: {
|
PwdChange,
|
},
|
data() {
|
return {
|
username: this.$store.state.user.username,
|
pwd: {
|
show: false,
|
},
|
notice: '直流主配电柜A排电压过高报警',
|
isaralm: true,
|
nomargin: false,
|
alarmTextFlag: true,
|
}
|
},
|
mounted() {
|
setTimeout(() => {
|
this.isaralm = false;
|
this.nomargin = true;
|
this.alarmTextFlag = false;
|
}, 8000)
|
},
|
methods: {
|
logout() {
|
this.$store.dispatch('setLogin');
|
this.$router.push({
|
path: '/login'
|
});
|
},
|
passwordChange() {
|
this.pwd.show = true;
|
},
|
commandClick(name) {
|
switch (name) {
|
case "passwordChange":
|
this.passwordChange();
|
break;
|
default:
|
this.$layer.msg('该功能暂未开放!');
|
break;
|
}
|
},
|
showAlarm() {
|
// 不为true点击有效
|
if(!this.alarmTextFlag) {
|
this.alarmTextFlag = true;
|
setTimeout(()=>{
|
this.alarmTextFlag = false;
|
}, 4000);
|
}
|
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.pageHeader {
|
width: 100%;
|
height: 100px;
|
position: relative;
|
}
|
|
.headTitle {
|
width: 100%;
|
height: 86px;
|
line-height: 86px;
|
font-size: 36px;
|
color: #ffffff;
|
letter-spacing: 3px;
|
text-align: center;
|
text-indent: -40px;
|
}
|
|
.headToolsCon {
|
height: 40px;
|
position: absolute;
|
right: 0;
|
bottom: 0;
|
z-index: 2;
|
display: flex;
|
align-items: center;
|
flex-direction: row-reverse;
|
padding-right: 40px;
|
}
|
|
.headInfoCon {
|
height: 40px;
|
position: absolute;
|
left: 0;
|
bottom: 0;
|
z-index: 2;
|
display: flex;
|
align-items: center;
|
;
|
padding-left: 40px;
|
}
|
|
.headInfoCon .info {
|
font-size: 16px;
|
display: flex;
|
align-items: center;
|
border-right: 1px solid #ffffff;
|
padding-right: 8px;
|
margin-right: 8px;
|
}
|
|
.headInfoCon .scrollCon {
|
font-size: 16px;
|
width: 290px;
|
overflow: hidden;
|
color: #f78989;
|
}
|
|
.headInfoCon .scrollCon>div {
|
margin-left: 100%;
|
width: 290px;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
display: flex;
|
align-items: center;
|
}
|
|
.headInfoCon .scrollCon>div.active {
|
animation: myMove 6s linear 1;
|
animation-fill-mode: forwards;
|
}
|
|
.headInfoCon .scrollCon>div i {
|
font-size: 20px;
|
}
|
|
/*文字无缝滚动*/
|
@keyframes myMove {
|
0% {
|
transform: translateX(0);
|
}
|
|
100% {
|
transform: translateX(-290px);
|
}
|
}
|
|
.avatar {
|
display: inline-block;
|
margin-right: 30px;
|
cursor: pointer;
|
color: #e4e3e3;
|
}
|
|
.avatar:hover {
|
color: #FFFFFF;
|
}
|
|
.avatar .el-icon-arrow-down {
|
transform: rotate(-90deg);
|
}
|
|
.avatar-icon {
|
display: inline-flex;
|
width: 30px;
|
height: 30px;
|
border-radius: 50%;
|
justify-content: center;
|
background-color: #727ff3;
|
align-items: center;
|
color: #171350;
|
}
|
|
.avatar-icon .iconfont {
|
font-size: 16px;
|
}
|
|
.avatar-text {
|
color: #ffffff;
|
margin-left: 8px;
|
font-size: 16px;
|
}
|
|
.avatar-text .el-icon-arrow-down {
|
margin-left: 4px;
|
}
|
</style>
|