|
@@ -5,8 +5,9 @@
|
|
|
<div style="flex:100" class="body__panel">
|
|
|
<headeTemp></headeTemp>
|
|
|
<div>
|
|
|
- <menuTemp class="sticky normal-margin" :style="marginTrue ? 'margin-bottom:70px !important' : 'margin-bottom:16px'" ref="menu"></menuTemp>
|
|
|
- <div class="radius">
|
|
|
+<!-- <menuTemp class="sticky normal-margin" :style="marginTrue ? 'margin-bottom:70px !important' : 'margin-bottom:16px'" ref="menu" style="background: red"></menuTemp>-->
|
|
|
+ <menuTemp class="sticky normal-margin" ref="menu" ></menuTemp>
|
|
|
+ <div class="radius" ref="divContent" :style="{'marginTop':divTop,'height':divHeight}">
|
|
|
<keep-alive :include="pageCache">
|
|
|
<router-view></router-view>
|
|
|
</keep-alive>
|
|
@@ -34,7 +35,8 @@ export default {
|
|
|
asideTemp,
|
|
|
menuTemp,
|
|
|
navTemp,
|
|
|
- socketMessage
|
|
|
+ socketMessage,
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
@@ -44,7 +46,9 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
timer:null,
|
|
|
- marginTrue:false
|
|
|
+ marginTrue:false,
|
|
|
+ divHeight:'',
|
|
|
+ divTop:''
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -56,23 +60,41 @@ export default {
|
|
|
clearTimeout(this.timer)
|
|
|
}
|
|
|
this.timer = setTimeout(() => {
|
|
|
- if (this.$refs.menu.$el.clientWidth < 1206 && Array.from(this.$refs.menu.$el.getElementsByTagName('li')).filter(item => item.className.indexOf('el-submenu') != -1).length > 8) {
|
|
|
+ console.log(this.$refs.menu.$refs.menuList.$el.clientHeight,'高度')
|
|
|
+ console.log(this.$refs.menu.$refs.menuList.$el.clientHeight / 60)
|
|
|
+ let size = this.$refs.menu.$refs.menuList.$el.clientHeight / 60 -1
|
|
|
+ if (this.$refs.menu.$refs.menuList.$el.clientHeight === 120){
|
|
|
+ this.divTop =(this.$refs.menu.$refs.menuList.$el.clientHeight - (45 * size)) + 'px'
|
|
|
+ }else {
|
|
|
+ this.divTop = 0 + 'px'
|
|
|
+ }
|
|
|
+
|
|
|
+ /* this.divHeight = (this.$refs.divContent.clientHeight - this.$refs.menu.$refs.menuList.$el.clientHeight + 10) + 'px'*/
|
|
|
+ console.log(this.divTop,this.divHeight)
|
|
|
+ /* if (this.$refs.menu.$el.clientWidth < 1206 && Array.from(this.$refs.menu.$el.getElementsByTagName('li')).filter(item => item.className.indexOf('el-submenu') != -1).length > 8) {
|
|
|
this.marginTrue = true
|
|
|
} else {
|
|
|
this.marginTrue = false
|
|
|
- }
|
|
|
+ }*/
|
|
|
},200)
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.debouned()
|
|
|
+ /* console.log('长度')
|
|
|
+ console.log(this.$refs.menu.$refs.menuList.$el.clientHeight,'高度')
|
|
|
+ console.log(this.$refs.menu.$refs.menuList.$el.clientHeight % 60)
|
|
|
+ if (this.$refs.menu.$refs.menuList.$el.clientHeight === 120){
|
|
|
+ this.divTop =(this.$refs.menu.$refs.menuList.$el.clientHeight - 50) + 'px'
|
|
|
+ }else {
|
|
|
+ this.divTop = 0 + 'px'
|
|
|
+ }*/
|
|
|
+ },
|
|
|
created() {
|
|
|
- window.addEventListener('resize',this.debouned)
|
|
|
|
|
|
+ window.addEventListener('resize',this.debouned)
|
|
|
this.$nextTick(() => {
|
|
|
- if (this.$refs.menu.$el.clientWidth < 1206) {
|
|
|
- this.marginTrue = true
|
|
|
- } else {
|
|
|
- this.marginTrue = false
|
|
|
- }
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
}
|