Browse Source

项目联调

shilin 4 years ago
parent
commit
7f6d544750

+ 32 - 31
common/common.js

@@ -41,63 +41,64 @@ class Common {
 		//  	 }
 		//首页
 		if (page[page.length - 1].route == "pages/index/Index") {
-			page[page.length - 1].target_comprehensive_indicators();
-			page[page.length - 1].target_windSpeed_power();
-			page[page.length - 1].index_windturbine_status();
-			page[page.length - 1].index_electricQuantity();
-			page[page.length - 1].index_target_basic_indicators();
+			page[page.length - 1].$vm.FDC= uni.getStorageSync('windPowerStationId');
+			page[page.length - 1].$vm.target_comprehensive_indicators();
+			page[page.length - 1].$vm.target_windSpeed_power();
+			page[page.length - 1].$vm.index_windturbine_status();
+			page[page.length - 1].$vm.index_electricQuantity();
+			page[page.length - 1].$vm.index_target_basic_indicators();
 		}
 		if (page[page.length - 1].route == "pages/forecast/Forecast") {
 
 			//page[page.length-1].$refs.r1.viewUserid();
-			page[page.length - 1].$refs.r1.getWeatherDataToday();
-			page[page.length - 1].$refs.r1.getWeatherData7();
-			page[page.length - 1].$refs.r1.getWeatherData();
-			page[page.length - 1].$refs.r1.getWeatherData40();
-			page[page.length - 1].$refs.r1.address = windpowerstationName;
+			page[page.length - 1].$vm.$children[0].getWeatherDataToday();
+			page[page.length - 1].$vm.$children[0].getWeatherData7();
+			page[page.length - 1].$vm.$children[0].getWeatherData();
+			page[page.length - 1].$vm.$children[0].getWeatherData40();
+			page[page.length - 1].$vm.$children[0].address = windpowerstationName;
 			if (windpowerstationName == "宁夏新能源公司") {
-				page[page.length - 1].$refs.r1.windStationName = "麻黄山";
-				page[page.length - 1].$refs.r1.FDC = "0";
+				page[page.length - 1].$vm.$children[0].windStationName = "麻黄山";
+				page[page.length - 1].$vm.$children[0].FDC = "MHS_FDC";
 			}
 			if (windpowerstationName == "麻黄山风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "麻黄山";
-				page[page.length - 1].$refs.r1.FDC = "MHS_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "麻黄山";
+				page[page.length - 1].$vm.$children[0].FDC = "MHS_FDC";
 			}
 			if (windpowerstationName == "牛首山风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "牛首山";
-				page[page.length - 1].$refs.r1.FDC = "NSS_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "牛首山";
+				page[page.length - 1].$vm.$children[0].FDC = "NSS_FDC";
 			}
 			if (windpowerstationName == "石板泉风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "石板泉";
-				page[page.length - 1].$refs.r1.FDC = "SBQ_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "石板泉";
+				page[page.length - 1].$vm.$children[0].FDC = "SBQ_FDC";
 			}
 			if (windpowerstationName == "青山风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "青山";
-				page[page.length - 1].$refs.r1.FDC = "QS_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "青山";
+				page[page.length - 1].$vm.$children[0].FDC = "QS_FDC";
 			}
 			if (windpowerstationName == "香山风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "香山";
-				page[page.length - 1].$refs.r1.FDC = "XS_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "香山";
+				page[page.length - 1].$vm.$children[0].FDC = "XS_FDC";
 			}
 
 			if (windpowerstationName == "河北能源集团") {
-				page[page.length - 1].$refs.r1.windStationName = "崇礼";
-				page[page.length - 1].$refs.r1.FDC = "0";
+				page[page.length - 1].$vm.$children[0].windStationName = "崇礼";
+				page[page.length - 1].$vm.$children[0].FDC = "CL_FDC";
 			}
 			if (windpowerstationName == "崇礼风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "崇礼";
-				page[page.length - 1].$refs.r1.FDC = "CL_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "崇礼";
+				page[page.length - 1].$vm.$children[0].FDC = "CL_FDC";
 
 			}
 			if (windpowerstationName == "康保风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "康保";
-				page[page.length - 1].$refs.r1.FDC = "KB_FDC";	
+				page[page.length - 1].$vm.$children[0].windStationName = "康保";
+				page[page.length - 1].$vm.$children[0].FDC = "KB_FDC";	
 			}
 			if (windpowerstationName == "代县风电场") {
-				page[page.length - 1].$refs.r1.windStationName = "代县";
-				page[page.length - 1].$refs.r1.FDC = "YMG_FDC";
+				page[page.length - 1].$vm.$children[0].windStationName = "代县";
+				page[page.length - 1].$vm.$children[0].FDC = "YMG_FDC";
 			}
-			uni.setStorageSync('windPowerStationId',page[page.length - 1].$refs.r1.FDC);
+			uni.setStorageSync('windPowerStationId',page[page.length - 1].$vm.$children[0].FDC);
 		}
 
 		//    uni.showModal({

+ 1 - 1
common/store.js

@@ -5,7 +5,7 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
     state: {
-		wholeSituationBackStageIp:'192.168.1.103',
+		wholeSituationBackStageIp:'192.168.3.24',
 		wholeSituationBackStagePort:'8082',
 		windpowerstationNameToId:{
            "宁夏新能源公司":"0","麻黄山风电场":"MHS_FDC","牛首山风电场":"NSS_FDC","青山风电场":"SBQ_FDC","石板泉风电场":"QS_FDC","香山风电场":"QS_FDC"

+ 1 - 1
components/drawer/plusDrawer.vue

@@ -8,7 +8,7 @@
 		<scroll-view scroll-y class="DrawerWindow" :class="modalName=='viewModal'?'show':''" @tap="showModal" data-target="viewModal"
 		 :style="{'margin-top':marginright}">
 			<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" >
-				<view class="cu-item arrow" v-for="(item,index) in plusDrawerList" :key="index" @tap="pushWindPowerStationNameToSessionStorage(item.name,item.windPowerStationId);" style=" background-color: #272727; border-bottom: 1rpx solid #1F1F1F;">
+				<view class="cu-item arrow" v-for="(item,index) in plusDrawerList" :key="index" @tap="pushWindPowerStationNameToSessionStorage(item.name,item.windId);" style=" background-color: #272727; border-bottom: 1rpx solid #1F1F1F;">
 					<view class="content">
 						<!-- <text class="cuIcon-github text-grey"></text> -->
 						<text class="text-grey">{{item.name}}</text>

+ 25 - 17
components/weatherProphethomepage/WeatherProphethomepage.vue

@@ -816,8 +816,12 @@
 			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
 			this.FDC= uni.getStorageSync('windPowerStationId');
 			
-			//this.windPowerStationId = '0';
-			//this.FDC='CL_FDC'
+			if (this.address == '宁夏新能源公司') {
+				this.FDC = 'MHS_FDC';
+			}
+			if (this.address == '河北能源集团') {
+				this.FDC = 'CL_FDC';
+			}
 			uni.setStorageSync('windPowerStationId',this.FDC);
 			this.$nextTick(function() {
 				this.getWeatherDataToday();
@@ -1080,6 +1084,7 @@
 				this.windStationName = item.replace('风电场', '');
 				this.modalWindStationName = item.replace('风电场', '');
 				this.address = item;
+				this.pushWindPowerStationNameToSessionStorage(item);
 				let _this = this;
 				setTimeout(function() {
 					// _this.hideModal();
@@ -1223,23 +1228,26 @@
 						//console.log("收到服务器内容:" + res.data);
 						_this.weatherProphetDataAll_17Hour = res.data;
 						_this.weatherProphetDataAll_17Hour = JSON.parse(res.data);
-						_this.weatherProphetData_17Hour = [];
-						//判断风场id 40天
-						for (let i1 = 0; i1 < _this.weatherProphetDataAll_17Hour.length; i1++) {
-							if (_this.weatherProphetDataAll_17Hour[i1].windpowerstationid == _this.FDC) {
-								_this.weatherProphetData_17Hour.push(_this.weatherProphetDataAll_17Hour[i1]);
+						
+						if(_this.weatherProphetDataAll_17Hour.length!=0)
+						{
+							_this.weatherProphetData_17Hour = [];
+							//判断风场id 40天
+							for (let i1 = 0; i1 < _this.weatherProphetDataAll_17Hour.length; i1++) {
+								if (_this.weatherProphetDataAll_17Hour[i1].windpowerstationid == _this.FDC) {
+									//debugger
+									_this.weatherProphetData_17Hour.push(_this.weatherProphetDataAll_17Hour[i1]);
+								}
 							}
+							// console.log(_this.weatherProphetData_17Hour)
+							_this.$nextTick(function() {
+								if (_this.$refs.thermometerCard == undefined) {
+							
+								} else {
+									_this.$refs.thermometerCard.getHourWeatherData("90", "260", _this.weatherProphetData_17Hour, _this.weatherProphetData_1);
+								}
+							})
 						}
-						// console.log(_this.weatherProphetData_17Hour)
-						_this.$nextTick(function() {
-							if (_this.$refs.thermometerCard == undefined) {
-
-							} else {
-								_this.$refs.thermometerCard.getHourWeatherData("90", "260", _this.weatherProphetData_17Hour, _this.weatherProphetData_1);
-							}
-						})
-
-
 					});
 				})
 				// 这里仅是事件监听【如果socket关闭了会执行】

+ 8 - 6
components/weatherProphethomepage/weatherDetail/Detail.vue

@@ -19,7 +19,7 @@
 						{{startDate}}~{{endDate}}
 					</view>
 					<view class="title" :style="{'font-size':titleFontSize}">
-						温度/体感
+						温度
 					</view>				
 				</view>
 				<!-- uCharts柱状图 -->
@@ -356,23 +356,25 @@
 						"textColor":"#FFFFFF",
 						"textSize":this.seriesTextSize,
 						format:(val)=>{return val+'℃ㅤ'}
-					  }, {
+					  }
+					  /*, {
 						"name": "成交量2",
 						"data": [30, {"value": 40,"color": "#facc14"}, 25, 14, 34, 18],
 						"color": '#facc14',
 						"textColor":"#FFFFFF",
 						"textSize":this.seriesTextSize,
-						format:(val)=>{return 'ㅤ'+val+'℃'}
-					  }]
+						format:(val)=>{return '    '+val+'℃'}
+					  }*/
+					  ]
 				};
 				Column.categories=[];
 				Column.series[0].data=[];
-				Column.series[1].data=[];
+				//Column.series[1].data=[];
 				for(let i=0;i<this.weatherProphetData_17Hour.length;i++){		
 					let xAxisHours = new Date(this.weatherProphetData_17Hour[i].date).getHours();					
 					Column.categories.push(xAxisHours+"时");
 					Column.series[0].data.push(this.weatherProphetData_17Hour[i].temperature);
-					Column.series[1].data.push(this.weatherProphetData_17Hour[i].realfeel);
+				//	Column.series[1].data.push(this.weatherProphetData_17Hour[i].realfeel);
 				}	
 				this.showColumn("canvasColumn",Column);
 				

+ 1 - 1
pages/forecast/Forecast.vue

@@ -23,7 +23,7 @@
 			<div class="plusDrawer" @tap="hideModal"><plusDrawer ref="plusDrawer"></plusDrawer></div>
 			<view class="page-body">
 				<view class="page-section page-section-gap">
-					<map  style="width: 100%; height: 300px;"
+					<map  style="width:10%; height: 300px;"
 					
 						:controls="controls"
 						:circles="circles"

+ 31 - 30
pages/index/Index.vue

@@ -913,33 +913,9 @@
 						name: '人员监视'
 					}
 				],
