From d74e125a03426aebf9bc52b5a824f2cb09538db2 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 07 二月 2024 20:07:27 +0800
Subject: [PATCH] #

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

diff --git a/Monitor-APP/pages/index/index.vue b/Monitor-APP/pages/index/index.vue
index dca538d..b24e432 100644
--- a/Monitor-APP/pages/index/index.vue
+++ b/Monitor-APP/pages/index/index.vue
@@ -6,7 +6,7 @@
 			<view class="head">
 				<text @click="port()">鑷姩浠撳簱WCS鐩戞帶骞冲彴</text>
 				<view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
-				<view class="button-left" @click="url()"></view>
+				<view class="button-left" @click="ejected()"></view>
 				<view class="button-right" @click="ledId()"></view>
 			</view>
 			<view class="main">
@@ -25,9 +25,11 @@
 								<!-- 鐩爣绔� -->
 								<view class="box-items">{{staNo}}</view>
 								<!-- 鍟嗗搧缂栧彿 -->
-								<view class="box-items">{{matnr}}</view>
+								<!-- <view class="box-items">{{matnr}}</view> -->
 								<!-- 鍟嗗搧鍚嶇О -->
 								<view class="box-items">{{maknx}}</view>
+								<!-- 鍟嗗搧鍚嶇О -->
+								<view class="box-items">{{specs}}</view>
 								<!-- 鍑哄簱鏁伴噺 -->
 								<view class="box-items">{{count}}</view>
 							</view>
@@ -74,7 +76,7 @@
 			<view class="head">
 				<text @click="port()">鑷姩浠撳簱WCS鐩戞帶骞冲彴</text>
 				<view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
-				<view class="button-left" @click="url()"></view>
+				<view class="button-left" @click="ejected()"></view>
 				<view class="button-right" @click="ledId()"></view>
 			</view>
 			<view class="main">
@@ -187,7 +189,6 @@
 								<p class="english">Today</p>
 							</view>
 							<view class="sub-main">
-								<!-- 鎶樼嚎鍥� -->
 								<view class="charts-box ring">
 									<qiun-data-charts type="ring" :opts="{legend:{position:'bottom'}}" :eopts="ringOpts" :chartData="chartsDataPie2" :echartsH5="true" :echartsApp="true"/>
 								</view>
@@ -218,8 +219,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>
@@ -251,6 +252,46 @@
 				<uni-popup-dialog ref="inputClose" mode="input" title="閰嶇疆鍫嗗灈鏈�" :value="crnId"
 					placeholder="绀轰緥:1" @confirm="crnConfirm"></uni-popup-dialog>
 			</uni-popup>
+		</view>
+		<!-- 鑷畾涔夊脊鍑哄眰 -->
+		<view class="eject-mask" v-show="ejectShow">
+			<view class="eject">
+				<!-- 寮瑰嚭title -->
+				<view class="eject-title">淇敼 / 閰嶇疆</view>
+				<!-- input -->
+				<view class="eject-input">
+					<view class="item">
+						<view class="desc">ip锛�</view>
+						<view class="input">
+							<input type="text" v-model="baseIP">
+						</view>
+					</view>
+					<view class="item">
+						<view class="desc">port锛�</view>
+						<view class="input">
+							<input type="text" v-model="basePort">
+						</view>
+					</view>
+					<view class="item">
+						<view class="desc">ledId锛�</view>
+						<view class="input">
+							<input type="text" v-model="baseLedId">
+						</view>
+					</view>
+					<view class="item">
+						<view class="desc">CrnId锛�</view>
+						<view class="input">
+							<input type="text" v-model="baseCrnId">
+						</view>
+					</view>
+				</view>
+				<!-- button -->
+				<view class="eject-button">
+					<view class="button-item" @click="ejectClose">鍙� 娑�</view>
+					<view class="button-item" @click="ejectConfirm">纭� 璁�</view>
+				</view>
+			</view>
+			
 		</view>
 	</view>
 </template>
@@ -302,7 +343,7 @@
 				week:'鏄熸湡鍥�',
 				ani:'',
 				// move: 'upMove 1.5s 1;',
