From 242954622a3f1af239cc763eb1f1a97538d069a5 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Thu, 19 Oct 2023 14:24:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20c1=E5=90=8E=E5=8F=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8A=9F=E8=80=97=E6=9F=A5=E7=9C=8B=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=20=20=20=20-=20=E4=BF=AE=E6=94=B9=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +++++-- src/config/models.js | 2 +- .../gps-card-frontend/device-power/index.vue | 35 ++++++++++++------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index afde91f..6130013 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -726,4 +726,12 @@ update `2023.10.13` feature - 增加 c1后台设备功耗查看页面 -- 增加 cell,echarts和table组件 \ No newline at end of file +- 增加 cell,echarts和table组件 + + + +## v1.0.91 +`2023.10.19` +update +- c1后台设备功耗查看页面 + - 修改 数据解析方法 \ No newline at end of file diff --git a/src/config/models.js b/src/config/models.js index 4a6428c..175a4ca 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -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/', diff --git a/src/views/gps-card-frontend/device-power/index.vue b/src/views/gps-card-frontend/device-power/index.vue index 3984aff..f7fd221 100644 --- a/src/views/gps-card-frontend/device-power/index.vue +++ b/src/views/gps-card-frontend/device-power/index.vue @@ -1,7 +1,7 @@ @@ -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}
${ params[0].data.type === 'offline' ? '离线次数:' + params[0].data.value + '次' : params[0].data.type === 'status' ? 'rssi值:' + params[0].data.value :