Commit 611ad860 authored by 赵茹林's avatar 赵茹林

页面CSS框架优化,菜单与内容滚动条分离

parent 279c38a0
<template> <template>
<div class="integral-page"> <div class="admin-refresh">
<el-form ref="searchFrom" :model="form" style="padding-top: 20px;background: white" label-width="100px" size="small" inline> <el-form ref="searchFrom" :model="form" style="padding-top: 20px;background: white" label-width="100px" size="small" inline>
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
......
...@@ -3,20 +3,22 @@ ...@@ -3,20 +3,22 @@
<el-header> <el-header>
<head-index/> <head-index/>
</el-header> </el-header>
<el-container> <el-container class="refresh-container">
<el-main> <!--<el-main>-->
<transition name="el-fade-in"> <transition name="el-fade-in">
<div class="menu-block"> <div class="menu-block">
<left-menu/> <left-menu/>
</div> </div>
</transition> </transition>
<div class="content"> <!--<div class="content">-->
<el-container class="content">
<div class="router-block"> <div class="router-block">
<!--<tab/>--> <!--<tab/>-->
<router-view class="child-view" v-loading="$store.state.mainLoad"/> <router-view class="child-view" v-loading="$store.state.mainLoad"/>
</div> </div>
</div> </el-container>
</el-main> <!--</div>-->
<!--</el-main>-->
</el-container> </el-container>
</el-container> </el-container>
</template> </template>
...@@ -26,10 +28,10 @@ ...@@ -26,10 +28,10 @@
// import tab from './tab' // import tab from './tab'
export default { export default {
components: {leftMenu, headIndex}, components: {leftMenu, headIndex},
data(){ data() {
return { return {
transitionName: 'slide-left', transitionName: 'slide-left',
menuList:this.$store.state.menuList menuList: this.$store.state.menuList
} }
}, },
computed: { computed: {
...@@ -42,16 +44,43 @@ ...@@ -42,16 +44,43 @@
<style lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.el-header{
.el-header {
background: #333333; background: #333333;
color: white; color: white;
} }
.el-main{
.refresh-container {
height: calc(100% - 60px);
.content {
display: flex;
height: 100%;
.router-block {
position: relative;
width: 100%;
height: 100%;
.child-view {
box-sizing: border-box;
overflow-y: auto;
height: 100%;
/*height: calc(100% - 40px);
width: 100%;
overflow-y: auto;*/
}
}
}
}
.el-main {
margin: 0; margin: 0;
padding: 0; padding: 0;
background: #f8f8f8; background: #f8f8f8;
.menu-block{ .menu-block {
flex-shrink: 0;
float: left; float: left;
height: 100%; height: 100%;
background-color: #333333; background-color: #333333;
...@@ -63,22 +92,10 @@ ...@@ -63,22 +92,10 @@
bottom: 0; bottom: 0;
z-index: 10;*/ z-index: 10;*/
} }
.content{
display: flex;
height: 100%;
.router-block{
width: 100%;
height: 100%;
position: relative;
.child-view{
/*height: calc(100% - 40px);
width: 100%;
overflow-y: auto;*/
}
}
}
} }
.main-container{
.main-container {
height: 100%; height: 100%;
} }
</style> </style>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
background-color="#333333" background-color="#333333"
active-text-color="#ffd04b" active-text-color="#ffd04b"
:collapse="menuType" :collapse="menuType"
class="el-menu-vertical-demo"> class="menu-refresh">
<div class="menu-btn" @click="menuType = !menuType"> <div class="menu-btn" @click="menuType = !menuType">
<i v-if="!menuType" class="iconfont icon-shouqi"></i> <i v-if="!menuType" class="iconfont icon-shouqi"></i>
<i v-if="menuType" class="iconfont icon-zhankai"></i> <i v-if="menuType" class="iconfont icon-zhankai"></i>
...@@ -20,72 +20,85 @@ ...@@ -20,72 +20,85 @@
<template v-for="(item,i) in data.list"> <template v-for="(item,i) in data.list">
<el-menu-item <el-menu-item
v-if="!item.hidden" class="item" v-if="!item.hidden" class="item"
:index="item.path" :key="i">{{item.value}}</el-menu-item> :index="item.path" :key="i">{{item.value}}
</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
</template> </template>
<script> <script>
export default { export default {
name: "leftMenu", name: "leftMenu",
data() { data() {
return { return {
menuList: this.$store.state.menuList, menuList: this.$store.state.menuList,
menuType: false menuType: false
}; };
},
mounted() {
// console.log(this.menuList);
},
methods: {
changeMenuType: function() {
this.$store.state.menuType = !this.$store.state.menuType;
}, },
toPath: function(data) { mounted() {
this.$router.push({ name: data.routerName }); // console.log(this.menuList);
if (this.$store.state.openedTab.indexOf(data) < 0) { },
this.$store.state.openedTab.push(data); methods: {
changeMenuType: function () {
this.$store.state.menuType = !this.$store.state.menuType;
},
toPath: function (data) {
this.$router.push({name: data.routerName});
if (this.$store.state.openedTab.indexOf(data) < 0) {
this.$store.state.openedTab.push(data);
}
} }
} }
} };
};
</script> </script>
<style scoped lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px; .menu-refresh {
} &:not(.el-menu--collapse) {
.el-menu { width: 200px;
background: @bg-b;
color: white;
overflow: auto;
height: 100%;
.menu-btn {
height: 35px;
background: @bg-b-s;
line-height: 35px;
/*text-align: center;*/
i {
font-size: 26px;
float: right;
padding: 0 15px;
} }
}
.el-submenu { &.el-menu {
.menu-icon { overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
height: 100%;
background: @bg-b;
color: white; color: white;
font-size: 18px;
position: relative; .menu-btn {
right: 5px; width: 100%;
} height: 35px;
.el-menu-item { background: @bg-b-s;
background: @main-font-color; line-height: 35px;
} /*text-align: center;*/
.template {
color: black; i {
font-size: 26px;
float: right;
padding: 0 15px;
}
}
.el-submenu {
.menu-icon {
color: white;
font-size: 18px;
position: relative;
right: 5px;
}
.el-menu-item {
background: @main-font-color;
}
.template {
color: black;
}
}
} }
} }
}
</style> </style>
<template> <template>
<div class="integral-page"> <div class="admin-refresh">
<el-form <el-form
ref="searchFrom" ref="searchFrom"
:model="form" :model="form"
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
.user{ .user{
/*height: 100%;*/ /*height: 100%;*/
/*overflow: auto;*/ /*overflow: auto;*/
padding: 20px 0; /*padding: 20px 0;*/
.btn-content{ .btn-content{
text-align: center; text-align: center;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-button type="success" plain @click="add" v-if="!$store.state.readonly">添加不上课日期</el-button> <el-button type="success" plain @click="add" v-if="!$store.state.readonly">添加不上课日期</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="card"> <div class="card" style="margin-bottom: 10px;">
<el-card :body-style="{ padding: '0px' }" v-for="(currentDate, index) in list" :key="index"> <el-card :body-style="{ padding: '0px' }" v-for="(currentDate, index) in list" :key="index">
<span class="time">{{ currentDate }}</span> <span class="time">{{ currentDate }}</span>
<div class="bottom clearfix"> <div class="bottom clearfix">
......
<template> <template>
<div class="qrcode"> <div class="admin-refresh">
<el-form label-width="100px" inline=""> <el-form label-width="100px" inline="" style="padding-top: 10px;">
<el-form-item label="标题"> <el-form-item label="标题">
<el-input/> <el-input/>
</el-form-item> </el-form-item>
......
<template> <template>
<div class="integral-page"> <div class="admin-refresh">
<el-form <el-form
ref="searchFrom" ref="searchFrom"
:model="searchFrom" :model="searchFrom"
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<el-table <el-table
size="mini" size="mini"
:data="userList" :data="userList"
height="calc(100vh - 335px)" height="calc(100vh - 322px)"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="name" prop="name"
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<el-table <el-table
size="mini" size="mini"
:data="userList" :data="userList"
height="calc(100vh - 335px)" height="calc(100vh - 322px)"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="name" prop="name"
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<el-table <el-table
size="mini" size="mini"
:data="userList" :data="userList"
height="calc(100vh - 335px)" height="calc(100vh - 322px)"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="name" prop="name"
......
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