|
@@ -43,18 +43,17 @@
|
|
|
<p class="realtime_title"><span>实时数据</span></p>
|
|
<p class="realtime_title"><span>实时数据</span></p>
|
|
|
<view class="realtime_text">
|
|
<view class="realtime_text">
|
|
|
<view class="realtime_text_item">
|
|
<view class="realtime_text_item">
|
|
|
- <view class="realtime_text_item_info" v-for="(item,key) in olddata" :key="key"
|
|
|
|
|
- @click="oneday(key)">
|
|
|
|
|
- <view class="item_info_img"
|
|
|
|
|
- :style="{'background-color':olddatas[1]}">
|
|
|
|
|
|
|
+ <view class="realtime_text_item_info" v-for="(item,index) in olddata" :key="index"
|
|
|
|
|
+ @click="oneday(index,item)">
|
|
|
|
|
+ <view class="item_info_img" :style="{'background-color':olddatas[1]}">
|
|
|
<image
|
|
<image
|
|
|
- :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/icon_'+item[1]+'.png'"
|
|
|
|
|
|
|
+ :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/icon_'+item.value[1]+'.png'"
|
|
|
mode=""></image>
|
|
mode=""></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item_info_text">
|
|
<view class="item_info_text">
|
|
|
- <p>{{key}}</p>
|
|
|
|
|
|
|
+ <p>{{item.lable}}</p>
|
|
|
<p style="margin-top: 20rpx;">
|
|
<p style="margin-top: 20rpx;">
|
|
|
- {{parseFloat(olddata[key][0]) == -99.99 ?'N/A':parseFloat(item[0])}}
|
|
|
|
|
|
|
+ {{parseFloat(item.value[0]) == -99.99 ?'N/A':parseFloat(item.value[0])}}
|
|
|
</p>
|
|
</p>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -97,7 +96,7 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
eqinfo: {},
|
|
eqinfo: {},
|
|
|
- olddata: {},
|
|
|
|
|
|
|
+ olddata: [],
|
|
|
olddatas: ["#fba825", "#53d67c", "#008cf2", "#fb504d", "#d87ffc", "#4ec5f0"],
|
|
olddatas: ["#fba825", "#53d67c", "#008cf2", "#fb504d", "#d87ffc", "#4ec5f0"],
|
|
|
city: "",
|
|
city: "",
|
|
|
kongtf: false,
|
|
kongtf: false,
|
|
@@ -133,27 +132,33 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
this.dataloadingtf = false
|
|
this.dataloadingtf = false
|
|
|
- // this.olddata = res
|
|
|
|
|
- // console.log(res)olddata
|
|
|
|
|
- this.olddata = {}
|
|
|
|
|
|
|
+ this.olddata = []
|
|
|
for (var key in res.conf) {
|
|
for (var key in res.conf) {
|
|
|
if (res.conf[key]) {
|
|
if (res.conf[key]) {
|
|
|
if (res.conf[key].indexOf("#") != -1) {
|
|
if (res.conf[key].indexOf("#") != -1) {
|
|
|
- this.olddata[res.conf[key].replace("#", "(") + ")"] = res.dat[key].split("#")
|
|
|
|
|
|
|
+ // let lable = res.conf[key].replace("#", "(") + ")"
|
|
|
|
|
+ console.log(res.conf[key])
|
|
|
|
|
+ this.olddata.push({
|
|
|
|
|
+ lable:res.conf[key].replace("#", "(") + ")",
|
|
|
|
|
+ value:res.dat[key].split('#')
|
|
|
|
|
+ })
|
|
|
|
|
+ // this.olddata[res.conf[key].replace("#", "(") + ")"] = res.dat[key].split("#")
|
|
|
} else {
|
|
} else {
|
|
|
- this.olddata[res.conf[key]] = res.dat[key].split("#")
|
|
|
|
|
|
|
+ // this.olddata[res.conf[key]] = res.dat[key].split("#")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.clear()
|
|
|
console.log(this.olddata)
|
|
console.log(this.olddata)
|
|
|
- this.realtimeTF = true
|
|
|
|
|
- for (var key in this.olddata) {
|
|
|
|
|
- this.realtimeTF = false
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // this.realtimeTF = true
|
|
|
|
|
+ // for (var key in this.olddata) {
|
|
|
|
|
+ // this.realtimeTF = false
|
|
|
|
|
+ // }
|
|
|
|
|
+ this.realtimeTF = false
|
|
|
// this.realtimeTF = arr.some(function(item){
|
|
// this.realtimeTF = arr.some(function(item){
|
|
|
// return item!=""
|
|
// return item!=""
|
|
|
// })
|
|
// })
|
|
|
- console.log(this.realtimeTF)
|
|
|
|
|
|
|
+ // console.log(this.realtimeTF)
|
|
|
},
|
|
},
|
|
|
// weather.weather.qxz_data_chart 一天的数据
|
|
// weather.weather.qxz_data_chart 一天的数据
|
|
|
async onehistory() { //设备列表
|
|
async onehistory() { //设备列表
|
|
@@ -214,27 +219,33 @@
|
|
|
url: "../afterSale/addafter?device_id=" + device_id + "&device_type=" + 5
|
|
url: "../afterSale/addafter?device_id=" + device_id + "&device_type=" + 5
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- oneday(key) {
|
|
|
|
|
|
|
+ oneday(key,item) {
|
|
|
// console.log(key)
|
|
// console.log(key)
|
|
|
var obj = {
|
|
var obj = {
|
|
|
- name: key,
|
|
|
|
|
|
|
+ name: item.lable,
|
|
|
data: [],
|
|
data: [],
|
|
|
}
|
|
}
|
|
|
var xtitle = []
|
|
var xtitle = []
|
|
|
var linearr = []
|
|
var linearr = []
|
|
|
var arr = []
|
|
var arr = []
|
|
|
var timearr = []
|
|
var timearr = []
|
|
|
|
|
+ // console.log(key)
|
|
|
|
|
+ // console.log(this.olddata)
|
|
|
|
|
+ // console.log(this.onedatas)
|
|
|
|
|
+ // return
|
|
|
for (var i = 0; i < this.onedatas.length; i++) {
|
|
for (var i = 0; i < this.onedatas.length; i++) {
|
|
|
var times = new Date(this.onedatas[i].time * 1000)
|
|
var times = new Date(this.onedatas[i].time * 1000)
|
|
|
- arr.unshift(Number(this.onedatas[i].dat[this.olddata[key][2]].split("#")[0]))
|
|
|
|
|
|
|
+ // console.log(this.onedatas[i].dat[this.olddata[key].value[2]].split("#")[0])
|
|
|
|
|
+ arr.unshift(Number(this.onedatas[i].dat[this.olddata[key].value[2]].split("#")[0]))
|
|
|
xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times
|
|
xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times
|
|
|
.getMinutes())
|
|
.getMinutes())
|
|
|
timearr.unshift(+new Date(times) / 1000)
|
|
timearr.unshift(+new Date(times) / 1000)
|
|
|
- obj.data.unshift(Number(this.onedatas[i].dat[this.olddata[key][2]].split("#")[0]))
|
|
|
|
|
|
|
+ obj.data.unshift(Number(this.onedatas[i].dat[this.olddata[key].value[2]].split("#")[0]))
|
|
|
}
|
|
}
|
|
|
arr.sort(function(a, b) {
|
|
arr.sort(function(a, b) {
|
|
|
return a - b
|
|
return a - b
|
|
|
})
|
|
})
|
|
|
|
|
+ // console.log(arr)
|
|
|
this.onedatasMin = arr[0]
|
|
this.onedatasMin = arr[0]
|
|
|
this.onedatasMax = arr[arr.length - 1]
|
|
this.onedatasMax = arr[arr.length - 1]
|
|
|
for (var i = 0; i < obj.data.length; i++) {
|
|
for (var i = 0; i < obj.data.length; i++) {
|
|
@@ -245,12 +256,16 @@
|
|
|
this.onedatasMintime = timearr[i]
|
|
this.onedatasMintime = timearr[i]
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(obj)
|
|
|
linearr.push(obj)
|
|
linearr.push(obj)
|
|
|
if (obj.data.length == 0) {
|
|
if (obj.data.length == 0) {
|
|
|
this.tishiTF = true
|
|
this.tishiTF = true
|
|
|
} else {
|
|
} else {
|
|
|
this.tishiTF = false
|
|
this.tishiTF = false
|
|
|
}
|
|
}
|
|
|
|
|
+ // console.log(xtitle)
|
|
|
|
|
+ // console.log(linearr)
|
|
|
|
|
+ // return
|
|
|
this.showColumn("canvasColumnA", xtitle, linearr)
|
|
this.showColumn("canvasColumnA", xtitle, linearr)
|
|
|
this.show = true
|
|
this.show = true
|
|
|
},
|
|
},
|