Parcourir la source

首页数据接入

limiao il y a 4 ans
Parent
commit
4c64d3ee1e
1 fichiers modifiés avec 143 ajouts et 24 suppressions
  1. 143 24
      pages/index/Index.vue

+ 143 - 24
pages/index/Index.vue

@@ -40,25 +40,25 @@
 				<view class="informationCardTextOne">
 					<view class="informationCardText">
 						<view class="textSilver" @tap="common.navTo('/components/detail/Detail')">安全天数(&nbsp;天&nbsp;)&nbsp;:</view>						
-						<view class="textWhite">15</view>
+						<view class="textWhite">{{windpowerstationdetail.target_comprehensive_indicators.aqts}}</view>
 					</view>
 					<view class="informationCardTextzj">
 						<view class="textSilver" @tap="common.navTo('/components/detail/Detail')">装机容量(mv):</view>					
-						<view class="textWhite">15</view>
+						<view class="textWhite">{{windpowerstationdetail.target_comprehensive_indicators.zjrl}}</view>
 					</view>
 				</view>
 				<view class="informationCardTextTwo">
 					<view class="informationCardTextNo1">
 						<view class="textSilver" @tap="common.navTo('/components/detail/Detail')">日发电量(kwh):</view>
-						<view class="textWhite">150</view>					
+						<view class="textWhite">{{windpowerstationdetail.target_comprehensive_indicators.rfdl}}</view>					
 					</view>
 					<view class="informationCardText3">
 						<view class="textSilver" @tap="common.navTo('/components/detail/Detail')">预测发电量(kwh):</view>
-						<view class="textWhite2">15</view>			
+						<view class="textWhite2">{{windpowerstationdetail.target_comprehensive_indicators.ycfdl}}</view>			
 					</view>
 					<view class="informationCardText2">
 						<view class="textSilver" @tap="common.navTo('/components/detail/Detail')">上网电量(kwh):</view>
-						<view class="textWhite">15</view>
+						<view class="textWhite">{{windpowerstationdetail.target_comprehensive_indicators.swdl}}</view>
 					</view>
 				</view>
 			</view>
@@ -70,12 +70,12 @@
 					平均风速(km/h)
 					<!-- <view class="textWhitekuangSpeed">(km/h)</view> -->
 				</view>
-				<view class="cardinstallnumbergreen">5</view>
+				<view class="cardinstallnumbergreen">{{windpowerstationdetail.target_windSpeed_power.pjfs}}</view>
 				<view class="cardinstallnumbergreenmin">
-					<view class="greenMinText">min: 5</view>
+					<view class="greenMinText">min: {{windpowerstationdetail.target_windSpeed_power.pjfsMin}}</view>
 				</view>
 				<view class="cardinstallnumbergreenmax">
