From ad9609c60f8fd0fffecfb0b8c03682caef1f3db8 Mon Sep 17 00:00:00 2001
From: whycq <you@example.com>
Date: 星期三, 16 十一月 2022 23:32:50 +0800
Subject: [PATCH] #

---
 Monitor-APP/pages/index/index.vue |  105 +++++++++++-----------------------------------------
 1 files changed, 23 insertions(+), 82 deletions(-)

diff --git a/Monitor-APP/pages/index/index.vue b/Monitor-APP/pages/index/index.vue
index 521c028..ec4e206 100644
--- a/Monitor-APP/pages/index/index.vue
+++ b/Monitor-APP/pages/index/index.vue
@@ -218,8 +218,8 @@
 						<view class="box-border box-border4"></view>
 						<!-- <text>娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</text>
 						<text>褰撳墠鐗堟湰鍙�</text> -->
-						<view @click="crn()">娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</view>
-						<image src="../../static/barcode.png" mode="aspectFit"></image>
+						<view @click="crn()">鍢夊杽杈归攱鏈烘鑲′唤鏈夐檺鍏徃</view>
+						<!-- <image src="../../static/barcode.png" mode="aspectFit"></image> -->
 					</view>
 				</view>
 			</view>
@@ -342,7 +342,7 @@
 				week:'鏄熸湡鍥�',
 				ani:'',
 				// move: 'upMove 1.5s 1;',
-				move:true,
+				move:false,
 				topMove:'topUp',
 				floorMove:'',
 				version:'',
@@ -380,31 +380,21 @@
 			const BaseLedId = uni.getStorageSync('BaseLedId');
 			const BasePort = uni.getStorageSync('BasePort');
 			const BaseCrnId = uni.getStorageSync('BaseCrnId');
-			// if (BaseIP && BaseLedId) {
 				that.baseIP = BaseIP
 				that.baseLedId = BaseLedId
 				that.basePort = BasePort
 				that.baseCrnId = BaseCrnId
-			// } else {
-			// 	that.baseUrl = ''
-			// 	that.baseLedId = ''
-			// }
 			this.getUrl()
