Explorar o código

虫情分析日期问题

zhangsijie %!s(int64=2) %!d(string=hai) anos
pai
achega
c85b53073f
Modificáronse 35 ficheiros con 118 adicións e 102 borrados
  1. 3 3
      manifest.json
  2. 97 81
      pages/cb/cbd/equip-set/analyse.vue
  3. BIN=BIN
      unpackage/cache/apk/__UNI__DBA6730_cm.apk
  4. 1 1
      unpackage/cache/apk/apkurl
  5. 1 1
      unpackage/cache/apk/cmManifestCache.json
  6. BIN=BIN
      unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-hdpi.png
  7. BIN=BIN
      unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xhdpi.png
  8. BIN=BIN
      unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xxhdpi.png
  9. BIN=BIN
      unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xxxhdpi.png
  10. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js
  11. 4 4
      unpackage/cache/wgt/__UNI__DBA6730/app-service.js
  12. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-view.js
  13. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/manifest.json
  14. 1 1
      unpackage/dist/build/app-plus/app-config-service.js
  15. 4 4
      unpackage/dist/build/app-plus/app-service.js
  16. 1 1
      unpackage/dist/build/app-plus/app-view.js
  17. 1 1
      unpackage/dist/build/app-plus/manifest.json
  18. BIN=BIN
      unpackage/res/icons/1024x1024.png
  19. BIN=BIN
      unpackage/res/icons/120x120.png
  20. BIN=BIN
      unpackage/res/icons/144x144.png
  21. BIN=BIN
      unpackage/res/icons/152x152.png
  22. BIN=BIN
      unpackage/res/icons/167x167.png
  23. BIN=BIN
      unpackage/res/icons/180x180.png
  24. BIN=BIN
      unpackage/res/icons/192x192.png
  25. BIN=BIN
      unpackage/res/icons/20x20.png
  26. BIN=BIN
      unpackage/res/icons/29x29.png
  27. BIN=BIN
      unpackage/res/icons/40x40.png
  28. BIN=BIN
      unpackage/res/icons/58x58.png
  29. BIN=BIN
      unpackage/res/icons/60x60.png
  30. BIN=BIN
      unpackage/res/icons/72x72.png
  31. BIN=BIN
      unpackage/res/icons/76x76.png
  32. BIN=BIN
      unpackage/res/icons/80x80.png
  33. BIN=BIN
      unpackage/res/icons/87x87.png
  34. BIN=BIN
      unpackage/res/icons/96x96.png
  35. 2 2
      util/neutral.js

+ 3 - 3
manifest.json

