Kaynağa Gözat

fix:“优化设备列表页面会自动刷新的问题”

soobin 1 yıl önce
ebeveyn
işleme
4e2fb340ad

+ 8 - 7
pages/Charts/equipmentStatistics.vue

@@ -351,8 +351,8 @@
 				// console.log("adminId:" + this.adminId)
 				_self = this;
 				//图表中图
-				this.cWidth = uni.upx2px(690);
-				this.cHeight = uni.upx2px(500);
+				this.cWidth = uni.upx2px(700);
+				this.cHeight = uni.upx2px(550);
 
 				await this.initDateRang(new Date(), 'day');
 				await this.initDateRang(new Date(), 'week');
@@ -1385,6 +1385,7 @@
 		height: 80upx;
 		width: 680upx;
 		margin: auto;
+		margin-top: 15px;
 		box-shadow: 0upx 0upx 10upx #D3D3D3;
 	}
 
@@ -1394,11 +1395,11 @@
 	}
 
 	.qiun-charts {
-		width: 690upx;
-		height: 550upx;
+		width: 750upx;
+		height: 600upx;
 		padding-top: 50upx;
 		background-color: #FFFFFF;
-		margin: auto;
+		/* margin: auto; */
 	}
 
 	.qiun-charts2 {
@@ -1410,8 +1411,8 @@
 	}
 
 	.charts {
-		width: 690upx;
-		height: 550upx;
+		width: 700upx;
+		height: 600upx;
 		background-color: #FFFFFF;
 		margin: auto;
 	}

+ 27 - 23
pages/User/equipmentStatusList.vue

@@ -387,6 +387,7 @@
 				index: 0,
 				searchClientId: null,
 				searchDeviceName: null,
+				firstShow: true, // 添加一个标志变量
 			}
 		},
 		computed: {
@@ -403,30 +404,33 @@
 			this.getEquipmentListData();
 		},
 		onShow() {
-			this.input = this.input + 1;
-			this.globalUser = uni.getStorageSync("globalUser");
-			this.globalUser.offset = 0;
-			this.globalUser.limit = 20;
-			this.searchClientId = null;
-			this.searchDeviceName = null;
-			this.globalUser.deviceName = null;
-			this.globalUser.clientId = null;
-			uni.setNavigationBarTitle({
-				title: this.$t('equipmentStatusList.title')
-			});
-			uni.setTabBarItem({
-				index: 3,
-				text: this.$t('tabs.tab4')
-			});
-			var token = uni.getStorageSync("token");
-			if (token.length > 1) {
-				this.getEquipmentListData();
-				this.upBtn = false;
-				this.nextBtn = true;
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
+			if (this.firstShow) {
+				this.input = this.input + 1;
+				this.globalUser = uni.getStorageSync("globalUser");
+				this.globalUser.offset = 0;
+				this.globalUser.limit = 20;
+				this.searchClientId = null;
+				this.searchDeviceName = null;
+				this.globalUser.deviceName = null;
+				this.globalUser.clientId = null;
+				uni.setNavigationBarTitle({
+					title: this.$t('equipmentStatusList.title')
+				});
+				uni.setTabBarItem({
+					index: 3,
+					text: this.$t('tabs.tab4')
 				});
+				var token = uni.getStorageSync("token");
+				if (token.length > 1) {
+					this.getEquipmentListData();
+					this.upBtn = false;
+					this.nextBtn = true;
+				} else {
+					uni.reLaunch({
+						url: '../Login/Login',
+					});
+				}
+				this.firstShow = false;
 			}
 
 		},