From a19d10e17b289c35ed08203fd63735bcec96cae8 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 23 七月 2024 18:50:07 +0800
Subject: [PATCH] #

---
 Monitor-APP/pages/home/home.vue |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index 6146452..de5d0d0 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -234,12 +234,12 @@
 											<view style="width: 30%;">{{i+1}} / {{swiperList.length}}</view>
 											<!-- <view style="width: 30%;">鏂欏彿: {{item.matnr}}</view> -->
 											<view style="width: 40%;">鍚嶇О: {{item.maknx}}</view>
-											<view style="width: 30%;">瀹㈡埛: {{item.manu}}</view>
+											<view style="width: 30%;">璁㈠崟: {{item.orderNo}}</view>
 											
 											
 											<view style="width: 30%;">鍑哄簱: {{item.count}} / 鎬绘暟: {{item.total}}</view>
 											<view style="width: 40%;">瑙勬牸: {{item.specs}}</view>
-											<view style="width: 30%;">澶囨敞: {{item.memo}}</view>
+											<view style="width: 30%;">鎵瑰彿: {{item.batch}}</view>
 											
 											
 										</swiper-item>
@@ -391,7 +391,8 @@
 				swiperList: [],
 				timeOut: false,
 				times: 0,
-				currDate: ''
+				currDate: '',
+				socketInfo2: ''
 			}
 		},
 		onShow() {
@@ -415,25 +416,44 @@
 			// this.getUrl()
 		},
 		onLoad() {
+			this.ws()
 			setInterval(()=>{
-				this.getServerData()
-				this.initlineChart()
-				this.initPieChart()
-				this.getOther()
+				// this.getServerData()
+				// this.initlineChart()
+				// this.initPieChart()
+				// this.getOther()
 				// this.getDate()
-				this.getDate2()
+				// this.getDate2()
 				this.getInfo()
-				this.getError()
+				// this.getError()
 				// this.getInfo2()
 				// this.getError2()
-				this.getUrl()
-				this.controller()
+				// this.getUrl()
+				// this.controller()
+				
 				// 娴嬭瘯鐢�
 				
 			},1000)
+			
 		},
 		methods: {
-			timeOut() {
+			ws() {
+				let _this = this
+				_this.connectWS()
+				uni.onSocketOpen(function (res) {
+					console.log("Open");
+				}) 
+				uni.onSocketClose(function (res) {
+					console.log("Close");
+					setInterval(()=>{
+						_this.connectWS()
+					},1000)
+				}) 
+			},
+			connectWS() {
+				uni.connectSocket({ url: `http://127.0.0.1:9090/pswcs/console/websocket`, })
+			},
+			timeOut1() {
 				console.log(this.times);
 			},
 			getUrl() {
@@ -554,7 +574,7 @@
 					},
 					fail(err) {
 						that.timeOut = true
-						that.times = that.times+3
+						that.times = that.times+1
 						that.infoType = 0
 					}
 				})
@@ -570,7 +590,6 @@
 						that.timeOut = false
 						that.times = 0
 						var	res = result.data
-						console.log(res);
 						if (res.data && res.data !== "") {
 							var errorInfo = res.data
 							if (that.infoType == 1) {
@@ -808,6 +827,7 @@
 						ledId: that.baseLedId,
 					},
 					success(result) {
+						console.log(result);
 						var res = result.data
 						if (res.code === 200) {
 							that.baseInfo.xDistance = res.data.xDistance

--
Gitblit v1.9.1