Browse Source

修改时间显示bug

空白格 2 years ago
parent
commit
e57d5fbe4d

+ 0 - 19
App.vue

@@ -29,25 +29,6 @@ export default {
 						this.version = res.msg
 						if (res.msg !== config.version) {
 							_this.downloadAppFileByBackstage()
-							// uni.getNetworkType({
-							// 	success: function(res) {
-							// 		if (res.networkType === 'wifi') {
-							// 			_this.downloadAppFileByBackstage()
-							// 		} else {
-							// 			uni.showModal({
-							// 				title: '提示',
-							// 				content: '当前网络非WIFI,继续更新可能会产生流量,确认要更新吗?',
-							// 				confirmText: '更新',
-							// 				confirmColor: '#EE8F57',
-							// 				success: res => {
-							// 					if (res.confirm) {
-							// 						_this.downloadAppFileByBackstage()
-							// 					}
-							// 				}
-							// 			});
-							// 		}
-							// 	}
-							// });
 						}
 					}
 				});

+ 1 - 1
common/config.js

@@ -2,5 +2,5 @@ let baseUrl = 'https://wx.hw.hongweisoft.com/parking/' // 测试环境
 // let baseUrl = 'https://parking.pdzhtc.com/' // 正式环境
 export const config = {
 	baseUrl,
-	version: '0.2.0'
+	version: '0.2.1'
 }

+ 25 - 4
pages/collectorManagement/performanceAnalysis/performanceAnalysis.vue

@@ -259,16 +259,18 @@ export default {
       this.defaultYear = [e.indexs[0]];
       this.currentYear = e.value[0].value;
       this.yearObj = e.value[0];
-      this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+      this.params.queryDate = `${this.currentYear || 1}-${this.currentMonth || 1}-${this.currentDay || 1}`;
       this.yearPicker = false;
+			this.formatDateStr(this.params.queryDate);
       this.getData();
     },
     monthConfirm(e) {
       this.defaultMonth = [e.indexs[0]];
       this.currentMonth = e.value[0].value;
       this.monthObj = e.value[0];
-      this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+      this.params.queryDate = `${this.currentYear}-${this.currentMonth || '01'}-${this.currentDay || '01'}`;
       this.monthPicker = false;
+			this.formatDateStr(this.params.queryDate);
       this.dayList = this.getDayList();
       this.getData();
     },
@@ -276,7 +278,8 @@ export default {
       this.defaultDay = [e.indexs[0]];
       this.currentDay = e.value[0].value;
       this.dayObj = e.value[0];
-      this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+      this.params.queryDate = `${this.currentYear}-${this.currentMonth || '01'}-${this.currentDay || '01'}`;
+			this.formatDateStr(this.params.queryDate);
       this.dayPicker = false;
       this.getData();
     },
@@ -298,7 +301,25 @@ export default {
             }
           }
         });
-    }
+    },
+		/**
+		 * 初始化时间格式
+		 * @param {Object} val
+		 */
+		formatDateStr(val) {
+			let timestamp = new Date(val).valueOf();
+			switch (this.params.reportType) {
+			  case 0:
+			    this.currentDate = uni.$u.timeFormat(timestamp, 'yyyy年mm月dd日');
+			    break;
+			  case 1:
+			    this.currentDate = uni.$u.timeFormat(timestamp, 'yyyy年mm月');
+			    break;
+			  case 2:
+			    this.currentDate = uni.$u.timeFormat(timestamp, 'yyyy年');
+			    break;
+			}
+		}
   }
 };
 </script>

+ 1 - 1
pages/operationalAnalysis/parkModel/index.vue

@@ -274,7 +274,7 @@ export default {
       this.title = e.value[0].text;
       this.currentDay = e.value[0].value;
       this.dayObj = e.value[0];
-      this.title = `${this.yearObj.text}-${this.monthObj.text}-${this.dayObj.text}`;
+      this.title = `${this.yearObj.text}-${this.monthObj.text || 1}-${this.dayObj.text || 1}`;
       this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
       this.$nextTick(() => {
         this.$refs[this.templateKey].getData(this.params);

+ 1 - 1
pages/operationalAnalysis/roadModel/index.vue

@@ -278,7 +278,7 @@ export default {
       this.title = e.value[0].text;
       this.currentDay = e.value[0].value;
       this.dayObj = e.value[0];
-      this.title = `${this.yearObj.text}-${this.monthObj.text}-${this.dayObj.text}`;
+      this.title = `${this.yearObj.text}-${this.monthObj.text || 1}-${this.dayObj.text || 1}`;
       this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
       this.$nextTick(() => {
         this.$refs[this.templateKey].getData(this.params);

+ 5 - 0
pages/statisticalReport/styles/report.scss

@@ -10,6 +10,11 @@
     align-items: center;
     margin-bottom: 10px;
     font-size: 15px;
+		&-left, &-right {
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			overflow: hidden;		
+		}
     .tab {
       display: flex;
       border: solid 1px #1767f2;