|
@@ -145,14 +145,16 @@
|
|
|
},
|
|
|
//确认按钮查询
|
|
|
handelQuery() {
|
|
|
+ // 临时当前时间,需要改成选择时间----开始
|
|
|
var date = new Date()
|
|
|
var timestr = date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours()
|
|
|
timestr += ':'
|
|
|
timestr += date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes()
|
|
|
timestr += ':'
|
|
|
timestr += date.getSeconds() < 10 ? ('0' + date.getSeconds()) : date.getSeconds()
|
|
|
- this.queryParams.startTime = this.range[0] + ' ' + timestr
|
|
|
- this.queryParams.endTime = this.range[1] + ' ' + timestr
|
|
|
+ // 临时当前时间,需要改成选择时间----结束
|
|
|
+ this.queryParams.startTime = this.resolvingDate2(this.range[0]) + ' ' + timestr
|
|
|
+ this.queryParams.endTime = this.resolvingDate2(this.range[1]) + ' ' + timestr
|
|
|
uni.$http.get('/itemGroup/itemDataQuery', this.queryParams).then(res => {
|
|
|
const data = res.data
|
|
|
if (data.code === 200) {
|
|
@@ -161,7 +163,7 @@
|
|
|
valueTimeList
|
|
|
} = data.data
|
|
|
const service = [{
|
|
|
- name: "TOYOTA",
|
|
|
+ name: "数据项列表",
|
|
|
data: valueList
|
|
|
}]
|
|
|
this.service = service
|
|
@@ -175,6 +177,23 @@
|
|
|
this.queryParams.startTime = this.resolvingDate(date[0])
|
|
|
this.queryParams.endTime = this.resolvingDate(date[1])
|
|
|
},
|
|
|
+ resolvingDate2(date) {
|
|
|
+ if (!date) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //date是传入的时间
|
|
|
+ let d = new Date(date);
|
|
|
+
|
|
|
+ let month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1);
|
|
|
+ let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();
|
|
|
+ let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours();
|
|
|
+ let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();
|
|
|
+ let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds();
|
|
|
+
|
|
|
+ let times;
|
|
|
+ times = d.getFullYear() + '-' + month + '-' + day;
|
|
|
+ return times
|
|
|
+ },
|
|
|
resolvingDate(date) {
|
|
|
if (!date) {
|
|
|
return;
|