统计分析接口联调

This commit is contained in:
ym1026
2025-09-04 16:04:37 +08:00
parent 61ed4f355f
commit 1cc916c53c
18 changed files with 517 additions and 959 deletions

View File

@@ -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) => {