-			console.log(this.commonUrl);
-			// this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUr
 		},
 		onReady() {
-			// 鑾峰緱鍒濆鏁版嵁
-			setTimeout(() => {
+			setInterval(() => {
+				// 鑾峰緱鍒濆鏁版嵁
 				this.initlineChart();
 				this.initPieChart();
-			}, 0);
-			setTimeout(() => {
+				// 涓婚〉淇℃伅
 				this.getServerData();
 				this.getOther();
-				this.getPakin();
-			}, 1000);
-			setInterval(() => {
+				// 鍏朵粬淇℃伅
 				this.getDate();
 				this.getPakin();
 				this.getError();
@@ -416,7 +406,7 @@
 		methods: {
 			// 鑾峰彇url
 			getUrl() {
-				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + "/" +this.baseUrl
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUrl
 			},
 			// 鑾峰彇閿欒淇℃伅
 			getYYY() {
@@ -449,8 +439,6 @@
 				let	res = result.data
 						// 娴嬭瘯鐢� 鈫�
 					if(res.data && res.data !== null) {
-						// that.move = false
-						// title
 						if (res.data[0].ioType === 101) {
 							that.title = '鍏ㄦ澘鍑哄簱'
 						} else if(res.data[0].ioType === 103) {
@@ -474,7 +462,6 @@
 						that.doneOfUnit = '宸插嚭绠辨暟锛�' + res.data[0].doneOfUnit
 						that.totalOfUnit = '鎬荤鏁帮細' + res.data[0].totalOfUnit
 						if (that.errorShow) {
-									// that.pakinShow = false
 									return;
 								} else {
 									that.newspaper = newsData
@@ -485,42 +472,6 @@
 					}
 					
 					
-					// if(res.data && res.data !== null) {
-					// 	if (res.data[0].matDtos.length > 0) {
-					// 		that.pakinShow = true
-					// 		that.pakinGun = true
-					// 		if (res.data[0].ioType === 101) {
-					// 			that.title = '鍏ㄦ澘鍑哄簱'
-					// 		} else if(res.data[0].ioType === 103) {
-					// 			that.title = '鎷f枡鍑哄簱'
-					// 		}
-							
-					// 		if (res.data[0].orderNo) {
-					// 			that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
-					// 			that.swiper = 'swiper-here-oN'
-					// 			that.orderShow = true
-					// 		} else {
-					// 			that.orderNo = null;
-					// 			that.swiper = 'swiper-here'
-					// 			that.orderShow = false
-					// 		}
-					// 		that.staNo = '鐩爣绔�' + res.data[0].staNo
-					// 		for (var i = 0; i < res.data[0].matDtos.length; i++) {
-					// 			var matnr = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch 
-					// 			that.matList.push(matnr)
-					// 		}
-					// 		
-					// 		if (res.data[0].matDtos.length <= 8) {
-					// 			that.errorShow = true
-					// 			that.pakinShow = true
-					// 			that.pakinGun  = false
-					// 		}
-					// 	} else {
-					// 		that.move = true
-					// 		}
-					// } else {
-					// 	that.move = true
-					// }
 			},
 			// 鑾峰彇閿欒淇℃伅
 			getError() {
@@ -533,7 +484,6 @@
 					},
 					method:'GET',
 					success(result) {
-						console.log(result);
 						res = result.data 
 						if (res.data && res.data !== "") {
 							that.errorMsg = res.data
@@ -541,11 +491,11 @@
 							that.move = false // 鏄剧ず
 						} else {
 							that.errorShow = false
-							if (that.pakinShow) {
-								return;
-							} else {
-								that.move = true // 闅愯棌
-							}
+							// if (that.pakinShow) {
+							// 	return;
+							// } else {
+							// 	// that.move = true // 闅愯棌
+							// }
 						}
 					}
 				});
@@ -563,16 +513,17 @@
 					},
 					method:'GET',
 					success(result) {
-						// console.log(result);
 						res = result.data
+						if (that.errorShow) {
+							return;  // 鏈夐敊璇俊鎭�
+						} 
 						if(res.data && res.data !== null) {
-							// that.move = false
-							// title
 							if (res.data[0].ioType === 101) {
 								that.title = '鍏ㄦ澘鍑哄簱'
 							} else if(res.data[0].ioType === 103) {
 								that.title = '妫�鏂欏嚭搴�'
-							}
+							} else
+							that.title = res.data[0].title
 							that.staNo = '鐩爣绔�:' + res.data[0].staNo
 							that.matnr = '鍟嗗搧缂栧彿锛�' + res.data[0].matDtos[0].matnr
 							that.maknx = '鍟嗗搧鍚嶇О锛�' + res.data[0].matDtos[0].maknx
@@ -590,26 +541,20 @@
 							that.totalOfTray = '鎵樼洏鎬绘暟閲忥細' + res.data[0].totalOfTray
 							that.doneOfUnit = '宸插嚭绠辨暟锛�' + res.data[0].doneOfUnit
 							that.totalOfUnit = '鎬荤鏁帮細' + res.data[0].totalOfUnit
-							if (that.errorShow) {
-								// that.pakinShow = false
-								return;
-							} else {
-								that.newspaper = newsData
-								that.move = false
-							}
+							that.newspaper = newsData
+							that.move = false
 						}else {
-								that.move = true
+							that.move = true
 						}
 					}
 				});
 			},
 			animation() {
-				if (this.move) {
-					// 涓婂眰鍚戜笂 / 涓嬪眰鍚戜笂
+				console.log(this.move);
+				if (this.move) { 
 					this.topMove = 'topUp'
 					this.floorMove = 'floorUp'
 				} else {
-					// 涓婂眰鍚戜笅 / 涓嬪眰鍚戜笅
 					this.topMove = 'topDown'
 					this.floorMove = 'floorDown'
 				}
@@ -629,7 +574,6 @@
 					url: that.commonUrl + "/monitor/line/charts",
 					method:'GET',
 					success(result) {
-						console.log(result)
 						var res = result.data
 						if (res.code === 200) {
 							that.chartsData.Line.categories = [
@@ -695,9 +639,6 @@
 				uni.setStorageSync('BasePort',this.basePort);
 				uni.setStorageSync('BaseCrnId',this.baseCrnId);
 				this.getUrl()
-				console.log(uni.getStorageSync('BaseIp'));
-				console.log(this.baseIP);
-				console.log(this.commonUrl);
 				this.ejectShow = false
 			},
 			// 寮瑰嚭灞傚彇娑�

--
Gitblit v1.9.1