zhangsijie hace 2 años
padre
commit
73fe128f4d

+ 54 - 28
pages/cb/cbd/equip-set/analyse.vue

@@ -213,6 +213,14 @@
 				if (this.wormvalue) {
 					this.timeobj = this.wormtimelist[this.wormvalue]
 				}
+				this.$nextTick(() => {
+					this.getwormline()
+					if (this.topindex == 0) {
+						this.gettabledata()
+					} else if (this.topindex == 1) {
+						this.gettabledata2()
+					}
+				}, 500)
 				console.log(this.timeobj)
 
 			},
@@ -285,13 +293,39 @@
 				if (res.at_ah_info.length != 0) {
 					var aharr = []
 					var atarr = []
+					var pestArr = []
+					let indentText = 0;
 					for (var i = 0; i < res.at_ah_info.length; i++) {
 						var times = new Date(res.at_ah_info[i].addtime * 1000)
 						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" +
 							times.getSeconds())
 						atarr.push(res.at_ah_info[i].at == "" ? "0" : res.at_ah_info[i].at)
 						aharr.push(res.at_ah_info[i].ah == "" ? "0" : res.at_ah_info[i].ah)
+						if (this.checkObj(res.char_data) && res.char_data[this.wormvalue]) {
+							if(res.char_data[this.wormvalue][i-indentText] && (res.char_data[this.wormvalue][i-indentText].addtime == res.at_ah_info[i].addtime)) {
+								pestArr.push(res.char_data[this.wormvalue][i-indentText].sum)
+							} else {
+								indentText ++ 
+								pestArr.push(null)
+							}
+						}
 					}
+					// console.log(this.wormvalue)
+					// if (this.checkObj(res.char_data)) {
+					// 	for (var key in res.char_data) {
+					// 		if (this.wormvalue == key) {
+					// 			var wormobj = {
+					// 				name: key,
+					// 				data: [],
+					// 			}
+					// 			for (var i = 0; i < res.char_data[key].length; i++) {
+					// 				wormobj.data.push(res.char_data[key][i].ah == "" ? "0" : res.char_data[key][i].sum)
+					// 			}
+					// 			obj.push(wormobj)
+					// 		}
+					// 	}
+
+					// }
 					var atobj = {
 						name: '温度',
 						data: atarr,
@@ -302,24 +336,13 @@
 						data: aharr,
 						color: '#6CBBFF'
 					}
+					var pestObj = {
+						name: this.wormvalue,
+						data: pestArr,
+					}
 					obj.push(atobj)
 					obj.push(ahobj)
-				}
-				// console.log(this.wormvalue)
-				if (this.checkObj(res.char_data)) {
-					for (var key in res.char_data) {
-						if (this.wormvalue == key) {
-							var wormobj = {
-								name: key,
-								data: [],
-							}
-							for (var i = 0; i < res.char_data[key].length; i++) {
-								wormobj.data.push(res.char_data[key][i].ah == "" ? "0" : res.char_data[key][i].sum)
-							}
-							obj.push(wormobj)
-						}
-					}
-
+					obj.push(pestObj)
 				}
 				this.showColumn("canvasColumnA", xtitle, obj)
 			},
@@ -526,14 +549,6 @@
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
 			this.getyear()
-			this.$nextTick(() => {
-				this.getwormline()
-				if (this.topindex == 0) {
-					this.gettabledata()
-				} else if (this.topindex == 1) {
-					this.gettabledata2()
-				}
-			}, 500)
 		}
 	}
 </script>
@@ -553,6 +568,7 @@
 		display: flex;
 		background-color: #fff;
 		width: 95%;
+
 		.timesbox {
 			display: flex;
 			justify-content: space-around;
@@ -562,6 +578,7 @@
 			padding: 5px;
 			font-size: 12px;
 			border-radius: 5px;
+
 			image {
 				width: 30rpx;
 				height: 30rpx;
@@ -591,6 +608,7 @@
 			width: 25%;
 			margin-top: 10px;
 			padding: 10px;
+
 			.img {
 				width: 50px;
 				height: 50px;
@@ -600,10 +618,12 @@
 				font-size: 16px;
 				font-weight: 700;
 			}
+
 			p:nth-child(3) {
 				font-size: 12px;
 				margin-top: 5px;
 			}
+
 			p:last-child {
 				font-size: 12px;
 				margin-top: 5px;
@@ -653,8 +673,9 @@
 				// background-color: #F2F2F2;
 				text-align: center;
 				line-height: 50rpx;
-				/deep/.u-icon__icon{
-					color: rgba(0,0,0,0.3);
+
+				/deep/.u-icon__icon {
+					color: rgba(0, 0, 0, 0.3);
 				}
 			}
 		}
@@ -676,6 +697,7 @@
 		overflow-y: auto;
 		margin: 0 auto;
 		background-color: #fff;
+
 		span:first-child {
 			display: inline-block;
 			width: 100px;
@@ -702,11 +724,13 @@
 		margin: 10px auto 20px;
 		// box-shadow: 0 0 10rpx #bcb9ca;
 		background-color: #fff;
+
 		.top_text {
 			width: 100%;
 			display: flex;
 			height: 30px;
 			line-height: 30px;
+
 			.tltle_text {
 				width: 30%;
 				text-align: center;
@@ -719,10 +743,12 @@
 			.title_text_color {
 				width: 30%;
 				text-align: center;
-				.title_item{
+
+				.title_item {
 					border-bottom: 2px solid #64CC82;
 					color: #64CC82;
 				}
+
 				// width: 50%;
 				// border: 2rpx solid #64CC82;
 				// background-color: #64CC82;
@@ -816,4 +842,4 @@
 			line-height: 25px;
 		}
 	}
-</style>
+</style>

+ 2 - 3
pages/disease/cmb.vue

@@ -15,9 +15,8 @@
 					</p>
 					<p>设备名称:{{ eqinfo.device_name || "无" }}</p>
 					<p>
-						最近上报时间:<span v-if="eqinfo.uptime">{{
-              eqinfo.uptime | timeFormat()
-            }}</span><span v-else>{{ eqinfo.addtime | timeFormat() }}</span>
+						最近上报时间:<span v-if="eqinfo.uptime">{{ eqinfo.uptime == 0 ? '无' : eqinfo.uptime | timeFormat()
+            }}</span><span v-else>{{eqinfo.uptime == 0 ? '无' : eqinfo.uptime | timeFormat() }}</span>
 					</p>
 					<p>地址:{{ eqinfo.location || "暂无地址" }}</p>
 				</view>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-service.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/app-service.js


+ 1 - 1
util/api.js

@@ -5,7 +5,7 @@ export const myRequest = (options) => {
 	console.log(BASE_URL,'my request',process.env.NODE_ENV)
 	if (BASE_URL == '') {
 		// BASE_URL = 'http://8.136.98.49:8002'//线上
-		BASE_URL = process.env.NODE_ENV === 'development' ? "http://192.168.0.36:8003" : "http://8.136.98.49:8002"
+		BASE_URL = process.env.NODE_ENV === 'development' ? "http://8.136.98.49:8002" : "http://8.136.98.49:8002"
 		// BASE_URL = 'http://192.168.1.77:8002'
 	}
 	// BASE_URL = 'http://192.168.1.52:8003'