Browse Source

修改布局

杨宽 3 years ago
parent
commit
2e9aa7c21a

+ 13 - 2
src/components/chart/combination/bar-line-chart.vue

@@ -97,14 +97,16 @@ export default {
       return this.bardata.legend;
     },
     end() {
-      var result = 20;
-      if (this.areaData) {
+      var result = 100;
+      if (this.areaData && this.areaData.length > 0) {
         result = parseInt((this.pageSize / this.areaData.length) * 100);
       }
+
       return result;
     },
   },
   methods: {
+    resize() {},
     initChart() {
       let chart = echarts.init(this.$el);
       let option = {
@@ -278,6 +280,12 @@ export default {
       }
 
       chart.setOption(option);
+
+      this.resize = function() {
+        chart.resize();
+      };
+
+      window.addEventListener("resize", this.resize);
     },
   },
   created() {
@@ -301,6 +309,9 @@ export default {
       this.initChart();
     });
   },
+  unmounted() {
+    window.removeEventListener("resize", this.resize);
+  },
   watch: {
     bardata(val) {
       if (val.area && val.area.length < this.pageSize) {

+ 2 - 2
src/views/Decision/Decision1.vue

@@ -67,7 +67,7 @@
 		<el-row :type="'flex'" class="content">
 			<el-col :span="12" class="pd-r-8">
 				<toolbar-panel title="风机绩效榜" :showLine="false">
-					<bar-line-chart :height="'calc(100vh - 200px)'" :bardata="bardata" :lineData="lineData"
+					<bar-line-chart :height="'calc(100vh - 180px)'" :bardata="bardata" :lineData="lineData"
 						:color="barColor" lineName="理论发电量" />
 				</toolbar-panel>
 			</el-col>
@@ -76,7 +76,7 @@
 					<div class="project-table">
 						<!-- 分页Table -->
 						<Table :data="tableData"
-							:height="'calc(100vh - 32vh)'">
+							:height="'calc(80vh - 50px)'">
 							<template v-slot:tr v-if="tableData.data.length > 0">
 								<tr>
 									<td style="width: 50px;">