浏览代码

详情页面折线图数据

lizaixun 4 年之前
父节点
当前提交
b96277b85c
共有 1 个文件被更改,包括 76 次插入15 次删除
  1. 76 15
      components/windStationCardDetail/WindStationCardDetail.vue

+ 76 - 15
components/windStationCardDetail/WindStationCardDetail.vue

@@ -88,7 +88,7 @@
 				</view>
 				<view class="frameCardLeft">
 					减排二氧化硫(吨):
-					<a class="frameCardLeftValuesulfurdioxide">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jpeyhl}}</a>
+					<a class="frameCardLeftValueSulfurdioxide">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jpeyhl}}</a>
 				</view>
 			</view>
 		</view>
@@ -100,12 +100,12 @@
 					平均风速
 					<span>(km/h)</span>
 				</view>
-				<view class="cardinstallnumbergreen">5</view>
+				<view class="cardinstallnumbergreen">{{windspeedpowermodule.index_windSpeed_power_target_detail.pjfs}}</view>
 				<view class="cardinstallnumbergreenmin">
-					<view class="greenMinText">min: 5</view>
+					<view class="greenMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.pjfsMin}}</view>
 				</view>
 				<view class="cardinstallnumbergreenmax">
-					<view class="greenMaxText">max: 25</view>
+					<view class="greenMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.pjfsMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed">
@@ -113,12 +113,12 @@
 					预测风速
 					<span>(km/h)</span>
 				</view>
-				<view class="cardinstallnumbergreen">48</view>
+				<view class="cardinstallnumbergreen">{{windspeedpowermodule.index_windSpeed_power_target_detail.ycfs}}</view>
 				<view class="cardinstallnumbergreenmin">
-					<view class="greenMinText">min: 4</view>
+					<view class="greenMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.ycfsMin}}</view>
 				</view>
 				<view class="cardinstallnumbergreenmax">
-					<view class="greenMaxText">max: 26</view>
+					<view class="greenMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.ycfsMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed">
@@ -126,12 +126,12 @@
 					实际功率
 					<span>(kw)</span>
 				</view>
-				<view class="cardinstallnumberred">15</view>
+				<view class="cardinstallnumberred">{{windspeedpowermodule.index_windSpeed_power_target_detail.sjgl}}</view>
 				<view class="cardinstallnumberredmin">
-					<view class="redMinText">min: 566</view>
+					<view class="redMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.sjglMin}}</view>
 				</view>
 				<view class="cardinstallnumberredmax">
-					<view class="redMaxText">max: 656</view>
+					<view class="redMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.sjglMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed">
@@ -139,12 +139,12 @@
 					理论功率
 					<span>(kw)</span>
 				</view>
-				<view class="cardinstallnumberred">14</view>
+				<view class="cardinstallnumberred">{{windspeedpowermodule.index_windSpeed_power_target_detail.llgl}}</view>
 				<view class="cardinstallnumberredmin">
-					<view class="redMinText">min: 589</view>
+					<view class="redMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.llglMax}}</view>
 				</view>
 				<view class="cardinstallnumberredmax">
-					<view class="redMaxText">max: 674</view>
+					<view class="redMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.llglMin}}</view>
 				</view>
 			</view>
 		</view>
@@ -177,11 +177,19 @@
 			return {
 				FDC: "CL_FDC",
 				socketTask_comprehensive_target: '',
+				socketTask_index_windSpeed_power_target_detail: '',
 				socketTask_windpowerstationdetail_springbox_target: '',
+				socketTask_windpowerstationdetail_twentyfourhourlinechart_target:'',
 				windpowerstationdetail: {
 					comprehensive_target: "",
 					windpowerstationdetail_springbox_target: ""
 				},
+				windspeedpowermodule:{
+					index_windSpeed_power_target_detail:""
+				},
+				windspeedpowercurvedetail:{
+					windpowerstationdetail_twentyfourhourlinechart_target:""
+				},
 				windStationName: '',
 				isFrameShow: false,
 				count: 0,
@@ -201,6 +209,8 @@
 			this.getColumnServerData();
 			this.comprehensive_target();
 			this.windpowerstationdetail_springbox_target();
+			this.index_windSpeed_power_target_detail();
+			this.windpowerstationdetail_twentyfourhourlinechart_target();
 		},
 		computed: {
 			backStageIp: function() {
@@ -272,6 +282,55 @@
 					});
 				});
 			},
+			async index_windSpeed_power_target_detail() {
+				let _this = this;
+				// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
+				this.socketTask_index_windSpeed_power_target_detail = uni.connectSocket({
+					// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
+					url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_3',
+					success(data) {
+						console.log('websocket连接成功');
+					}
+				});
+				let windpowerstationid = uni.getStorageSync('windpowerstationName');
+				// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
+				this.socketTask_index_windSpeed_power_target_detail.onOpen(res => {
+					console.log('WebSocket连接正常打开中...!');
+					this.is_open_socket = true;
+			
+					// 注:只有连接正常打开中 ,才能正常收到消息
+					this.socketTask_index_windSpeed_power_target_detail.onMessage(res => {
+						//console.log("收到服务器内容:" + res.data);
+						_this.windspeedpowermodule.index_windSpeed_power_target_detail = JSON.parse(res.data)[_this.FDC];
+			
+					});
+				});
+			},
+			async windpowerstationdetail_twentyfourhourlinechart_target() {
+				let _this = this;
+				// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
+				this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target = uni.connectSocket({
+					// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
+					url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_4',
+					success(data) {
+						console.log('websocket连接成功');
+					}
+				});
+				let windpowerstationid = uni.getStorageSync('windpowerstationName');
+				// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
+				this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target.onOpen(res => {
+					console.log('WebSocket连接正常打开中...!');
+					this.is_open_socket = true;
+			
+					// 注:只有连接正常打开中 ,才能正常收到消息
+					this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target.onMessage(res => {
+						//console.log("收到服务器内容:" + res.data);
+						_this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target = JSON.parse(res.data)[_this.FDC];
+						// console.log(_this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target);
+						console.log(_this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target)
+					});
+				});
+			},
 			frameShow: function() {
 				this.count = this.count + 1;
 				if (this.count % 2 == 0) {
@@ -375,7 +434,6 @@
 						}
 					]
 				};
-
 				this.showLineA('canvasLineA', LineA);
 			},
 			showLineA(canvasId, chartData) {
@@ -962,7 +1020,10 @@
 		margin-right: 18px;
 		/* margin-left: 20px; */
 	}
-
+	
+	.frameCardLeftValueSulfurdioxide{
+		
+	}
 	.frameCardMiddleValue {
 		float: right;
 		color: #ffffff;