Bladeren bron

冲突处理

Koishi 3 jaren geleden
bovenliggende
commit
2d50bb2787

+ 12 - 4
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 {
       }
 console.log(JSON.stringify(option))
       chart.setOption(option);
+
+      this.resize = function() {
+        chart.resize();
+      };
+
+      window.addEventListener("resize", this.resize);
     },
   },
   created() {
@@ -301,8 +309,8 @@ console.log(JSON.stringify(option))
       this.initChart();
     });
   },
-  beforeUpdate(){
-	  this.areaData = this.bardata.area;
+  unmounted() {
+    window.removeEventListener("resize", this.resize);
   },
   watch: {
     bardata(val) {

+ 1 - 1
src/components/chart/combination/scatter-line-chart.vue

@@ -739,7 +739,7 @@ export default {
             lineStyle: {
               show: false,
             },
-            yAxisIndex: 1,
+            yAxisIndex: 0,
             xAxisIndex: 1,
             data: value,
           });

+ 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;">