-				plusDrawerList: [{
-						name: '宁夏新能源公司',
-						windPowerStationId: 'NINGXIAXINNENGYUANGONGSI'
-					},
-					{
-						name: '崇礼风电场',
-						windPowerStationId: 'CL_FDC'
-					},
-					{
-						name: '代县风电场',
-						windPowerStationId: 'DX_FDC'
-					},
-					{
-						name: '康保风电场',
-						windPowerStationId: 'KB_FDC'
-					},
-					/* {
-						name: '青山风电场',
-						windPowerStationId: 'QS_FDC'
-					},
-					{
-						name: '麻黄山风电场',
-						windPowerStationId: 'MHS_FDC'
-					} */
-				],
+				plusDrawerList: [],
 				modalName: null,
-				address: '宁夏新能源公司',
+				address: '河北能源集团',
 				windPowerStationId: '',
 				inconList: ['form', 'favor', 'question', 'edit'],
 				minaverageSpeed: '12',
@@ -991,13 +967,14 @@
 			};
 		},
 		created: function() {
+			this.viewUserid();
 			this.address = this.getWindPowerStationNameToSessionStorage();
 
 			if (this.address == '') {
-				this.pushWindPowerStationNameToSessionStorage('宁夏新能源公司');
+				this.pushWindPowerStationNameToSessionStorage('河北能源集团');
 				this.address = this.getWindPowerStationNameToSessionStorage();
 			}
-			if (this.address == '宁夏新能源公司') {
+			if (this.address == '河北能源集团') {
 				this.FDC = '0';
 			}
 			if (this.address == '崇礼风电场') {
@@ -1009,7 +986,9 @@
 			if (this.address == '康保风电场') {
 				this.FDC = 'KB_FDC';
 			}
-			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+			uni.setStorageSync('windPowerStationId',this.FDC);
+
+			
 		},
 		onLoad: function() {
 			let that = this;
@@ -1062,7 +1041,7 @@
 		onShow() {
 			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
 			this.address = this.getWindPowerStationNameToSessionStorage();
-			if (this.address == '宁夏新能源公司') {
+			if (this.address == '河北能源集团') {
 				this.FDC = '0';
 			}
 			if (this.address == '崇礼风电场') {
@@ -1076,6 +1055,28 @@
 			}
 		},
 		methods: {
+			viewUserid:function(){
+				let _this = this;
+				_this.userid =uni.getStorageSync('userid')
+				//_this.userid = sessionStorage.getItem('userid');
+				uni.request({
+					url: 'http://' + this.backStageIp + ':' + this.backStagePort + '/GyeeorganController/GyeeOrganList?userid=' + _this.userid,
+					data: {},
+					method: 'GET',
+					success: function(res) {
+						for(let i=0;i<res.data.data.length;i++){
+							// _this.name.push(res.data.data[i].describes);
+							// _this.windId.push(res.data.data[i].name);
+						}
+						for(let j=0;j<res.data.data.length;j++){
+							var a = {};
+							_this.$set(a,"name",res.data.data[j].describes);
+							_this.$set(a,"windId",res.data.data[j].name);
+							_this.plusDrawerList.push(a);
+						}
+					},
+					})
+			},
 			async index_curve_columnar_five_loss() {
 				Date.prototype.Format = function(fmt) {
 					var o = {