Ver código fonte

后台代码提取第一版

shilin 4 anos atrás
pai
commit
9612868f26

+ 17 - 46
common/common.js

@@ -55,54 +55,25 @@ class Common {
 		}else	if (page[page.length - 1].route == "pages/forecast/Forecast") {
 
 			//page[page.length-1].$refs.r1.viewUserid();
-			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].$vm.$children[0].windStationName = "麻黄山";
-				page[page.length - 1].$vm.$children[0].FDC = "MHS_FDC";
-			}
-			if (windpowerstationName == "麻黄山风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "麻黄山";
-				page[page.length - 1].$vm.$children[0].FDC = "MHS_FDC";
-			}
-			if (windpowerstationName == "牛首山风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "牛首山";
-				page[page.length - 1].$vm.$children[0].FDC = "NSS_FDC";
-			}
-			if (windpowerstationName == "石板泉风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "石板泉";
-				page[page.length - 1].$vm.$children[0].FDC = "SBQ_FDC";
-			}
-			if (windpowerstationName == "青山风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "青山";
-				page[page.length - 1].$vm.$children[0].FDC = "QS_FDC";
-			}
-			if (windpowerstationName == "香山风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "香山";
-				page[page.length - 1].$vm.$children[0].FDC = "XS_FDC";
-			}
+			page[page.length - 1].$refs.r1.address=uni.getStorageSync('windpowerstationName');
+			page[page.length - 1].$refs.r1.FDC = uni.getStorageSync('windPowerStationId');
+			page[page.length - 1].$refs.r1.windStationName = windpowerstationName.replace('风电场', '');
+			
+			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].$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();
 
-			if (windpowerstationName == "河北能源集团") {
-				page[page.length - 1].$vm.$children[0].windStationName = "崇礼";
-				page[page.length - 1].$vm.$children[0].FDC = "CL_FDC";
-			}
-			if (windpowerstationName == "崇礼风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "崇礼";
-				page[page.length - 1].$vm.$children[0].FDC = "CL_FDC";
+			
 
-			}
-			if (windpowerstationName == "康保风电场") {
-				page[page.length - 1].$vm.$children[0].windStationName = "康保";
-				page[page.length - 1].$vm.$children[0].FDC = "KB_FDC";	
-			}
-			if (windpowerstationName == "代县风电场") {
-				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].$vm.$children[0].FDC);
+			
 		}
 
 		//    uni.showModal({

+ 22 - 6
components/detail/Detail.vue

@@ -61,7 +61,9 @@ export default {
 			cHeight: '',
 			pixelRatio: 1,
 			serverData: '',
+			windPowerStationId: '',
 			address: '',
+			FDC: ''
 		 }
 		 return data;
 		},
