Browse Source

【进度】用水异常部署到服务器时,时间框出现换行问题修复。
【修复】其它发现的部分问题优化修复。

程志平 4 years atrás
parent
commit
9209d11d01

+ 1 - 5
src/components/index/Index.css

@@ -8,7 +8,6 @@
 	width: 340px;
 	height: 100%;
 	background: #1D3251;
-	overflow: hidden;
 }
 
 .logo-col,
@@ -121,14 +120,11 @@
 }
 
 .diwen {
-	position: fixed;
-	left: 76px;
-	bottom: 62px;
+	margin: 30px 0 0 76px;
 	width: 176px;
 	height: 145px;
 	background: url(../../../static/images/diwen.png) no-repeat;
 	background-size: 176px 145px;
-	/* z-index: 9999; */
 }
 
 /* menu */

+ 11 - 9
src/components/yongshuiyichang/yongshuiyichang.css

@@ -57,15 +57,6 @@
 	font-size: 20px;
 }
 
-.shijian {
-	width: 365px;
-}
-
-.shijian_plus {
-	width: 260px;
-	border: 1px solid #4D4D4D;
-}
-
 .rijunxiaofei_input {
 	width: 180px;
 	border: 1px solid #4D4D4D;
@@ -333,4 +324,15 @@
 	display: flex;
 	justify-content: center;
 }
+
+.shijian {
+	white-space: nowrap;
+	width: 365px;
+}
+
+.shijian_plus {
+	width: 260px;
+	border: 1px solid #4D4D4D;
+}
+
 /* yongshuiyichang */

+ 38 - 10
src/components/yongshuiyichang/yongshuiyichang.vue

@@ -18,8 +18,9 @@
 					</el-form-item>
 					<el-form-item label="起止时间:" class="shijian">
 						<el-date-picker v-model="select_datetime" type="daterange" align="center" unlink-panels
-							range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="dateChange"
-							value-format="yyyy-MM-dd" :picker-options="pickerOptions" class="shijian_plus">
+							range-separator="至" :start-placeholder="startTime" :end-placeholder="endTime"
+							@change="dateChange" value-format="yyyy-MM-dd" :picker-options="pickerOptions"
+							class="shijian_plus">
 						</el-date-picker>
 					</el-form-item>
 					<el-form-item label="日均消费低于:">
@@ -107,17 +108,44 @@
 		created() {
 			// 填充楼栋号
 			this.getBuildsFillSelect()
-
-			// 分页参数
-			let params = {
-				page: this.currentPage,
-				rows: this.pageRows
-			}
-			// 用水异常列表
-			this.get_use_water_exception_list(params)
+			// 初始化日期为昨天 至 今天
+			this.initDate()
 		},
 		methods: {
 			/**
+			 * 初始化日期时间
+			 */
+			initDate() {
+				//当前设定的日期时间
+				let d = new Date;
+				var year1 = d.getFullYear(); // 获取当前年份
+				var mon1 = d.getMonth() + 1; // 获取当前月份
+				var day1 = d.getDate(); // 获取当前日
+
+				//前一天设定的日期时间
+				d.setTime(d.getTime() - 24 * 60 * 60 * 1000);
+				var year2 = d.getFullYear(); // 获取当前年份
+				var mon2 = d.getMonth() + 1; // 获取当前月份
+				var day2 = d.getDate(); // 获取当前日
+
+				this.startTime = this.getDate(year2, mon2, day2)
+				this.endTime = this.getDate(year1, mon1, day1)
+				
+				this.handleCurrentChange(1)
+			},
+			/**
+			 * 获取指定格式 年、月、日
+			 * @param {Object} y
+			 * @param {Object} m
+			 * @param {Object} d
+			 */
+			getDate(y, m, d) {
+				m = m > 9 ? m : '0' + m;
+				d = d > 9 ? d : '0' + d;
+				
+				return y + "-" + m + "-" + d;
+			},
+			/**
 			 * 选择起止日期
 			 * @param {Object} val
 			 */