Browse Source

环境监测大屏 适配/linechart-resize

master
xuhuajiao 3 years ago
parent
commit
3a1fa86931
  1. 25
      src/views/environmentalScreen/index.vue
  2. 14
      src/views/environmentalScreen/module/lineChart.vue

25
src/views/environmentalScreen/index.vue

@ -361,7 +361,8 @@ export default {
margin-top: -12px; margin-top: -12px;
.env-main-left, .env-main-left,
.env-main-right{ .env-main-right{
width: 458px;
max-width: 24%;
flex: 1;
height: calc(100vh - 138px); height: calc(100vh - 138px);
overflow: hidden; overflow: hidden;
} }
@ -415,11 +416,13 @@ export default {
.screen-env-list{ .screen-env-list{
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
height: calc(100% - 38px);
padding: 0 44px 0 4px; padding: 0 44px 0 4px;
li{ li{
flex: none; flex: none;
width: calc(100%/2 - 44px); width: calc(100%/2 - 44px);
margin: 15px 0 0 40px;
margin: 20px 0 20px 40px;
height: calc(100%/2 - 40px);
.msg-list-svg{ .msg-list-svg{
font-size: 40px; font-size: 40px;
margin-left: 20px; margin-left: 20px;
@ -435,16 +438,18 @@ export default {
padding: 0 44px; padding: 0 44px;
font-size: 14px; font-size: 14px;
color: #339CFF; color: #339CFF;
margin-top: -3px;
height: calc(100% - 38px);
.leakage-list{ .leakage-list{
height: calc(100% - 26px);
text-align: left; text-align: left;
li{ li{
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 8px;
padding: 9px 30px;
height: calc(100%/4 - 14px);
margin-bottom: 14px;
padding: 0 30px;
border: 1px solid #3581CC; border: 1px solid #3581CC;
background-color: #02255F; background-color: #02255F;
border-radius: 2px; border-radius: 2px;
@ -503,7 +508,7 @@ export default {
.state-list{ .state-list{
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
margin-bottom: 6px;
margin-bottom: 10px;
font-size: 14px; font-size: 14px;
color: #339CFF; color: #339CFF;
span{ span{
@ -550,7 +555,9 @@ export default {
border: 1px solid #3581CC; border: 1px solid #3581CC;
margin-bottom: 10px; margin-bottom: 10px;
img{ img{
object-fit: cover;
display: block;
// height: 100%;
// object-fit: contain;
} }
} }
.env-device-text{ .env-device-text{
@ -606,7 +613,7 @@ export default {
.env-3d{ .env-3d{
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100vh - (100%/2) - 14px);
height: calc(100% - (100%/3) - 8px);
margin-bottom: 20px; margin-bottom: 20px;
background: url('~@/assets/images/largeScreen/bg.png') no-repeat center -130px; background: url('~@/assets/images/largeScreen/bg.png') no-repeat center -130px;
// background-size: 100% 100%; // background-size: 100% 100%;
@ -624,9 +631,11 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: 0; padding: 0;
width: 165px; width: 165px;
height: 200px;
li{ li{
width: 100%; width: 100%;
margin: 20px 0 0 0; margin: 20px 0 0 0;
height: calc(100%/2 - 20px);
} }
} }
} }

14
src/views/environmentalScreen/module/lineChart.vue

@ -1,12 +1,12 @@
<template> <template>
<div style="height:84%">
<div :id="className" style="height:100%" />
</div>
<div :id="className" :style="{height:height,width:width}" />
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import resize from '@/views/dashboard/mixins/resize'
export default { export default {
mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
@ -15,6 +15,14 @@ export default {
chartData: { chartData: {
type: Object, type: Object,
required: true required: true
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: 'calc(100% - 38px)'
} }
}, },
data() { data() {

Loading…
Cancel
Save