@@ -70,8 +72,12 @@ export default {
 
 	
 	onShow() {
-		this.windPowerStationId = uni.getStorageSync('windPowerStationId');
-		this.address = this.getWindPowerStationNameToSessionStorage();
+		//this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+		//this.address = this.getWindPowerStationNameToSessionStorage();
+		
+		this.address = this.dataprocessing.getWindPowerStationName();
+		this.FDC=this.dataprocessing.getWindPowerStationId();
+		this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
 		this.hideModals();
 	},
 	onLoad(pointKey) {
@@ -81,8 +87,13 @@ export default {
 		this.getColumnServerData();
 		this.getLineServerData();
 		
-		this.address = this.getWindPowerStationNameToSessionStorage();
-		this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+		//this.address = this.getWindPowerStationNameToSessionStorage();
+		//this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+		
+		this.address = this.dataprocessing.getWindPowerStationName();
+		this.FDC=this.dataprocessing.getWindPowerStationId();
+		this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
+		
 		this.pointKey = pointKey.pointKey;
 		this.targetName = pointKey.callTargetName;
 		this.targetUnit = pointKey.callTargetUnit;
@@ -103,8 +114,13 @@ export default {
 	},
 	methods: {
 		targetInformation(pointKey,callTargetName,callTargetUnit){
-			this.address = this.getWindPowerStationNameToSessionStorage();
-			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+			
+			//this.address = this.getWindPowerStationNameToSessionStorage();
+			//this.windPowerStationId = uni.getStorageSync('windPowerStationId');
+			
+			this.address = this.dataprocessing.getWindPowerStationName();
+			this.FDC=this.dataprocessing.getWindPowerStationId();
+			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
 			this.pointKey = pointKey;
 			this.targetName = callTargetName;
 			this.targetUnit = callTargetUnit;

+ 2 - 0
components/drawer/plusDrawer.vue

@@ -62,6 +62,8 @@
 			// 	this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
 			// },
 			pushWindPowerStationNameToSessionStorage(windpowerstationName, windPowerStationId) {
+				
+				
 				uni.setStorageSync('windpowerstationName', windpowerstationName);
 				uni.setStorageSync('windPowerStationId', windPowerStationId);
 				//debugger

+ 28 - 140
components/login/Login.vue

@@ -45,6 +45,8 @@
 </template>
 
 <script>
+	
+
 export default {
 	data: function() {
 		return {
@@ -104,6 +106,12 @@ export default {
 		},
 		windpowerstationNameToId: function() {
 			return this.$store.state.windpowerstationNameToId;
+		},
+		windpowerstationName: function() {
+			return this.$store.state.default_wpname;
+		},
+		windpowerstationId: function() {
+			return this.$store.state.default_wpid;
 		}
 	},
 	methods: {
@@ -181,24 +189,10 @@ export default {
 		},
 		goToIndex:function(){
 			let _this = this;
-			uni.request({
-				url: 'http://49.4.78.143:8057/GyeeuserController/login?username='+'admin'+'&password='+'admin',
-				data: {},
-				method: 'GET',
-				success: function(res) {
-					console.log(res.data);
-					if (res.data.code == 200) {
-						_this.loginFalg = true;
-					} 
-				},
-				fail: () => {
-					_this.tips = '网络错误,小程序端请检查合法域名';
-				}
-			});
+			_this.loginFalg = true;
 			uni.switchTab({
 			     url: '/pages/index/Index'
 			    });
-				console.log(this.username)
 		},
 		falseLogin: function() {
 			if (this.username == 'admin' && this.password == 'admin') {
@@ -263,9 +257,27 @@ export default {
 					uni.setStorageSync('userid',_this.userid);
 					//sessionStorage.setItem('userid',_this.userid);
 					if (res.data.code == 200) {
+						
+						_this.dataprocessing.putWindPowerStationId(_this.$store.state.default_wpid);
+						_this.dataprocessing.putWindPowerStationName(_this.$store.state.default_wpname);
+						// if(_this.dataprocessing.getWindPowerStationId()=='')
+						// {
+						// 	//debugger
+						// 	_this.dataprocessing.putWindPowerStationId(_this.$store.state.default_wpid);
+						// }
+						
+						// if(_this.dataprocessing.getWindPowerStationName()=='')
+						// {
+						// 	//debugger
+						// 	_this.dataprocessing.putWindPowerStationName(_this.$store.state.default_wpname);
+						// }
 						_this.setUsernamePassword();
 						_this.loginFalg = true;
-						_this.getUser();
+						_this.lastUserName = _this.username;
+						_this.lastPassWord = _this.password;
+						uni.switchTab({
+							url: '/pages/index/Index'
+						});
 					} else {
 						uni.showModal({
 							content: '用户名密码输入错误,请核对'
@@ -278,130 +290,6 @@ export default {
 					_this.tips = '网络错误,小程序端请检查合法域名';
 				}
 			});
-		},
-		getUser: function() {
-			let _this = this;
-			uni.request({
-				url: 'http://49.4.78.143:8081/UserauthorityController/getUserSession',
-				data: {},
-				method: 'GET',
-				success: function(res) {
-					_this.lastUserName = res.data[0];
-					_this.lastPassWord = res.data[1];
-					_this.getWindPowerStation();
-				},
-				fail: () => {
-					_this.tips = '网络错误,小程序端请检查合法域名';
-				}
-			});
-		},
-		getWindPowerStation: function() {
-			let _this = this;
-			uni.request({
-				url: 'http://49.4.78.143:8081/UserauthorityController/selectuserauthority?userName=' + this.lastUserName + '&password=' + this.lastPassWord,
-				data: {},
-				method: 'GET',
-				success: function(res) {
-					_this.windPowerStations = res.data;
-					//console.log(_this.windPowerStations);
-					_this.windPowerStationId = _this.windPowerStations[0];
-					if (_this.loginFalg) {
-						if (_this.windPowerStationId == 'MHS_FDC') {
-							_this.windpowerstationName = '麻黄山';
-						}
-						if (_this.windPowerStationId == 'NSS_FDC') {
-							_this.windpowerstationName = '牛首山';
-						}
-						if (_this.windPowerStationId == 'XS_FDC') {
-							_this.windpowerstationName = '香山';
-						}
-						if (_this.windPowerStationId == 'SBQ_FDC') {
-							_this.windpowerstationName = '石板泉';
-						}
-						if (_this.windPowerStationId == 'QS_FDC') {
-							_this.windpowerstationName = '青山';
-						}
-						if (_this.windPowerStationId == 'CL_FDC') {
-							_this.windpowerstationName = '崇礼';
-						}
-						if (_this.windPowerStationId == 'KB_FDC') {
-							_this.windpowerstationName = '康保';
-						}
-						if (_this.windPowerStationId == 'YMG_FDC') {
-							_this.windpowerstationName = '雁门关';
-						}
-						if (_this.windPowerStationId == 'TY_FDC') {
-							_this.windpowerstationName = '天源';
-						}
-						if (_this.windPowerStationId == 'AL_FDC') {
-							_this.windpowerstationName = '熬伦';
-						}
-						if (_this.windPowerStationId == 'DBS_FDC') {
-							_this.windpowerstationName = '调兵山';
-						}
-						if (_this.windPowerStationId == 'BZ_FDC') {
-							_this.windpowerstationName = '北镇';
-						}
-						if (_this.windPowerStationId == 'XC_FDC') {
-							_this.windpowerstationName = '兴城';
-						}
-						if (_this.windPowerStationId == 'FS_FDC') {
-							_this.windpowerstationName = '芳山';
-						}
-						if (_this.windPowerStationId == 'LH_FDC') {
-							_this.windpowerstationName = '凌海';
-						}
-						if (_this.windPowerStationId == 'XBQ_FDC') {
-							_this.windpowerstationName = '西八千';
-						}
-						if (_this.windPowerStationId == 'TZS_FDC') {
-							_this.windpowerstationName = '台子山';
-						}
-						if (_this.windPowerStationId == 'YM_FDC') {
-							_this.windpowerstationName = '永茂';
-						}
-						if (_this.windPowerStationId == 'WF_FDC') {
-							_this.windpowerstationName = '万发';
-						}
-					} else {
-						_this.windpowerstationName = '游客身份浏览';
-					}
-
-					_this.pushWindPowerStationNameToSessionStorage(_this.windpowerstationName);
-				},
-				fail: () => {
-					_this.tips = '网络错误,小程序端请检查合法域名';
-				}
-			});
-		},
-		pushWindPowerStationNameToSessionStorage(windpowerstationName) {
-			uni.setStorageSync('windpowerstationName', windpowerstationName);
-			uni.setStorageSync('windpowerstationNames', JSON.stringify(this.windPowerStations));
-			uni.setStorageSync('windPowerStationId', this.windPowerStationId);
-			uni.switchTab({
-				url: '/pages/index/Index'
-			});
-			//sessionStorage.setItem('windpowerstationName', windpowerstationName);
-			//alert("v"+ sessionStorage.getItem("windpowerstationName"));
-			//this.common.goback('/pages/index/Index');
-		},
-		noLogin: function() {
-			let _this = this;
-			uni.request({
-				url: 'http://49.4.78.143:8081/admin/appLogin?username=abc&password=123',
-				data: {},
-				method: 'GET',
-				success: function(res) {
-					console.log(res.data);
-					if (res.data.code == 200) {
-						_this.loginFalg = false;
-						_this.getUser();
-					}
-				},
-				fail: () => {
-					_this.tips = '网络错误,小程序端请检查合法域名';
-				}
-			});
 		},checkIsSoterEnrolledInDeviceFingerPrint() {
 				let _this = this;
                 uni.checkIsSoterEnrolledInDevice({

+ 21 - 133
components/weatherProphethomepage/WeatherProphethomepage.vue

@@ -489,7 +489,7 @@
 				badge: 22,
 				modalName: null,
 				inconList: ["form", "favor", "question", "edit"],
-				address: '宁夏新能源公司',
+				address: '',
 				weatherTodaybutton: true,
 				weatherSevendaybutton: false,
 				weatherFromeighttofifteendaysbutton: false,
@@ -810,18 +810,11 @@
 			// this.pushWindPowerStationNameToSessionStorage("麻黄山");
 			this.viewUserid();
 			this.monitoringAuthority();
-			this.address = this.getWindPowerStationNameToSessionStorage();
-
-			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
-			this.FDC= uni.getStorageSync('windPowerStationId');
 			
-			if (this.address == '宁夏新能源公司') {
-				this.FDC = 'MHS_FDC';
-			}
-			if (this.address == '河北能源集团') {
-				this.FDC = 'CL_FDC';
-			}
-			uni.setStorageSync('windPowerStationId',this.FDC);
+			this.address = this.dataprocessing.getWindPowerStationName();
+			this.FDC=this.dataprocessing.getWindPowerStationId();
+			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
+			
 			this.$nextTick(function() {
 				this.getWeatherDataToday();
 				this.getWeatherData7();
@@ -831,65 +824,9 @@
 			this.cWidth40 = uni.upx2px(5000);
 			this.cHeight40 = uni.upx2px(350);
 			
-			if (this.address == '宁夏新能源公司') {
-				this.windStation = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'MHS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '麻黄山风电场') {
-				this.windStation = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'MHS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '牛首山风电场') {
-				this.windStation = ['牛首山风电场', '麻黄山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'NSS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '石板泉风电场') {
-				this.windStation = ['石板泉风电场', '麻黄山风电场', '牛首山风电场', '青山风电场', '香山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'SBQ_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '香山风电场') {
-				this.windStation = ['香山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'XS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '青山风电场') {
-				this.windStation = ['青山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '香山风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'QS_FDC';
-				// this.getWeatherDataToday();
-			}if (this.address == '河北能源集团') {
-				this.windStation = ['崇礼风电场', '康保风电场', '代县风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'QS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '崇礼风电场') {
-				this.windStation = ['崇礼风电场', '康保风电场', '代县风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'QS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '康保风电场') {
-				this.windStation = ['康保风电场', '崇礼风电场', '代县风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'QS_FDC';
-				// this.getWeatherDataToday();
-			}
-			if (this.address == '代县风电场') {
-				this.windStation = ['代县风电场', '康保风电场', '崇礼风电场'];
-				this.windStationName = this.windStation[0].replace('风电场', '');
-				// this.windPowerStationId = 'QS_FDC';
-				// this.getWeatherDataToday();
-			}
+			this.windStation =this.dataprocessing.getWindPowerStationNameByNames(this.address);
+			this.windStationName = this.windStation[0].replace('风电场', '');
+			
 			this.windStationListHeight = this.windStation.length * 50 + 40 + 'px';
 			this.spopupWrapperHeight = this.windStation.length * 50 + 90 + 'px';
 			this.windowWidth = uni.getSystemInfoSync().windowWidth;
@@ -973,38 +910,11 @@
 			}
 		},
 		onShow() {
-			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
-			this.address = this.getWindPowerStationNameToSessionStorage();
-			if (this.address == '宁夏新能源公司') {
-				this.FDC = 'MHS_FDC';
-			}
-			if (this.address == '麻黄山风电场') {
-				this.FDC = 'MHS_FDC';
-			}
-			if (this.address == '牛首山风电场') {
-				this.FDC = 'NSS_FDC';
-			}
-			if (this.address == '石板泉风电场') {
-				this.FDC = 'SBQ_FDC';
-			}
-			if (this.address == '青山风电场') {
-				this.FDC = 'QS_FDC';
-			}
-			if (this.address == '香山风电场') {
-				this.FDC = 'XS_FDC';
-			}
-			if (this.address == '河北能源集团') {
-				this.FDC = 'CL_FDC';
-			}
-			if (this.address == '崇礼风电场') {
-				this.FDC = 'CL_FDC';
-			}
-			if (this.address == '康保风电场') {
-				this.FDC = 'KB_FDC';
-			}
-			if (this.address == '代县风电场') {
-				this.FDC = 'DX_FDC';
-			}
+			
+			this.address = this.dataprocessing.getWindPowerStationName();
+			this.FDC=this.dataprocessing.getWindPowerStationId();
+			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
+			
 			this.getWeatherData();
 			this.getWeatherDataToday();
 			this.getWeatherData7();
@@ -1121,33 +1031,11 @@
 					_this.choiceIndex = -1;
 					_this.cardCur = index;
 				}, 1000);
-				if (this.windStationName == '麻黄山') {
+				
+				this.FDC =this.dataprocessing.getWindPowerStationNameById(item);
 
-					this.FDC = 'MHS_FDC';
-					
-				}
-				if (this.windStationName == '牛首山') {
-					this.FDC = 'NSS_FDC';
-				}
-				if (this.windStationName == '石板泉') {
-					this.FDC = 'SBQ_FDC';
-				}
-				if (this.windStationName == '青山') {
-					this.FDC = 'QS_FDC';
-				}
-				if (this.windStationName == '香山') {
-					this.FDC = 'XS_FDC';
-				}
-				if (this.windStationName == '崇礼') {
-					this.FDC = 'CL_FDC';
-				}
-				if (this.windStationName == '康保') {
-					this.FDC = 'KB_FDC';
-				}
-				if (this.windStationName == '代县') {
-					this.FDC = 'YMG_FDC';
-				}
-				uni.setStorageSync('windPowerStationId',this.FDC);
+				this.dataprocessing.putWindPowerStationId(this.FDC);
+				//uni.setStorageSync('windPowerStationId',this.FDC);
 				if (this.weatherTodaybutton == true) {
 
 					this.getWeatherDataToday();
@@ -1167,10 +1055,10 @@
 				this.cardCur = e.detail.current;
 				for (let i = 0; i < this.windStation.length; i++) {
 					if (this.cardCur == i) {
-						if (this.address == '宁夏新能源公司' || this.address == '河北能源集团' ) {
-							this.windStationName = this.windStation[i].replace('风电场', '');
-							this.modalWindStationName = this.windStation[i].replace('风电场', '');
-						}
+						// if (this.address == '宁夏新能源公司' || this.address == '河北能源集团' ) {
+						// 	this.windStationName = this.windStation[i].replace('风电场', '');
+						// 	this.modalWindStationName = this.windStation[i].replace('风电场', '');
+						// }
 						if (this.address.search('风电场') != -1) {
 							if (this.windStation[i].search('风电场') != -1) {
 								this.windStationName = this.windStation[i].replace('风电场', '');

+ 2 - 1
main.js

@@ -7,7 +7,8 @@ Vue.component('sunui-password',sunUiPassword);
 Vue.config.productionTip = false
 import store from './common/store.js';
 App.mpType = 'app'
-
+import Dataprocessing from './common/dataprocessing.js';
+Vue.prototype.dataprocessing=Dataprocessing;
 import Common from './common/common.js';
 Vue.prototype.common = Common;
 const app = new Vue({

+ 13 - 97
pages/forecast/Forecast.vue

@@ -291,34 +291,9 @@ export default {
 			badge: 22,
 			inconList: ['form', 'favor', 'question', 'edit'],
 			modalName: null,
-			address: '宁夏新能源公司',
+			address: '',
 			drawerList: [],
-			plusDrawerList: [
-				{
-					name: '宁夏新能源公司',
-					windPowerStationId: 'NINGXIAXINNENGYUANGONGSI'
-				},
-				{
-					name: '牛首山风电场',
-					windPowerStationId: 'NSS_FDC'
-				},
-				{
-					name: '香山风电场',
-					windPowerStationId: 'XS_FDC'
-				},
-				{
-					name: '石板泉风电场',
-					windPowerStationId: 'SBQ_FDC'
-				},
-				{
-					name: '青山风电场',
-					windPowerStationId: 'QS_FDC'
-				},
-				{
-					name: '麻黄山风电场',
-					windPowerStationId: 'MHS_FDC'
-				}
-			],
+			plusDrawerList: [],
 			permissionsInformation:[]
 		};
 	},
@@ -329,18 +304,12 @@ export default {
 		// this.pushWindPowerStationNameToSessionStorage("麻黄山");
 		this.viewUserid();
 		this.monitoringAuthority();
-		this.address = this.getWindPowerStationNameToSessionStorage();
-	
-		this.windPowerStationId = uni.getStorageSync('windPowerStationId');
-		this.FDC= uni.getStorageSync('windPowerStationId');
 		
-		if (this.address == '宁夏新能源公司') {
-			this.FDC = 'MHS_FDC';
-		}
-		if (this.address == '河北能源集团') {
-			this.FDC = 'CL_FDC';
-		}
-		uni.setStorageSync('windPowerStationId',this.FDC);
+		this.address = this.dataprocessing.getWindPowerStationName();
+		this.FDC=this.dataprocessing.getWindPowerStationId();
+		this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
+		
+
 		this.$nextTick(function() {
 			//this.getWeatherDataToday();
 			//this.getWeatherData7();
@@ -350,65 +319,12 @@ export default {
 		this.cWidth40 = uni.upx2px(5000);
 		this.cHeight40 = uni.upx2px(350);
 		
-		if (this.address == '宁夏新能源公司') {
-			this.windStation = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'MHS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '麻黄山风电场') {
-			this.windStation = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'MHS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '牛首山风电场') {
-			this.windStation = ['牛首山风电场', '麻黄山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'NSS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '石板泉风电场') {
-			this.windStation = ['石板泉风电场', '麻黄山风电场', '牛首山风电场', '青山风电场', '香山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'SBQ_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '香山风电场') {
-			this.windStation = ['香山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'XS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '青山风电场') {
-			this.windStation = ['青山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '香山风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'QS_FDC';
-			// this.getWeatherDataToday();
-		}if (this.address == '河北能源集团') {
-			this.windStation = ['崇礼风电场', '康保风电场', '代县风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'QS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '崇礼风电场') {
-			this.windStation = ['崇礼风电场', '康保风电场', '代县风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'QS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '康保风电场') {
-			this.windStation = ['康保风电场', '崇礼风电场', '代县风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'QS_FDC';
-			// this.getWeatherDataToday();
-		}
-		if (this.address == '代县风电场') {
-			this.windStation = ['代县风电场', '康保风电场', '崇礼风电场'];
-			this.windStationName = this.windStation[0].replace('风电场', '');
-			// this.windPowerStationId = 'QS_FDC';
-			// this.getWeatherDataToday();
-		}
+		
+
+		this.windStation =this.dataprocessing.getWindPowerStationNameByNames(this.address);
+		this.windStationName = this.windStation[0].replace('风电场', '');
+		
+		
 		
 	},
 	

+ 7 - 33
pages/index/Index.vue

@@ -959,25 +959,10 @@
 		created: function() {
 			this.viewUserid();
 			this.monitoringAuthority();
-			this.address = this.getWindPowerStationNameToSessionStorage();
-
-			if (this.address == '') {
-				this.pushWindPowerStationNameToSessionStorage('河北能源集团');
-				this.address = this.getWindPowerStationNameToSessionStorage();
-			}
-			if (this.address == '河北能源集团') {
-				this.FDC = '0';
-			}
-			if (this.address == '崇礼风电场') {
-				this.FDC = 'CL_FDC';
-			}
-			if (this.address == '代县风电场') {
-				this.FDC = 'DX_FDC';
-			}
-			if (this.address == '康保风电场') {
-				this.FDC = 'KB_FDC';
-			}
-			uni.setStorageSync('windPowerStationId', this.FDC);
+			
+			this.address = this.dataprocessing.getWindPowerStationName();
+			this.FDC=this.dataprocessing.getWindPowerStationId();
+			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
 
 
 		},
@@ -1019,20 +1004,9 @@
 			this.hideModal();
 		},
 		onShow() {
-			this.windPowerStationId = uni.getStorageSync('windPowerStationId');
-			this.address = this.getWindPowerStationNameToSessionStorage();
-			if (this.address == '河北能源集团') {
-				this.FDC = '0';
-			}
-			if (this.address == '崇礼风电场') {
-				this.FDC = 'CL_FDC';
-			}
-			if (this.address == '代县风电场') {
-				this.FDC = 'DX_FDC';
-			}
-			if (this.address == '康保风电场') {
-				this.FDC = 'KB_FDC';
-			}
+			this.address = this.dataprocessing.getWindPowerStationName();
+			this.FDC=this.dataprocessing.getWindPowerStationId();
+			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
 		},
 		methods: {
 			viewUserid: function() {