klzhangweiya 2 лет назад
Родитель
Сommit
884262f22e
35 измененных файлов с 72 добавлено и 78 удалено
  1. 1 2
      VbdsmUI_V2.1.1/src/pc/manage/classic.html
  2. 1 1
      VbdsmUI_V2.1.1/src/pc/manage/js/classic.util.js
  3. 70 1
      VbdsmUI_V2.1.1/src/pc/manage/plugin/weather/index.html
  4. 0 74
      VbdsmUI_V2.1.1/src/pc/manage/plugin/weather/index.js
  5. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/bigScreen.png
  6. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/electricity_situation.png
  7. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/energycount.png
  8. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/equipment.png
  9. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/oexe.png
  10. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/powerAnalyse.png
  11. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/powerprice.png
  12. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/relationAnalyse_1.png
  13. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/report.png
  14. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/scadadraw.png
  15. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/scadashow.png
  16. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/statisticalAnalysis.png
  17. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/sys_msg.png
  18. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/timeCompare.png
  19. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/water.png
  20. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/waterCount.png
  21. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/waterMonth.png
  22. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/yongqifenxi.png
  23. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/工位考核station.png
  24. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/指标关联分析relationAnalyse.png
  25. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/月报分析monthReport.png
  26. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/检测点档案管理monitor.png
  27. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/热能分析steam.png
  28. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/生产在线考核pline.png
  29. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/用水实时分析onlineWater.png
  30. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/用电时段管理fgptime.png
  31. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/电能分析-powerAnalyse.png
  32. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/电能在线onlinePower.png
  33. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/耗电时比timeCompare.png
  34. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/耗电类比分析categoryCompare.png
  35. BIN
      VbdsmUI_V2.1.1/src/static/images/desktop_image/车间考核machineshop.png

+ 1 - 2
VbdsmUI_V2.1.1/src/pc/manage/classic.html

@@ -26,7 +26,6 @@
 				width: 0px;
 			}
 		</style>
-		<script src="./plugin/weather/index.js" type="text/javascript"></script>
 		<script charset="UTF-8" type="text/javascript"></script>
 	</head>
 
@@ -43,7 +42,7 @@
 				<div class="header" style="width: 100%; height: 100%">
 					<div class="right_navbar">
 						<!--<a id="toDesktopBtn" class="easyui-linkbutton">切换到桌面版</a>-->
-						<div class="weatherWX" id="weatherWX"></div>
+<!--						<div class="weatherWX" id="weatherWX"></div>-->
 						<div class="portrait">
 							<a><img src="css/img/head.png" /></a>
 							<ul>

+ 1 - 1
VbdsmUI_V2.1.1/src/pc/manage/js/classic.util.js

@@ -9,7 +9,7 @@ $(function () {
 
 	loadData()
 	//getWinXin()
-	getGdWeather("classic");
+	//getGdWeather("classic");
 	$("#basicBtn").click(function () {
 		var tabTitle = $(this).text()
 		var url = $(this).attr("src")

+ 70 - 1
VbdsmUI_V2.1.1/src/pc/manage/plugin/weather/index.html

@@ -16,7 +16,6 @@
 				margin-left: -6px;
 			}
 		</style>
-         <script src="./index.js"></script>
 		<script charset="UTF-8" type="text/javascript"></script>
 	</head>
 	<body>
@@ -64,6 +63,76 @@
 					},
 				})
 			}
