Commit 3fd30c67 authored by yaqizhang's avatar yaqizhang

样式优化

parent b442c2a6
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0px; font-size: 0px;
top: 85px; top: 80px;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1001; z-index: 1001;
......
@font-face {
font-family: 'pingfang';
/* src: url('/assets/fonts/PingFang.ttc'); */
src: url('pingfang1.ttf');
font-weight: normal;
font-style: normal;
}
html,body { font-family: pingfang, sans-serif; }
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<!-- 导航栏左侧图标 --> <!-- 导航栏左侧图标 -->
<!-- <svg-icon :icon-class="item.meta.icon" /> --> <!-- <svg-icon :icon-class="item.meta.icon" /> -->
{{ item.meta.title }}</el-menu-item> {{ item.meta.title }}</el-menu-item>
<div class="menu-item-div"></div>
</template> </template>
<!-- 顶部菜单超出数量折叠 --> <!-- 顶部菜单超出数量折叠 -->
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
<script> <script>
import { constantRoutes } from "@/router"; import { constantRoutes } from "@/router";
import '../../common/font/font.css'
export default { export default {
data() { data() {
return { return {
...@@ -162,24 +163,21 @@ export default { ...@@ -162,24 +163,21 @@ export default {
<style lang="scss"> <style lang="scss">
.el-menu--horizontal > .el-menu-item { .el-menu--horizontal > .el-menu-item {
float: left; float: left;
width: 150px;
height: 80px; height: 80px;
text-align: center; text-align: center;
line-height: 80px; line-height: 80px;
margin: 0; margin: 0 20px;
font-size: 18px;
font-weight: 600;
color: #fff; color: #fff;
/* background-color: #053B6A; */ font-size: 22px;
/* border-bottom: 3px solid transparent; */ font-family: "pingfang";
/* color: #999093; */ font-weight: 600;
text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2);
padding: 0 5px; padding: 0 5px;
margin: 0 20px;
} }
.el-menu--horizontal > .el-menu-item.is-active { .el-menu--horizontal > .el-menu-item.is-active {
border-bottom: 3px solid #{'var(--theme)'}; border-bottom: 3px solid #{'var(--theme)'};
box-shadow: inset 2px 2px 20px #5CD9D4; /* box-shadow: inset 2px 2px 20px #5CD9D4; */
color: #5CD9D4; color: #5CD9D4;
} }
...@@ -191,7 +189,20 @@ export default { ...@@ -191,7 +189,20 @@ export default {
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus{ .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus{
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
/* opacity: 0; */ /* opacity: 0; */
box-shadow: inset 2px 2px 20px #5CD9D4; /* box-shadow: inset 2px 2px 20px #5CD9D4; */
color: #5CD9D4; color: #fff;
}
.menu-item-div{
width: 2px;
height: 30px;
margin-top: 25px;
background-color: rgb(190, 189, 189);
float: left;
background: linear-gradient(130deg, rgba(0, 0, 0, 0) 0%,rgba(255,255,255,0.7) 50%, rgba(0, 0, 0, 0) 100%);
&:last-child {
width: 0px;
height: 0px;
}
} }
</style> </style>
<template> <template>
<div class="navbar"> <div class="navbar">
<div style="float: left;padding: 5px;">
<span style="width: 288px;
height: 43px;
font-size: 30px;
font-family: eryaxindahei;
font-weight: 600;
line-height: 43px;
color: #0FC7C0;
opacity: 1;">燃气综合管理平台</span></div>
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> <el-row :gutter="20">
<el-col :span="18">
<div style="float: left;padding: 5px;">
<!-- 顶部导航 --> <img src="@/assets/logo/top-left-logo.png" alt="" style="margin-top: 15px;">
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> </div>
<!-- 点击左侧二级菜单滑开 -->
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<!-- 顶部导航 -->
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
</el-col>
<el-col :span="6" style="float: right;">
<div class="right-menu"> <div class="right-menu">
<!-- <template v-if="device!=='mobile'"> <!-- <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
...@@ -38,11 +38,12 @@ ...@@ -38,11 +38,12 @@
</template> --> </template> -->
<div class="formatDate"> <div class="formatDate">
<img src="@/assets/logo/formleft.png" alt=""> <span>{{ nowDate }}</span>
<span>{{ nowDate }}</span> </div>
</div> <div class="yhm">{{showUserName}}</div>
<div class="yhm">用户名</div>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar" class="user-avatar"> <img :src="avatar" class="user-avatar">
...@@ -60,7 +61,10 @@ ...@@ -60,7 +61,10 @@
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</el-col>
</el-row>
</div> </div>
</template> </template>
...@@ -72,7 +76,7 @@ import Hamburger from '@/components/Hamburger' ...@@ -72,7 +76,7 @@ import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull' import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect' import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch' import Search from '@/components/HeaderSearch'
import Cookie from 'js-cookie'
export default { export default {
components: { components: {
Breadcrumb, Breadcrumb,
...@@ -88,6 +92,9 @@ export default { ...@@ -88,6 +92,9 @@ export default {
}; };
}, },
computed: { computed: {
showUserName(){
return Cookie.get('username')
},
...mapGetters([ ...mapGetters([
'sidebar', 'sidebar',
'avatar', 'avatar',
...@@ -109,6 +116,7 @@ export default { ...@@ -109,6 +116,7 @@ export default {
return this.$store.state.settings.topNav return this.$store.state.settings.topNav
} }
} }
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
...@@ -184,7 +192,6 @@ export default { ...@@ -184,7 +192,6 @@ export default {
} }
.topmenu-container { .topmenu-container {
width: 1100px;
background-color: red; background-color: red;
position: absolute; position: absolute;
left: 350px; left: 350px;
...@@ -196,7 +203,6 @@ export default { ...@@ -196,7 +203,6 @@ export default {
vertical-align: top; vertical-align: top;
} }
.right-menu { .right-menu {
width: 366px;
float: right; float: right;
height: 100%; height: 100%;
line-height: 80px; line-height: 80px;
...@@ -207,23 +213,20 @@ export default { ...@@ -207,23 +213,20 @@ export default {
outline: none; outline: none;
} }
.formatDate{ .formatDate{
width: 200px;
float: left; float: left;
font-size: 24px; font-size: 20px;
font-family: PingFang SC;
font-weight: 400;
color: #fff; color: #fff;
img{ margin-right: 30px;
height: 100%;
float: left;
}
} }
.yhm{ .yhm{
font-size: 24px; font-size: 20px;
font-family: PingFang SC;
font-weight: 400;
color: #fff; color: #fff;
float: left; float: left;
text-overflow:ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: center;
margin-right: 20px;
} }
.right-menu-item { .right-menu-item {
display: inline-block; display: inline-block;
...@@ -246,7 +249,7 @@ export default { ...@@ -246,7 +249,7 @@ export default {
} }
.avatar-container { .avatar-container {
margin-right: 30px; margin-right: 15px;
.avatar-wrapper { .avatar-wrapper {
margin-top: 5px; margin-top: 5px;
......
...@@ -97,7 +97,8 @@ export default { ...@@ -97,7 +97,8 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
#app .sidebar-container .submenu-title-noDropdown:hover, #app .sidebar-container .el-submenu__title:hover { #app .sidebar-container .submenu-title-noDropdown:hover, #app .sidebar-container .el-submenu__title:hover {
box-shadow: inset 2px 2px 20px #5CD9D4; /* box-shadow: inset 2px 2px 20px #5CD9D4; */
background: rgba(0, 0, 0, 0);
} }
#app .sidebar-container .el-menu-item, #app .sidebar-container .el-submenu__title { #app .sidebar-container .el-menu-item, #app .sidebar-container .el-submenu__title {
overflow: hidden !important; overflow: hidden !important;
...@@ -106,7 +107,10 @@ export default { ...@@ -106,7 +107,10 @@ export default {
} }
.el-menu-item:hover, .el-menu-item:focus,.is-active { .el-menu-item:hover, .el-menu-item:focus,.is-active {
outline: none; outline: none;
box-shadow: inset 2px 2px 20px #5CD9D4; background-image: url("../../../assets/logo/item-background.png");
color: #5CD9D4 !important; background-repeat: no-repeat;
background-size: 100% 100%;
/* background: rgba(0, 0, 0, 0); */
color: #fff !important;
} }
</style> </style>
\ No newline at end of file
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get('rememberMe');
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password), password: password === undefined ? this.loginForm.password : decrypt(password),
...@@ -117,15 +117,22 @@ export default { ...@@ -117,15 +117,22 @@ export default {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
if (this.loginForm.rememberMe) { // if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); // Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); // Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); // Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
} else { // } else {
Cookies.remove("username"); // Cookies.remove("username");
Cookies.remove("password"); // Cookies.remove("password");
Cookies.remove('rememberMe'); // Cookies.remove('rememberMe');
} // }
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => { }).catch(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment