Browse Source

首页样式方法调试

lizaixun 4 years ago
parent
commit
0ff68104b3
2 changed files with 37 additions and 26 deletions
  1. 31 23
      components/windFarmcard/WindFarmcard.vue
  2. 6 3
      pages/index/Index.vue

+ 31 - 23
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="c"></canvas>
+						<canvas canvas-id="windStationCanvasLineC" id="windStationCanvasLineC" class="windStationCharts" @touchstart="touchLineB3"></canvas>
 					</view>
 				</view>
 				<view class="UChartTitle">风速功率曲线图</view>
@@ -82,6 +82,9 @@
 </template>
 
 <script>
+	import uCharts from '../tools/u-charts/u-charts.js';
+	var _self;
+	var canvaLineB3 = null;
 	export default {
 		data: function() {
 			return {
@@ -103,9 +106,7 @@
 		},
 		methods: {
 			getWindfieldid:function(plusDrawerList) {
-				this.plusDrawerList = plusDrawerList;
-				console.log(this.plusDrawerList)
-				
+				this.plusDrawerList = plusDrawerList;				
 			},
 			getWindfielddata:function(index_windStation_cardmodule){
 				this.cardmodule = false;
@@ -119,9 +120,25 @@
 			getUchartData:function(lineChartdata){
 				this.lineChartdata = [];
 				this.lineChartdata = lineChartdata;
-				console.log(this.lineChartdata);
+				this.getLinAcharts();
 			},
 			getLinAcharts: function() {
+				Date.prototype.Format = function(fmt) {
+					var o = {
+						'M+': this.getMonth() + 1, //月份
+						'd+': this.getDate(), //日
+						'h+': this.getHours(), //小时
+						'm+': this.getMinutes(), //分
+						's+': this.getSeconds(), //秒
+						'q+': Math.floor((this.getMonth() + 3) / 3), //季度
+						S: this.getMilliseconds() //毫秒
+					};
+					if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
+					for (var k in o)
+						if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[
+							k]).substr(('' + o[k]).length));
+					return fmt;
+				};
 				let LineC = {
 					categories: [],
 					series: [{
@@ -177,35 +194,26 @@
 				let _this = this;
 				LineC.categories = [];
 				LineC.series[0].data = [];
-				for (var i = 0; i < _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule[
-						'KB_FDC']['gl'].length; i++) {
+				console.log( _this.lineChartdata)
+				for (var i = 0; i < _this.lineChartdata.length; i++) {
+					
 					let time = new Date(
-						_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
-							'gl'
-						][i].pointTime * 1000
+						_this.lineChartdata[i].value2.pointTime * 1000
 					).Format('hh');
-				
+					// console.log(time)
 					LineC.categories.push(time);
 					//console.log(_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['MHS_FDC']['gl'][i].pointValueInDouble);
 					LineC.series[0].data.push(
-						_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
-							'gl'
-						][i].pointValueInDouble
+						_this.lineChartdata[i].value2.pointValueInDouble
 					);
 					LineC.series[1].data.push(
-						_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
-							'fs'
-						][i].pointValueInDouble
+						_this.lineChartdata[i].value4.pointValueInDouble
 					);
 					LineC.series[2].data.push(
-						_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
-							'llgl'
-						][i].pointValueInDouble
+						_this.lineChartdata[i].value3.pointValueInDouble
 					);
 					LineC.series[3].data.push(
-						_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
-							'ycgl'
-						][i].pointValueInDouble
+						_this.lineChartdata[i].value1.pointValueInDouble
 					);
 				}
 				_this.showWindStationCardLineA3('windStationCanvasLineC', LineC);

+ 6 - 3
pages/index/Index.vue

@@ -393,7 +393,7 @@
 			<!-- 风电场卡片 -->
 			<view class="windStation">
 				<scroll-view scroll-x class="scrollWindStationCard">
-					<view class="windStationCardContainer">
+					<view class="windStationCardContainer" :style="{'width':windStationCardContainerwidth}">
 						<view v-for="(item,index) in plusDrawerList" :key="index">
 							<WindFarmcard ref="windFarmcard"></WindFarmcard>
 						</view>
@@ -540,6 +540,7 @@
 				windFielddata:[],
 				windFieldsituation: [],
 				lineChartdata:[],
+				windStationCardContainerwidth:'',
 			};
 		},
 		created: function() {
@@ -615,6 +616,8 @@
 				for (let i = 0; i < _this.plusDrawerList.length; i++) {
 					_this.$refs.windFarmcard[i].getWindfieldid(_this.plusDrawerList[i]);
 				}
+				this.windStationCardContainerwidth = (260 * this.plusDrawerList.length - 260)+"px";
+				console.log(this.windStationCardContainerwidth)
 			},
 			judgeWindfield:function(){
 				this.plusDrawerList = uni.getStorageSync('plusList');
@@ -3842,7 +3845,7 @@
 		margin-left: 9px;
 		height: 320px;
 		color: silver;
-		margin-bottom: 120px;
+		margin-bottom: 135px;;
 		/* background-color: #242424; */
 	}
 
@@ -3851,7 +3854,7 @@
 	}
 
 	.windStationCardContainer {
-		width: 1295px;
+		/* width: 1295px; */
 		height: 350px;
 		margin-top: 10px;
 	}