ui设计框架

lijinlong
吕天方 2 months ago
parent 1a6bd8a582
commit 88113a803e

@ -1,12 +1,12 @@
#app {
.main-container {
// height: 100%;
height: 100%;
// height: calc(100% - 50px);
// transition: margin-left .28s;
// margin-left: $base-sidebar-width;
// position: relative;
height: calc(100% - 50px);
// height: calc(100% - 50px);
transition: margin-left .28s;
margin-left: 260px;
position: relative;
@ -21,11 +21,11 @@
transition: width 0.28s;
width: $base-sidebar-width !important;
background-color: $base-menu-background;
// height: 100%;
height: calc(100% - 50px);
height: 100%;
// height: calc(100% - 50px);
position: fixed;
font-size: 0px;
top: 50px;
top: 0;
bottom: 0;
left: 0;
z-index: 1001;

@ -30,7 +30,7 @@ export default {
.app-main {
/* 50= navbar 50 */
border-radius: 5px;
height: calc(100vh - 100px);
height: calc(100vh - 60px);
width: calc(100% - 20px);
position: relative;
// overflow: scroll;

@ -17,25 +17,36 @@
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
</router-link>
</scroll-pane> -->
<div class="tagsView-box">
<img src="@/assets/images/position.png" alt="" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
</div>
<img src="@/assets/images/position.png" alt="" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
<!-- <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> </li>
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> </li>
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> </li>
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
</ul> -->
<header class="app-header">
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
<span class="user-name">{{ name }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</header>
</div>
</template>
<script>
import ScrollPane from './ScrollPane'
import Breadcrumb from '@/components/Breadcrumb'
import { mapGetters } from 'vuex'
import path from 'path'
export default {
@ -60,6 +71,10 @@ export default {
// theme() {
// return this.$store.state.settings.theme;
// }
...mapGetters([
'avatar',
'name'
]),
},
watch: {
// $route() {
@ -79,6 +94,17 @@ export default {
// this.addTags()
},
methods: {
async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/index';
})
}).catch(() => {});
},
isActive(route) {
return route.path === this.$route.path
},
@ -249,107 +275,87 @@ export default {
<style lang="scss" scoped>
.tags-view-container {
height: 34px;
height: 50px;
width: 100%;
// background: #fff;
display: flex;
align-items: center;
// border-bottom: 1px solid #d8dce5;
// box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
display: flex;
align-items: center;
justify-content: space-between;
.tagsView-box {
height: 100%;
display: flex;
align-items: center;
}
img {
width: 14px;
margin-right: 10px;
}
// .tags-view-wrapper {
.tags-view-item {
.app-header {
height: 100%;
padding: 0px 20px;
box-sizing: border-box;
display: flex;
align-items: center;
.right-box {
display: flex;
align-items: center;
}
.right-menu-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 26px;
line-height: 26px;
// border: 1px solid #d8dce5;
// color: #495060;
// background: #fff;
// padding: 0 8px;
font-size: 14px;
font-weight: 400;
color: #292F38;
// margin-left: 5px;
margin-top: 4px;
// &:first-of-type {
// margin-left: 15px;
// }
// &:last-of-type {
// margin-right: 15px;
// }
span {
margin: 0 2px;
}
&.active {
background-color: #42b983;
color: #fff;
border-color: #42b983;
&::before {
content: '';
background: #fff;
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
position: relative;
margin-right: 2px;
padding: 0 8px;
height: 100%;
font-size: 18px;
color: #5a5e66;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background .3s;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
}
// }
.contextmenu {
margin: 0;
background: #fff;
z-index: 3000;
position: absolute;
list-style-type: none;
padding: 5px 0;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #333;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
li {
margin: 0;
padding: 7px 16px;
cursor: pointer;
&:hover {
background: #eee;
}
}
}
}
</style>
<style lang="scss">
//reset element css of el-icon-close
.tags-view-wrapper {
.tags-view-item {
.el-icon-close {
width: 16px;
height: 16px;
vertical-align: 2px;
border-radius: 50%;
text-align: center;
transition: all .3s cubic-bezier(.645, .045, .355, 1);
transform-origin: 100% 50%;
&:before {
transform: scale(.6);
display: inline-block;
vertical-align: -3px;
}
&:hover {
background-color: #b4bccc;
color: #fff;
.avatar-container {
margin-right: 30px;
.avatar-wrapper {
position: relative;
display: flex;
align-items: center;
.user-name {
line-height: 50px;
font-weight: 400;
font-size: 14px;
color: #192733;
}
.user-avatar {
cursor: pointer;
width: 30px;
height: 30px;
border-radius: 50%;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 20px;
font-size: 12px;
}
}
}
}
}
</style>

@ -1,27 +1,6 @@
<template>
<!-- :class="classObj" -->
<div class="app-wrapper" :style="{'--current-color': theme}">
<header class="app-header">
<div class="header-title"><span>太仓资产核查管理系统</span></div>
<div class="right-box">
<div class="right-menu">
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</header>
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
@ -107,83 +86,6 @@ export default {
position: relative;
height: 100%;
width: 100%;
.app-header {
background-color: #304156;
background-color: #3f3f3f;
height: 50px;
padding: 0px 20px;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
.header-title {
display: flex;
align-items: center;
height: 50px;
line-height: 50px;
color: #fff;
img {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
.right-box {
display: flex;
align-items: center;
}
.right-menu {
margin-left: 40px;
float: right;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 8px;
height: 100%;
font-size: 18px;
color: #5a5e66;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background .3s;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
}
.avatar-container {
margin-right: 30px;
.avatar-wrapper {
margin-top: 5px;
position: relative;
.user-avatar {
cursor: pointer;
width: 30px;
height: 30px;
border-radius: 50%;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 10px;
font-size: 12px;
}
}
}
}
}
&.mobile.openSidebar {
position: fixed;
top: 0;

Loading…
Cancel
Save