+
+			//高德地图获取天气
+			function getAdCode(){
+				return new Promise((resolve, reject)=>{
+					$.ajax({
+						url: "https://restapi.amap.com/v3/ip?key=ee001a52e68437f9a030eaa01c3a9646",
+						type: 'get',
+						dataType: 'json',
+						success: function (data) {
+							resolve(data);
+						},
+						error: function (data) {
+							reject(data);
+						}
+					})
+				})
+			}
+			function getGdWeather() {
+				getAdCode().then((adcode)=>{
+					if(adcode && adcode.status == "1"){
+						$.ajax({
+							url: `https://restapi.amap.com/v3/weather/weatherInfo?key=ee001a52e68437f9a030eaa01c3a9646&city=${adcode.adcode}&extensions=base`,
+							type: 'get',
+							dataType: 'json',
+							success: function (data) {
+								if(data && data.status == "1"){
+									var weather = data.lives[0];
+									let nowText = new Date(weather.reporttime).toLocaleDateString('zh').replaceAll('/', '-')
+									var oSpan = document.getElementsByClassName('info');
+									oSpan[0].innerHTML = weather.city;
+									oSpan[1].innerHTML = nowText;
+									oSpan[2].innerHTML = weather.temperature+ "°C";
+									oSpan[3].innerHTML = weather.winddirection + " " + weather.windpower + "级";
+									var firstImg = document.getElementsByTagName("img")[0];
+									var code = getWeatherImage(weather.weather);
+									console.error(code)
+									firstImg.src = "./images/weather_icon/" + encodeURI(code) + ".png"
+								}
+							},
+							error: function (data) {
+								console.error(data)
+							}
+						})
+					}
+				})
+			}
+
+
+			const iconWeatherMap = {
+				'风': ['有风', '平静', '微风', '和风', '清风', '强风/劲风', '疾风', '大风', '烈风', '风暴', '狂爆风', '飓风', '热带风暴', '龙卷风'],
+				'多云': ['少云', '晴间多云', '多云'],
+				'雪': ['雪', '阵雪', '小雪', '中雪', '大雪', '暴雪', '小雪-中雪', '中雪-大雪', '大雪-暴雪', '冷'],
+				'雾': ['浮尘', '扬沙', '沙尘暴', '强沙尘暴', '雾', '浓雾', '强浓雾', '轻雾', '大雾', '特强浓雾'],
+				'晴': ['晴', '热'],
+				'雨夹雪': ['雨雪天气', '雨夹雪', '阵雨夹雪'],
+				'雨': ['阵雨', '雷阵雨', '雷阵雨并伴有冰雹', '小雨', '中雨', '大雨', '暴雨', '大暴雨', '特大暴雨', '强阵雨', '强雷阵雨', '极端降雨', '毛毛雨/细雨', '雨', '小雨-中雨', '中雨-大雨', '大雨-暴雨', '暴雨-大暴雨', '大暴雨-特大暴雨', '冻雨'],
+				'阴': ['阴', '霾', '中度霾', '重度霾', '严重霾', '未知']
+			}
+			function getWeatherImage(weather) {
+				for (const weatherKey in iconWeatherMap) {
+					if (Object.hasOwnProperty.call(iconWeatherMap, weatherKey)) {
+						const weatherNames = iconWeatherMap[weatherKey]
+						const findWeatherItem = weatherNames.find(name => weather === name)
+						// 如果找了某一类的图标了,那重新赋值url
+						if (findWeatherItem) {
+							return weatherKey
+						}
+					}
+				}
+			}
 		</script>
 	</body>
 </html>

+ 0 - 74
VbdsmUI_V2.1.1/src/pc/manage/plugin/weather/index.js

@@ -159,77 +159,3 @@ function createUrl(cname) {
     return urls;
 }
 
