Parcourir la source

update

- c1后台设备功耗查看页面
    - 修改 数据解析方法
test
JinxChen il y a 1 an
Parent
révision
242954622a
3 fichiers modifiés avec 34 ajouts et 15 suppressions
  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 Voir le fichier

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



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

+ 1
- 1
src/config/models.js Voir le fichier

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


+ 23
- 12
src/views/gps-card-frontend/device-power/index.vue Voir le fichier

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


Chargement…
Annuler
Enregistrer