@@ -1,9 +1,9 @@
 {
-    "name" : "云飞智控",
+    "name" : "智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.7.2",
-    "versionCode" : 172,
+    "versionName" : "1.7.3",
+    "versionCode" : 173,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 97 - 81
pages/cb/cbd/equip-set/analyse.vue

@@ -40,21 +40,22 @@
 				</view>
 			</view>
 			<view class="selecttimes" @click="tiemshow=!tiemshow">
-					<view class="" style="line-height: 28px;">
-						日期
-					</view>
-					<view class="timesbox">
-						<!-- <image
+				<view class="" style="line-height: 28px;">
+					日期
+				</view>
+				<view class="timesbox">
+					<!-- <image
 						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
 						mode=""></image> -->
-						<p>{{oldtime}}</p>
-						<p class="or">至</p>
-						<p>{{newtime}}</p>
-						<!-- <u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon> -->
-					</view>
-					<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
-					<u-button type="primary" text="归档时间" size="mini" @click="timeshow = true">归档时间</u-button>
-					<u-select v-model="timeshow" mode="mutil-column" :list="list" @confirm="Hourchange" :default-value="defaultValue"></u-select>
+					<p>{{oldtime}}</p>
+					<p class="or">至</p>
+					<p>{{newtime}}</p>
+					<!-- <u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon> -->
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+				<u-button type="primary" text="归档时间" size="mini" @click="timeshow = true">归档时间</u-button>
+				<u-select v-model="timeshow" mode="mutil-column" :list="list" @confirm="Hourchange"
+					:default-value="defaultValue"></u-select>
 			</view>
 			<view class="tendency">
 				<canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
@@ -146,7 +147,7 @@
 				sp_hour_st: '00:00', // 归档开始时间
 				sp_hour_ed: '00:00', // 归档结束时间
 				timeshow: false, // 归档时间设置弹框
-				defaultValue:[0,0],
+				defaultValue: [0, 0],
 				list: [
 					[{
 							value: '00:00',
@@ -490,74 +491,86 @@
 				console.log(ringarr)
 				this.progresslist = ringarr
 			},
+			// 根据起始日期获取中间时间列表
+			getDates(startDate, endDate) {
+				var dates = [];
+				var currentDate = new Date(startDate);
+				endDate = new Date(endDate);
+
+				while (currentDate <= endDate) {
+					dates.push(currentDate.toISOString().split('T')[0].substring(5));
+					currentDate.setDate(currentDate.getDate() + 1);
+				}
+
+				return dates;
+			},
+			// 时间戳转换为月日,并以-分割,同时确保不足两位的数字补零
+			formatMonthDay(timestamp) {
+				var date = new Date(timestamp * 1000);
+				var month = (date.getMonth() + 1).toString().padStart(2, '0'); // 获取月份并补零
+				var day = date.getDate().toString().padStart(2, '0'); // 获取日期并补零
+
+				return `${month}-${day}`;
+			},
 			setlineoption() {
 				var res = this.reslist
-				var xtitle = []
 				var obj = []
-				if (res.at_ah_info.length != 0) {
-					var aharr = []
-					var atHigharr = [] //高温
-					var atLowarr = [] //低温
-					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())
-						atHigharr.push(res.at_ah_info[i].at == "" ? "0" : res.at_ah_info[i].height)
-						atLowarr.push(res.at_ah_info[i].at == "" ? "0" : res.at_ah_info[i].low)
-						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 atHighobj = {
-						name: '高温',
-						data: atHigharr,
-						color: '#ff0000'
-					}
-					var atlowobj = {
-						name: '低温',
-						data: atLowarr,
-						color: '#00E29D'
-					}
-					var ahobj = {
-						name: '湿度',
-						data: aharr,
-						color: '#6CBBFF'
-					}
-					var pestObj = {
-						name: this.wormvalue,
-						data: pestArr,
-					}
-					obj.push(atHighobj)
-					obj.push(atlowobj)
-					obj.push(ahobj)
-					obj.push(pestObj)
-					console.log(obj)
+				let xtitle = this.getDates(this.oldtime, this.newtime)
+				var aharr = Array(xtitle.length).fill(null)
+				var atHigharr = Array(xtitle.length).fill(null) //高温
+				var atLowarr = Array(xtitle.length).fill(null) //低温
+				var pestArr = Array(xtitle.length).fill(null)
+				let indentText = 0;
+				res.at_ah_info.forEach(item => {
+					let index = xtitle.indexOf(this.formatMonthDay(item.addtime));
+					atHigharr[index] = item.height
+					atLowarr[index] = item.low
+					aharr[index] = item.ah
+				})
+				res.char_data[this.wormvalue] && res.char_data[this.wormvalue].forEach(pest => {
+					let index = xtitle.indexOf(this.formatMonthDay(pest.addtime));
+					pestArr[index] = pest.sum
+				})
+				// 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 atHighobj = {
+					name: '高温',
+					data: atHigharr,
+					color: '#ff0000'
+				}
+				var atlowobj = {
+					name: '低温',
+					data: atLowarr,
+					color: '#00E29D'
+				}
+				var ahobj = {
+					name: '湿度',
+					data: aharr,
+					color: '#6CBBFF'
+				}
+				var pestObj = {
+					name: this.wormvalue,
+					data: pestArr,
 				}
+				obj.push(atHighobj)
+				obj.push(atlowobj)
+				obj.push(ahobj)
+				obj.push(pestObj)
+				console.log(xtitle, 'xtitle')
 				this.showColumn("canvasColumnA", xtitle, obj)
 			},
 			checkObj(obj) {
@@ -773,9 +786,12 @@
 			var date = +new Date()
 			this.oldtime = this.formatTime(date, 'yyyy-MM-dd');
 			this.newtime = this.formatTime(date, 'yyyy-MM-dd');
-			this.sp_hour_st = uni.getStorageSync('sp_hour_st') == '' ?  '00:00' : uni.getStorageSync('sp_hour_st');
-			this.sp_hour_ed = uni.getStorageSync('sp_hour_ed') == '' ?  '00:00' : uni.getStorageSync('sp_hour_ed');
-			this.defaultValue=[this.sp_hour_st.substring(0, 1) == '0' ? this.sp_hour_st.substring(1, 2): this.sp_hour_st.substring(0, 2), this.sp_hour_ed.substring(0, 1) == '0' ? this.sp_hour_ed.substring(1, 2): this.sp_hour_ed.substring(0, 2)]
+			this.sp_hour_st = uni.getStorageSync('sp_hour_st') == '' ? '00:00' : uni.getStorageSync('sp_hour_st');
+			this.sp_hour_ed = uni.getStorageSync('sp_hour_ed') == '' ? '00:00' : uni.getStorageSync('sp_hour_ed');
+			this.defaultValue = [this.sp_hour_st.substring(0, 1) == '0' ? this.sp_hour_st.substring(1, 2) : this.sp_hour_st
+				.substring(0, 2), this.sp_hour_ed.substring(0, 1) == '0' ? this.sp_hour_ed.substring(1, 2) : this
+				.sp_hour_ed.substring(0, 2)
+			]
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
 			this.getyear()

BIN=BIN
unpackage/cache/apk/__UNI__DBA6730_cm.apk


+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://app.liuyingyong.cn/build/download/627e9750-dd13-11ee-be14-8b5b10ad9ea9
+https://app.liuyingyong.cn/build/download/921d7260-ddbf-11ee-b1d4-c5470969b847

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/cache/apk/cmManifestCache.json


BIN=BIN
unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-hdpi.png


BIN=BIN
unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xhdpi.png


BIN=BIN
unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xxhdpi.png


BIN=BIN
unpackage/cache/wgt/__UNI__DBA6730/.manifest/icon-android-xxxhdpi.png


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 4
unpackage/cache/wgt/__UNI__DBA6730/app-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-view.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/manifest.json


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/app-config-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 4
unpackage/dist/build/app-plus/app-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


BIN=BIN
unpackage/res/icons/1024x1024.png


BIN=BIN
unpackage/res/icons/120x120.png


BIN=BIN
unpackage/res/icons/144x144.png


BIN=BIN
unpackage/res/icons/152x152.png


BIN=BIN
unpackage/res/icons/167x167.png


BIN=BIN
unpackage/res/icons/180x180.png


BIN=BIN
unpackage/res/icons/192x192.png


BIN=BIN
unpackage/res/icons/20x20.png


BIN=BIN
unpackage/res/icons/29x29.png


BIN=BIN
unpackage/res/icons/40x40.png


BIN=BIN
unpackage/res/icons/58x58.png


BIN=BIN
unpackage/res/icons/60x60.png


BIN=BIN
unpackage/res/icons/72x72.png


BIN=BIN
unpackage/res/icons/76x76.png


BIN=BIN
unpackage/res/icons/80x80.png


BIN=BIN
unpackage/res/icons/87x87.png


BIN=BIN
unpackage/res/icons/96x96.png


+ 2 - 2
util/neutral.js

@@ -1,4 +1,4 @@
 export default{
-	isneutral:true//云飞智控
-	// isneutral:false//智控
+	// isneutral:true//云飞智控
+	isneutral:false//智控
 }