Commit c08b4092 authored by danfuman's avatar danfuman

修改

parent 62e1194f
...@@ -122,6 +122,7 @@ aside { ...@@ -122,6 +122,7 @@ aside {
//main-container全局样式 //main-container全局样式
.app-container { .app-container {
padding: 16px; padding: 16px;
//margin-top: 56px;
} }
.components-container { .components-container {
...@@ -355,6 +356,7 @@ ul, li { ...@@ -355,6 +356,7 @@ ul, li {
background: #DCEBFF; background: #DCEBFF;
} }
.el-table__fixed{ .el-table__fixed{
bottom:0 !important;
tr:nth-child(2n){ tr:nth-child(2n){
background-color: #F8FBFF; background-color: #F8FBFF;
} }
......
<template> <template>
<div id="navBar" class="navbar"> <div ref="navbarWidth" style="width: 100%;background: #ffffff;height: 56px;" >
<div id="navBar" class="navbar" :style="{width: navbarWidth}">
<div class="left-menu" :style="{width: scrollerWidth}"> <div class="left-menu" :style="{width: scrollerWidth}">
<tags-view /> <tags-view />
</div> </div>
<div ref="rightMenu" class="flex-box right-menu"> <div ref="rightMenu" class="flex-box right-menu">
<!-- <div class="menu-bells"><img src="@/assets/images/message.png"><i /></div>--> <!-- <div class="menu-bells"><img src="@/assets/images/message.png"><i /></div>-->
<!-- <i class="menu-line" />--> <!-- <i class="menu-line" />-->
<el-dropdown class="avatar-container" trigger="hover"> <el-dropdown class="avatar-container" trigger="hover">
<div class="flex-box avatar-wrapper"> <div class="flex-box avatar-wrapper">
<img v-if="avatar" class="pic-avatar" :src="avatar"> <img v-if="avatar" class="pic-avatar" :src="avatar">
...@@ -23,20 +24,23 @@ ...@@ -23,20 +24,23 @@
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import elementResizeDetectorMaker from "element-resize-detector" import elementResizeDetectorMaker from "element-resize-detector"
import TagsView from './TagsView' import TagsView from './TagsView'
export default { export default {
props:['offsetWidth'],
components: { components: {
TagsView TagsView
}, },
data() { data() {
return { return {
scrollerWidth: null scrollerWidth: null,
navbarWidth: null
} }
}, },
computed: { computed: {
...@@ -46,6 +50,11 @@ export default { ...@@ -46,6 +50,11 @@ export default {
'name' 'name'
]) ])
}, },
watch: {
offsetWidth(newValue, oldValue){
this.navbarWidth=`calc(100% - ${newValue}px)`
}
},
mounted() { mounted() {
const _this = this, erd = elementResizeDetectorMaker(), navBar = document.getElementById("navBar") const _this = this, erd = elementResizeDetectorMaker(), navBar = document.getElementById("navBar")
erd.listenTo(navBar, element => { erd.listenTo(navBar, element => {
...@@ -55,6 +64,7 @@ export default { ...@@ -55,6 +64,7 @@ export default {
this.scrollerWidth = (nvWidth - rtWidth - 100)+'px' || '800px' this.scrollerWidth = (nvWidth - rtWidth - 100)+'px' || '800px'
}) })
}) })
this.navbarWidth=`calc(100% - ${this.offsetWidth}px)`
}, },
methods: { methods: {
async logout() { async logout() {
...@@ -67,7 +77,7 @@ export default { ...@@ -67,7 +77,7 @@ export default {
location.href = '/index'; location.href = '/index';
}) })
}).catch(() => {}); }).catch(() => {});
} },
} }
} }
</script> </script>
...@@ -76,9 +86,12 @@ export default { ...@@ -76,9 +86,12 @@ export default {
.navbar { .navbar {
height: 56px; height: 56px;
overflow: inherit; overflow: inherit;
position: relative; /*position: relative;*/
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0,21,41,.08);
position: fixed;
top:0;
z-index: 9999;
.left-menu{ .left-menu{
float: left; float: left;
......
...@@ -90,6 +90,7 @@ export default { ...@@ -90,6 +90,7 @@ export default {
height: 100%; height: 100%;
padding-top: 24px; padding-top: 24px;
margin-bottom: 0 !important; margin-bottom: 0 !important;
overflow: auto;
} }
.is-horizontal{ .is-horizontal{
width: 0; width: 0;
......
<template> <template>
<div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}"> <div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}">
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar v-if="!sidebar.hide" class="sidebar-container" @handleBar="handleSideBar"/> <sidebar v-if="!sidebar.hide" class="sidebar-container" @handleBar="handleSideBar" id="sidebar"/>
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container"> <div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
<div :class="{'fixed-header':fixedHeader}"> <div :class="{'fixed-header':fixedHeader}">
<navbar :is-side-bar="isSideBar"/> <navbar :offsetWidth="offsetWidth"/>
</div> </div>
<app-main/> <app-main/>
<right-panel> <right-panel>
...@@ -21,7 +20,7 @@ import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components' ...@@ -21,7 +20,7 @@ import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import variables from '@/assets/styles/variables.scss' import variables from '@/assets/styles/variables.scss'
import elementResizeDetectorMaker from "element-resize-detector"
export default { export default {
name: 'Layout', name: 'Layout',
components: { components: {
...@@ -35,7 +34,8 @@ export default { ...@@ -35,7 +34,8 @@ export default {
mixins: [ResizeMixin], mixins: [ResizeMixin],
data() { data() {
return { return {
isSideBar: '' isSideBar: '',
offsetWidth:null,
} }
}, },
computed: { computed: {
...@@ -59,13 +59,25 @@ export default { ...@@ -59,13 +59,25 @@ export default {
return variables; return variables;
} }
}, },
mounted(){
this.$nextTick(() => {
this.listenSider()
})
},
methods: { methods: {
handleClickOutside() { handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
}, },
handleSideBar(val) { handleSideBar(val) {
this.isSideBar = val this.isSideBar = val
} this.listenSider()
},
listenSider(){
const _this = this, erd = elementResizeDetectorMaker(), partBox = document.getElementById("sidebar")
erd.listenTo(partBox, element => {
this.offsetWidth=partBox.offsetWidth;
})
},
} }
} }
</script> </script>
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<span class="flex-box" @click="handleMessage"><img src="@/assets/images/ability_excel.png">导出EXCEL</span> <span class="flex-box" @click="handleMessage"><img src="@/assets/images/ability_excel.png">导出EXCEL</span>
</div> </div>
</div> </div>
<div class="table-item"> <div class="table-item" ref="regionalStyle">
<!--<div class="table-title" :class="fixed == true ? 'fixed' : ''" :style="'width:' + StyWidth">-->
<div class="table-title"> <div class="table-title">
<span class="span-tit">指标</span> <span class="span-tit">指标</span>
<span class="span-tit"> <span class="span-tit">
...@@ -288,7 +289,9 @@ export default { ...@@ -288,7 +289,9 @@ export default {
value4Flag:false, value4Flag:false,
value5Flag:false, value5Flag:false,
regionData:[], regionData:[],
compareList:[{},{},{},{},{}] compareList:[{},{},{},{},{}],
fixed: false,
StyWidth:null
} }
}, },
watch: { watch: {
...@@ -296,6 +299,12 @@ export default { ...@@ -296,6 +299,12 @@ export default {
console.log(newValue) console.log(newValue)
} }
}, },
mounted(){
// window.addEventListener('scroll', this.handleScroll);
},
destroyed () {
// window.removeEventListener('scroll', this.handleScroll)
},
created() { created() {
this.dataRegion(); this.dataRegion();
// this.getData(); // this.getData();
...@@ -331,6 +340,10 @@ export default { ...@@ -331,6 +340,10 @@ export default {
this.getData(params) this.getData(params)
} }
}) })
this.$nextTick(function () {
this.StyWidth = this.$refs.regionalStyle.offsetWidth + 'px';
})
}, },
computed: { computed: {
getHeaders() { getHeaders() {
...@@ -343,6 +356,14 @@ export default { ...@@ -343,6 +356,14 @@ export default {
} }
}, },
methods: { methods: {
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
if (scrollTop > 145) {
this.fixed = true
} else {
this.fixed = false
}
},
getData(params){ getData(params){
params.year=this.queryParams.year; params.year=this.queryParams.year;
multipleCompare(params).then(res => { multipleCompare(params).then(res => {
...@@ -631,6 +652,7 @@ export default { ...@@ -631,6 +652,7 @@ export default {
} }
.table-item{ .table-item{
margin-top: 22px; margin-top: 22px;
position: relative;
::v-deep .el-table{ ::v-deep .el-table{
.el-table__body{ .el-table__body{
width: 100% !important; width: 100% !important;
...@@ -643,7 +665,7 @@ export default { ...@@ -643,7 +665,7 @@ export default {
} }
} }
.table-title{ .table-title{
width: 100%; /*width: 100%;*/
display: flex; display: flex;
/*justify-content:space-around;*/ /*justify-content:space-around;*/
border: 1px solid #E6EAF1; border: 1px solid #E6EAF1;
...@@ -677,5 +699,10 @@ export default { ...@@ -677,5 +699,10 @@ export default {
} }
} }
} }
.fixed{
position: fixed;
z-index: 999;
top: 56px;
}
} }
</style> </style>
<template> <template>
<div class="app-container urban"> <div class="app-container urban" ref="urban">
<div class="content"> <div class="content" ref="queryForm">
<div class="flex-box query-box"> <div class="flex-box query-box">
<div class="flex-box query-params"> <div class="flex-box query-params">
<span class="common-title">城投平台</span> <span class="common-title">城投平台</span>
...@@ -296,7 +296,9 @@ export default { ...@@ -296,7 +296,9 @@ export default {
customerId:'', customerId:'',
companyId:'', companyId:'',
show_page:true, show_page:true,
MaxPage:500 MaxPage:500,
// 表格高度
tableHeight: 0,
} }
}, },
watch:{ watch:{
...@@ -317,6 +319,15 @@ export default { ...@@ -317,6 +319,15 @@ export default {
this.getType() this.getType()
this.querySubmit() this.querySubmit()
}, },
mounted() {
this.$nextTick(() => {
// window.innerHeight 浏览器窗口的可见高度,下面的 220 是除了table最大高度的剩余空间。
// let height = this.$refs.urban.offsetHeight - this.$refs.queryForm.offsetHeight;
// this.tableHeight = height;
// console.log(window.innerHeight,"|||||||||")
// console.log(this.$refs.urban.offsetHeight)
})
},
methods: { methods: {
getType(){ getType(){
uipGroupData({}).then(res => { uipGroupData({}).then(res => {
......
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