-					<view class="greenMaxText">max: 25</view>
+					<view class="greenMaxText">max: {{windpowerstationdetail.target_windSpeed_power.pjfsMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed" @tap="common.navTo('/components/detail/Detail')">
@@ -83,12 +83,12 @@
 					预测风速(km/h)
 					<!-- <view class="textWhitekuangSpeed">(km/h)</view> -->
 				</view>
-				<view class="cardinstallnumbergreen">48</view>
+				<view class="cardinstallnumbergreen">{{windpowerstationdetail.target_windSpeed_power.ycfs}}</view>
 				<view class="cardinstallnumbergreenmin">
-					<view class="greenMinText">min: 4</view>
+					<view class="greenMinText">min: {{windpowerstationdetail.target_windSpeed_power.ycfsMin}}</view>
 				</view>
 				<view class="cardinstallnumbergreenmax">
-					<view class="greenMaxText">max: 26</view>
+					<view class="greenMaxText">max: {{windpowerstationdetail.target_windSpeed_power.ycfsMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed" @tap="common.navTo('/components/detail/Detail')">
@@ -96,12 +96,12 @@
 					实际功率(kw)
 					<!-- <view class="textWhitekuang">(kw)</view> -->
 				</view>
-				<view class="cardinstallnumberred">15</view>
+				<view class="cardinstallnumberred">{{windpowerstationdetail.target_windSpeed_power.sjgl}}</view>
 				<view class="cardinstallnumberredmin">
-					<view class="redMinText">min: 566</view>
+					<view class="redMinText">min: {{windpowerstationdetail.target_windSpeed_power.sjglMin}}</view>
 				</view>
 				<view class="cardinstallnumberredmax">
-					<view class="redMaxText">max: 656</view>
+					<view class="redMaxText">max: {{windpowerstationdetail.target_windSpeed_power.sjglMax}}</view>
 				</view>
 			</view>
 			<view class="cardinstallredSpeed" @tap="common.navTo('/components/detail/Detail')">
@@ -109,12 +109,12 @@
 					理论功率(kw)
 					<!-- <view class="textWhitekuang">(kw)</view> -->
 				</view>
-				<view class="cardinstallnumberred">14</view>
+				<view class="cardinstallnumberred">{{windpowerstationdetail.target_windSpeed_power.llgl}}</view>
 				<view class="cardinstallnumberredmin">
-					<view class="redMinText">min: 589</view>
+					<view class="redMinText">min: {{windpowerstationdetail.target_windSpeed_power.llglMin}}</view>
 				</view>
 				<view class="cardinstallnumberredmax">
-					<view class="redMaxText">max: 674</view>
+					<view class="redMaxText">max: {{windpowerstationdetail.target_windSpeed_power.llglMax}}</view>
 				</view>
 			</view>
 		</view>
@@ -126,21 +126,21 @@
 						<image src="../../static/picture/001.png" style="width: 18px;height:18px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">接入</view>
-					<view class="AccessCardNumber">59</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.jr}}</view>
 				</view>
 				<view class="interfaceCardSmall">
 					<view class="AccessCardimage">
 						<image src="../../static/picture/002.png" style="width: 18px;height:18px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">待机</view>
-					<view class="AccessCardNumber">10</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.dj}}</view>
 				</view>
 				<view class="interfaceCardSmall">
 					<view class="AccessCardimage">
 						<image src="../../static/picture/003.png" style="width: 18px;height:18px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">运行</view>
-					<view class="AccessCardNumber">29</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.yx}}</view>
 				</view>
 			</view>
 			<view class="interfaceCardSmallTop">
@@ -149,21 +149,21 @@
 						<image src="../../static/picture/004.png" style="width: 18px;height:18px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">故障</view>
-					<view class="AccessCardNumber">18</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.gz}}</view>
 				</view>
 				<view class="interfaceCardSmall">
 					<view class="AccessCardimage">
 						<image src="../../static/picture/005.png" style="width: 18px;height:18px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">维护</view>
-					<view class="AccessCardNumber">8</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.wh}}</view>
 				</view>
 				<view class="interfaceCardSmall">
 					<view class="AccessCardimage">
 						<image src="../../static/picture/006.png" style="width: 18px;height:19px;margin-top: 9px;margin-left: 7px;"></image>
 					</view>
 					<view class="AccessCardText">离线</view>
-					<view class="AccessCardNumber">8</view>
+					<view class="AccessCardNumber">{{windpowerstationdetail.index_windturbine_status.lx}}</view>
 				</view>
 			</view>
 		</view>
@@ -730,7 +730,12 @@
 				clickFlag: "stack",
 				windStationCardCWidth: '',
 				windStationCardCHeight: '',
-				windStationCardPixelRatio: 1
+				windStationCardPixelRatio: 1,
+				FDC:"CL_FDC",
+				socketTask_target_comprehensive_indicators:'',
+				socketTask_target_windSpeed_power:'',
+				socketTask_index_windturbine_status:'',
+				windpowerstationdetail:{target_comprehensive_indicators:"",target_windSpeed_power:"",index_windturbine_status:""},
 			};
 		},
 		created: function() {
@@ -754,6 +759,18 @@
 			this.windStationCardCWidth = 250;
 			this.windStationCardCHeight = 150;
 			this.getWindStationCardData();
+			this.target_comprehensive_indicators();
+			this.target_windSpeed_power();
+			this.index_windturbine_status();
+		},
+		computed:{
+		   backStageIp:function(){
+			  return this.$store.state.wholeSituationBackStageIp;
+		   }, backStagePort:function(){
+			  return this.$store.state.wholeSituationBackStagePort;
+		   },windpowerstationNameToId:function(){
+			  return this.$store.state.windpowerstationNameToId;
+		   }
 		},
 		onHide() {
 			this.$refs.drawer.closeDrawer();
@@ -788,6 +805,108 @@
 				this.modalName = null;
 				this.$refs.plusDrawer.hideModal(this.modalName);
 			},
