Browse Source

update

- c1后台设备功耗查看页面
    - 修改 数据解析方法
test
JinxChen 1 year ago
parent
commit
242954622a
3 changed files with 34 additions and 15 deletions
  1. +10
    -2
      README.md
  2. +1
    -1
      src/config/models.js
  3. +23
    -12
      src/views/gps-card-frontend/device-power/index.vue

+ 10
- 2
README.md View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-08-17 16:19:13
* @LastEditors: JinxChen
* @LastEditTime: 2023-10-13 14:50:29
* @LastEditTime: 2023-10-19 11:38:09
* @FilePath: \TelpoH5FrontendWeb\README.md
* @description: 项目说明
-->
@@ -726,4 +726,12 @@ update
`2023.10.13`
feature
- 增加 c1后台设备功耗查看页面
- 增加 cell,echarts和table组件
- 增加 cell,echarts和table组件



## v1.0.91
`2023.10.19`
update
- c1后台设备功耗查看页面
- 修改 数据解析方法

+ 1
- 1
src/config/models.js View File

@@ -5,7 +5,7 @@
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description:
*/
export const VERSION_MODEL = '1.0.90F'; //版本号
export const VERSION_MODEL = '1.0.91F'; //版本号
export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/',


+ 23
- 12
src/views/gps-card-frontend/device-power/index.vue View File

@@ -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 :


Loading…
Cancel
Save