-				move:true,
+				move:false,
 				topMove:'topUp',
 				floorMove:'',
 				version:'',
@@ -313,6 +354,7 @@
 				staNo:'',
 				matnr:'',
 				maknx:'',
+				specs:'',
 				count:'',
 				orderNo:null,
 				doneOfTray:'',
@@ -330,6 +372,8 @@
 				interval:1000, // 璋冪敤鏃堕暱
 				duration:8000, // 绉诲姩閫熷害
 				matList:[], // 璁㈠崟鍒楄〃
+				ejectShow: false,
+				
 			}
 		},
 		mounted() {
@@ -338,38 +382,39 @@
 			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.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUrl
+			this.getUrl()
+		},
+		onLoad() {
+			
 		},
 		onReady() {
-			// 鑾峰緱鍒濆鏁版嵁
-			setTimeout(() => {
+			setInterval(() => {
+				// 鑾峰緱鍒濆鏁版嵁
 				this.initlineChart();
 				this.initPieChart();
-			}, 0);
-			setTimeout(() => {
+				// 涓婚〉淇℃伅
 				this.getServerData();
 				this.getOther();
-				this.getPakin();
-			}, 1000);
-			setInterval(() => {
+				// 鍏朵粬淇℃伅
 				this.getDate();
 				this.getPakin();
 				this.getError();
 				// this.getYYY();
 				// this.getEEE();
-				this.animation();
+				this.animation()
+				this.getUrl()
 			},1000)
 		},
 		methods: {
+			// 鑾峰彇url
+			getUrl() {
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUrl
+				this.chartsDataLine1 = JSON.parse(JSON.stringify(demodata.Line))
+			},
 			// 鑾峰彇閿欒淇℃伅
 			getYYY() {
 				let that = this
@@ -379,6 +424,7 @@
 				// 娴嬭瘯鐢� 鈫�
 				// 杩斿洖缁撴灉鏈夊�� 涓斿�间笉绛変簬绌哄�� 灏辨槸鏈夐敊璇俊鎭渶瑕佸睍绀�
 				if (res.data && res.data !== "") {
+					
 					that.errorMsg = res.data
 					that.errorShow = true
 					that.move = false // 鏄剧ず
@@ -401,8 +447,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) {
@@ -426,7 +470,6 @@
 						that.doneOfUnit = '宸插嚭绠辨暟锛�' + res.data[0].doneOfUnit
 						that.totalOfUnit = '鎬荤鏁帮細' + res.data[0].totalOfUnit
 						if (that.errorShow) {
-									// that.pakinShow = false
 									return;
 								} else {
 									that.newspaper = newsData
@@ -437,42 +480,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() {
@@ -485,7 +492,6 @@
 					},
 					method:'GET',
 					success(result) {
-						// console.log(result);
 						res = result.data 
 						if (res.data && res.data !== "") {
 							that.errorMsg = res.data
@@ -493,11 +499,11 @@
 							that.move = false // 鏄剧ず
 						} else {
 							that.errorShow = false
-							if (that.pakinShow) {
-								return;
-							} else {
-								that.move = true // 闅愯棌
-							}
+							// if (that.pakinShow) {
+							// 	return;
+							// } else {
+							// 	// that.move = true // 闅愯棌
+							// }
 						}
 					}
 				});
@@ -515,19 +521,21 @@
 					},
 					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
+							that.specs = '瑙勬牸锛�' + res.data[0].matDtos[0].specs
 							that.count = '鍑哄簱鏁伴噺锛�' + res.data[0].matDtos[0].count
 							if (res.data[0].orderNo) {
 								that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
@@ -542,26 +550,19 @@
 							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) {
-					// 涓婂眰鍚戜笂 / 涓嬪眰鍚戜笂
+				if (this.move) { 
 					this.topMove = 'topUp'
 					this.floorMove = 'floorUp'
 				} else {
-					// 涓婂眰鍚戜笅 / 涓嬪眰鍚戜笅
 					this.topMove = 'topDown'
 					this.floorMove = 'floorDown'
 				}
@@ -581,8 +582,8 @@
 					url: that.commonUrl + "/monitor/line/charts",
 					method:'GET',
 					success(result) {
-						// console.log(result)
 						var res = result.data
+						console.log(result);
 						if (res.code === 200) {
 							that.chartsData.Line.categories = [
 								that.getDateFormat(-11),that.getDateFormat(-10),that.getDateFormat(-9),that.getDateFormat(-8),
@@ -622,6 +623,7 @@
 						ledId: 1,
 					},
 					success(result) {
+						console.log(result);
 						var res = result.data
 						if (res.code === 200) {
 							that.xDistance = res.data.xDistance
@@ -636,33 +638,21 @@
 					}
 				})
 			},
-			port() {
-				this.$refs.port.open()
+			ejected () {
+				this.ejectShow = true
 			},
-			url() {
-				this.$refs.url.open()
-			},
-			ledId() {
-				this.$refs.ledId.open()
-			},
-			crn() {
-				this.$refs.crnId.open()
-			},
-			baseUrlConfirm(val) {
-				this.baseIp = val
-				uni.setStorageSync('BaseIp', this.baseIp);
-			},
-			ledIdConfirm(val) {
-				this.baseLedId = val
+			// 寮瑰嚭灞傜‘璁�
+			ejectConfirm() {
+				uni.setStorageSync('BaseIp', this.baseIP);
 				uni.setStorageSync('BaseLedId', this.baseLedId);
-			},
-			portConfirm(val) {
-				this.basePort = val
 				uni.setStorageSync('BasePort',this.basePort);
-			},
-			crnConfirm(val) {
-				this.baseCrnId = val
 				uni.setStorageSync('BaseCrnId',this.baseCrnId);
+				this.getUrl()
+				this.ejectShow = false
+			},
+			// 寮瑰嚭灞傚彇娑�
+			ejectClose() {
+				this.ejectShow = false
 			},
 			getServerData() {
 				this.chartsDataLine1=JSON.parse(JSON.stringify(this.chartsData.Line))
@@ -695,6 +685,88 @@
 </script>
 
 <style>
+	/* 寮瑰嚭:閰嶇疆鍖哄煙 */
+	.eject-mask {
+		width: 100%;
+		height: 100%;
+		background-color: rgba(0, 0, 0, 0.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 999;
+		display: flex;
+		align-items: center;
+		justify-content: center;	
+	}
+	.eject{
+		position: relative;
+		width: 600px;
+		height: 350px;
+		background-color: #eaeaea;
+		border-radius: 25rpx;
+	}
+	.eject-title {
+		width: 100%;
+		height: 100px;
+		line-height: 100px;
+		font-size: 20px;
+		font-weight: 700;
+		color: 	#606266;
+		text-align: center;
+	}
+	.eject-input {
+		
+	}
+	.item {
+		display: flex;
+		align-items: center;
+		margin: 10px 0 0 0;
+	}
+	.desc {
+		display: inline-block;
+		width: 40%;
+		text-align: right;
+		color: #606266;
+		font-size: 18px;
+	}
+	.input {
+		display: flex;
+		align-items: center;
+		padding-left: 5px;
+		padding-right: 5px;
+		width: 100%;
+		height: 30px;
+		border: 1px solid #C0C4CC;
+		margin-right: 50px;
+	}
+	.eject-input input {
+		width: 100%;
+		
+		
+	}
+	.eject-button {
+		display: flex;
+		align-items: center;
+		position: absolute;
+		bottom: 0;
+		height: 60px;
+		line-height: 60px;
+		width: 100%;
+		border-top: 1px solid #ccc;
+	}
+	.button-item {
+		width: 50%;
+		height: 100%;
+		font-size: 20px;
+		font-weight: bold;
+		text-align: center;
+		color: #909399;
+	}
+	.button-item:last-child {
+		color: #67C23A;
+		
+		border-left: 1px solid #ccc;
+	}
 	.full-width {
 		width: 100%;
 		height: 100%;

--
Gitblit v1.9.1