+			async target_comprehensive_indicators() {
+			
+						let _this = this;
+						// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
+						this.socketTask_target_comprehensive_indicators = uni.connectSocket({
+							// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
+							url: 'ws://'+this.backStageIp+':'+this.backStagePort+'/websocket/pageNumber_6/functionNumber_1',
+							success(data) {
+								console.log('websocket连接成功');
+							}
+						});
+					    let windpowerstationid = uni.getStorageSync('windpowerstationName');
+						// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
+						this.socketTask_target_comprehensive_indicators.onOpen(res => {
+							console.log('WebSocket连接正常打开中...!');
+							this.is_open_socket = true;
+					
+							// 注:只有连接正常打开中 ,才能正常收到消息
+							this.socketTask_target_comprehensive_indicators.onMessage(res => {
+								//console.log("收到服务器内容:" + res.data);
+								_this.windpowerstationdetail.target_comprehensive_indicators =JSON.parse(res.data)[_this.FDC];
+			
+							});
+						});
+						// 这里仅是事件监听【如果socket关闭了会执行】
+			/* 			this.socketTask_comprehensive_target.onClose(() => {
+								uni.request({
+								    url: 'http://'+this.backStageIp+':'+this.backStagePort+'/targetdetail/close_targetdetail_target?pointKey='+this.pointKey,
+								    success: (res) => {
+					
+								    }
+								});
+						}) */
+					},
+			async target_windSpeed_power() {
+			
+						let _this = this;
+						// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
+						this.socketTask_target_windSpeed_power = uni.connectSocket({
+							// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
+							url: 'ws://'+this.backStageIp+':'+this.backStagePort+'/websocket/pageNumber_6/functionNumber_2',
+							success(data) {
+								console.log('websocket连接成功');
+							}
+						});
+					    let windpowerstationid = uni.getStorageSync('windpowerstationName');
+						// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
+						this.socketTask_target_windSpeed_power.onOpen(res => {
+							console.log('WebSocket连接正常打开中...!');
+							this.is_open_socket = true;
+					
+							// 注:只有连接正常打开中 ,才能正常收到消息
+							this.socketTask_target_windSpeed_power.onMessage(res => {
+								//console.log("收到服务器内容:" + res.data);
+								_this.windpowerstationdetail.target_windSpeed_power =JSON.parse(res.data)[_this.FDC];
+			
+							});
+						});
+						// 这里仅是事件监听【如果socket关闭了会执行】
+			/* 			this.socketTask_comprehensive_target.onClose(() => {
+								uni.request({
+								    url: 'http://'+this.backStageIp+':'+this.backStagePort+'/targetdetail/close_targetdetail_target?pointKey='+this.pointKey,
+								    success: (res) => {
+					
+								    }
+								});
+						}) */
+					},
+			async index_windturbine_status() {
+			
+						let _this = this;
+						// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
+						this.socketTask_index_windturbine_status = uni.connectSocket({
+							// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
+							url: 'ws://'+this.backStageIp+':'+this.backStagePort+'/websocket/pageNumber_6/functionNumber_3',
+							success(data) {
+								console.log('websocket连接成功');
+							}
+						});
+					    let windpowerstationid = uni.getStorageSync('windpowerstationName');
+						// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
+						this.socketTask_index_windturbine_status.onOpen(res => {
+							console.log('WebSocket连接正常打开中...!');
+							this.is_open_socket = true;
+					
+							// 注:只有连接正常打开中 ,才能正常收到消息
+							this.socketTask_index_windturbine_status.onMessage(res => {
+								//console.log("收到服务器内容:" + res.data);
+								_this.windpowerstationdetail.index_windturbine_status =JSON.parse(res.data)[_this.FDC];
+			
+							});
+						});
+						// 这里仅是事件监听【如果socket关闭了会执行】
+			/* 			this.socketTask_comprehensive_target.onClose(() => {
+								uni.request({
+								    url: 'http://'+this.backStageIp+':'+this.backStagePort+'/targetdetail/close_targetdetail_target?pointKey='+this.pointKey,
+								    success: (res) => {
+					
+								    }
+								});
+						}) */
+					},
 			getServerData() {
 				// 折线图
 				let LineA = {