Selaa lähdekoodia

components\windFarmcard\WindFarmcard.vue

shilin 4 vuotta sitten
vanhempi
commit
689837572a
1 muutettua tiedostoa jossa 11 lisäystä ja 8 poistoa
  1. 11 8
      components/windFarmcard/WindFarmcard.vue

+ 11 - 8
components/windFarmcard/WindFarmcard.vue

@@ -28,7 +28,7 @@
 			<view class="UChartContainer">
 				<view class="windStationUChart">
 					<view class="windStationQiun-charts">
-						<canvas canvas-id="windStationCanvasLineC" id="windStationCanvasLineC" class="windStationCharts" @touchstart="touchLineB3"></canvas>
+						<canvas :canvas-id=plusDrawerList.windId :id=plusDrawerList.windId class="windStationCharts" @touchstart="touchLineB3"></canvas>
 					</view>
 				</view>
 				<view class="UChartTitle">风速功率曲线图</view>
@@ -83,8 +83,7 @@
 
 <script>
 	import uCharts from '../tools/u-charts/u-charts.js';
-	import utils from '../tools/shoyu-date/utils.filter.js'
-	var _self;
+
 	var canvaLineB3 = null;
 	Date.prototype.Format = function(fmt) {
 		var o = {
@@ -122,6 +121,7 @@
 			this.windStationCardCWidth = 250;
 			this.windStationCardCHeight = 150;
 		},
+
 		methods: {
 			getWindfieldid:function(plusDrawerList) {
 				this.plusDrawerList = plusDrawerList;				
@@ -226,11 +226,11 @@
 						_this.lineChartdata[i].value1
 					);
 				}
-				_this.showWindStationCardLineA3('windStationCanvasLineC', LineC);
+				_this.showWindStationCardLineA3(_this.plusDrawerList.windId, LineC);
 			},
 			showWindStationCardLineA3(canvasId, chartData) {
 				var _self = this;
-				canvaLineB3 = new uCharts({
+				this.plusDrawerList.canvas = new uCharts({
 					$this: _self,
 					canvasId: canvasId,
 					type: 'line',
@@ -294,8 +294,11 @@
 							return val.toFixed(0) + '元';
 						}
 					},
-					width: _self.windStationCardCWidth * _self.windStationCardPixelRatio,
-					height: _self.windStationCardCHeight * _self.windStationCardPixelRatio,
+					// width: _self.windStationCardCWidth * _self.windStationCardPixelRatio,
+					// height: _self.windStationCardCHeight * _self.windStationCardPixelRatio,
+					
+					width: 300,
+					height:300,
 					padding: [10, 0, 0, 0], //画布填充边距,顺序为上右下左,同css,但必须4位
 					extra: {
 						line: {
@@ -306,7 +309,7 @@
 				});
 			},
 			touchLineB3(e) {
-				canvaLineB3.showToolTip(e, {
+				this.plusDrawerList.canvas.showToolTip(e, {
 					format: function(item, category) {
 						return category + ' ' + item.name + ':' + item.data;
 					}