-//高德地图获取天气
-function getAdcode(){
-    return new Promise((resolve, reject)=>{
-        $.ajax({
-            url: "https://restapi.amap.com/v3/ip?key=ee001a52e68437f9a030eaa01c3a9646",
-            type: 'get',
-            dataType: 'json',
-            success: function (data) {
-                resolve(data);
-            },
-            error: function (data) {
-                reject(data);
-            }
-        })
-    })
-}
-function getGdWeather(mode) {
-    getAdcode().then((adcode)=>{
-        if(adcode && adcode.status == "1"){
-            $.ajax({
-                url: `https://restapi.amap.com/v3/weather/weatherInfo?key=ee001a52e68437f9a030eaa01c3a9646&city=${adcode.adcode}&extensions=base`,
-                type: 'get',
-                dataType: 'json',
-                success: function (data) {
-                    if(data && data.status == "1"){
-                        var weather = data.lives[0];
-                        let nowText = new Date(weather.reporttime).toLocaleDateString('zh').replaceAll('/', '-')
-                        if(mode=="classic"){
-                            var name = weather.city + ' ' + nowText + ' ' +
-                                weather.temperature + "°C" + ' ' + weather.winddirection+ ' ' + weather.windpower+ '级';
-                            $("#weatherWX").html(name);
-                        }else{
-                            var oSpan = document.getElementsByClassName('info');
-                            oSpan[0].innerHTML = weather.city;
-                            oSpan[1].innerHTML = nowText;
-                            oSpan[2].innerHTML = weather.temperature+ "°C";
-                            oSpan[3].innerHTML = weather.winddirection + " " + weather.windpower + "级";
-                            var firstImg = document.getElementsByTagName("img")[0];
-                            var code = getWeatherImage(weather.weather);
-                            firstImg.src = "./images/weather_icon/" + encodeURI(code) + ".png"
-                        }
-                    }
-                },
-                error: function (data) {
-                    console.error(data)
-                }
-            })
-        }
-    })
-}
-
-
-const iconWeatherMap = {
-    '风': ['有风', '平静', '微风', '和风', '清风', '强风/劲风', '疾风', '大风', '烈风', '风暴', '狂爆风', '飓风', '热带风暴', '龙卷风'],
-    '多云': ['少云', '晴间多云', '多云'],
-    '雪': ['雪', '阵雪', '小雪', '中雪', '大雪', '暴雪', '小雪-中雪', '中雪-大雪', '大雪-暴雪', '冷'],
-    '雾': ['浮尘', '扬沙', '沙尘暴', '强沙尘暴', '雾', '浓雾', '强浓雾', '轻雾', '大雾', '特强浓雾'],
-    '晴': ['晴', '热'],
-    '雨夹雪': ['雨雪天气', '雨夹雪', '阵雨夹雪'],
-    '雨': ['阵雨', '雷阵雨', '雷阵雨并伴有冰雹', '小雨', '中雨', '大雨', '暴雨', '大暴雨', '特大暴雨', '强阵雨', '强雷阵雨', '极端降雨', '毛毛雨/细雨', '雨', '小雨-中雨', '中雨-大雨', '大雨-暴雨', '暴雨-大暴雨', '大暴雨-特大暴雨', '冻雨'],
-    '阴': ['阴', '霾', '中度霾', '重度霾', '严重霾', '未知']
-}
-function getWeatherImage(weather) {
-    for (const weatherKey in iconWeatherMap) {
-        if (Object.hasOwnProperty.call(iconWeatherMap, weatherKey)) {
-            const weatherNames = iconWeatherMap[weatherKey]
-            const findWeatherItem = weatherNames.find(name => weather === name)
-            // 如果找了某一类的图标了,那重新赋值url
-            if (findWeatherItem) {
-                return weatherKey
-            }
-        }
-    }
-}

BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/bigScreen.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/electricity_situation.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/energycount.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/equipment.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/oexe.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/powerAnalyse.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/powerprice.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/relationAnalyse_1.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/report.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/scadadraw.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/scadashow.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/statisticalAnalysis.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/sys_msg.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/timeCompare.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/water.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/waterCount.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/waterMonth.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/yongqifenxi.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/工位考核station.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/指标关联分析relationAnalyse.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/月报分析monthReport.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/检测点档案管理monitor.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/热能分析steam.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/生产在线考核pline.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/用水实时分析onlineWater.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/用电时段管理fgptime.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/电能分析-powerAnalyse.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/电能在线onlinePower.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/耗电时比timeCompare.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/耗电类比分析categoryCompare.png


BIN
VbdsmUI_V2.1.1/src/static/images/desktop_image/车间考核machineshop.png