|
|
@@ -1,7 +1,7 @@ |
|
|
|
<!-- |
|
|
|
* @Date: 2023-10-10 15:29:50 |
|
|
|
* @LastEditors: JinxChen |
|
|
|
* @LastEditTime: 2023-10-16 10:47:19 |
|
|
|
* @LastEditTime: 2023-10-19 14:21:55 |
|
|
|
* @FilePath: \TelpoH5FrontendWeb\src\views\gps-card-frontend\device-power\index.vue |
|
|
|
* @description: |
|
|
|
--> |
|
|
@@ -109,9 +109,7 @@ export default { |
|
|
|
let data = res.data; |
|
|
|
if(data.code === 200) { |
|
|
|
if(this.echarts.type === 'BatteryLevel' || this.echarts.type === 'status') { |
|
|
|
this.filterData = data[this.echarts.type].data.list.propertyInfo; |
|
|
|
} else if(this.echarts.type === 'status') { |
|
|
|
this.filterData = data[this.echarts.type].data.list.propertyInfo; |
|
|
|
this.filterData = data[this.echarts.type].data/* .list.propertyInfo */; |
|
|
|
} else if(this.echarts.type === 'offline') { |
|
|
|
this.filterData = data.Offline.data; |
|
|
|
} |
|
|
@@ -128,17 +126,24 @@ export default { |
|
|
|
this.titleList = [ |
|
|
|
{ title: '时间', width: '40%', key: 'time'}, |
|
|
|
{ title: '原始值', width: '60%', key: 'value' }, |
|
|
|
], |
|
|
|
]; |
|
|
|
let propertyInfo = this.filterData.map(item => { |
|
|
|
return item.list.propertyInfo; |
|
|
|
}); |
|
|
|
let result = []; |
|
|
|
for (let i = 0; i < propertyInfo.length; i++) { |
|
|
|
// 循环对象中的数组 |
|
|
|
result = [].concat(...propertyInfo) |
|
|
|
} |
|
|
|
// 表格则要显示全部数据 |
|
|
|
this.tableData = this.filterData.map(item => { |
|
|
|
this.tableData = result.map(item => { |
|
|
|
return { |
|
|
|
value: item.value, |
|
|
|
time: this.$dayjs(this.$dayjs(Number(item.time))).format("YYYY/MM/DD hh:mm") |
|
|
|
} |
|
|
|
}).reverse(); |
|
|
|
console.log("this.filterData", this.filterData, this.tableData); |
|
|
|
// 图表筛选过滤只显示 rssi <= 2的数据 |
|
|
|
this.data = this.filterData.map(item => { |
|
|
|
this.data = result.map(item => { |
|
|
|
// 序列化json |
|
|
|
let json = JSON.parse(item.value); |
|
|
|
return { |
|
|
@@ -149,7 +154,6 @@ export default { |
|
|
|
}).filter(f => { |
|
|
|
return f.value <=2; |
|
|
|
}) |
|
|
|
console.log(this.data); |
|
|
|
} else if (this.echarts.type === 'offline') { |
|
|
|
// 设备离线次数 |
|
|
|
this.titleList = [ |
|
|
@@ -213,13 +217,21 @@ export default { |
|
|
|
splitNumber : 1, |
|
|
|
boundaryGap : [ '5%', '5%' ], |
|
|
|
} |
|
|
|
this.data = this.filterData.map(item => { |
|
|
|
let propertyInfo = this.filterData.map(item => { |
|
|
|
return item.list.propertyInfo; |
|
|
|
}); |
|
|
|
let result = []; |
|
|
|
for (let i = 0; i < propertyInfo.length; i++) { |
|
|
|
// 循环对象中的数组 |
|
|
|
result = [].concat(...propertyInfo) |
|
|
|
} |
|
|
|
this.data = result.map(item => { |
|
|
|
return { |
|
|
|
value: item.value, |
|
|
|
time: this.$dayjs(this.$dayjs(Number(item.time))).format("YYYY/MM/DD hh:mm"), |
|
|
|
} |
|
|
|
}); |
|
|
|
this.tableData = this.filterData.map(item => { |
|
|
|
this.tableData = result.map(item => { |
|
|
|
return { |
|
|
|
value: item.value, |
|
|
|
time: this.$dayjs(this.$dayjs(Number(item.time))).format("YYYY/MM/DD hh:mm") |
|
|
@@ -292,7 +304,6 @@ export default { |
|
|
|
align: "center" |
|
|
|
}, |
|
|
|
formatter: function(params) { |
|
|
|
console.log(params); |
|
|
|
return `${params[0].marker}${params[0].data.time}</br> |
|
|
|
${ params[0].data.type === 'offline' ? '离线次数:' + params[0].data.value + '次' : |
|
|
|
params[0].data.type === 'status' ? 'rssi值:' + params[0].data.value : |
|
|
|