mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
统计分析接口联调
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {processData} from '@/utils/dealWithData'
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
props: {
|
||||
@@ -110,25 +112,11 @@ export default {
|
||||
this.chargeChart.resize()
|
||||
}
|
||||
},
|
||||
processData(data, keys) {
|
||||
data.sort((a, b) => {
|
||||
return new Date(a.dt) - new Date(b.dt)
|
||||
})
|
||||
const dates = data.map((item) => item.dt)
|
||||
const values = []
|
||||
keys.forEach((item, index) => {
|
||||
values[index] = data.map((dataValue) => dataValue[keys[index]])
|
||||
})
|
||||
|
||||
return {
|
||||
dates,
|
||||
values
|
||||
}
|
||||
},
|
||||
|
||||
getChargeData() {
|
||||
const arr = this.curListEcharts
|
||||
const keyList = this.curListEcharts.map((item) => item.key)
|
||||
const result = this.processData(this.deviceInfo, keyList)
|
||||
const result = processData(this.deviceInfo, keyList)
|
||||
|
||||
this.chargeChartData.xdata = result.dates
|
||||
arr.forEach((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user