统计分析接口联调

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

@@ -5,6 +5,8 @@
</template>
<script>
import {processData} from '@/utils/dealWithData'
export default {
name: '',
props: {
@@ -18,14 +20,14 @@ export default {
curList: [
{
name: '日充电电量',
key: 'key1',
key: 'storage_elect_in',
lineColor: '#9BD801',
value: 0,
d: 'kW·h'
},
{
name: '日放电电量',
key: 'key2',
key: 'storage_elect_out',
lineColor: '#3DFEFA',
value: 0,
d: 'kW·h'
@@ -66,25 +68,11 @@ export default {
this.disChargeChart.resize()
}
},
processData(data, keys) {
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.dt)
const values = []
keys.forEach((item, index) => {
values[index] = data.map((dataValue) => dataValue[keys[index]])
})
return {
dates,
values
}
},
getDisChargeData() {
const arr = this.curList
const keyList = this.curList.map((item) => item.key)
const result = this.processData(this.propsInfo, keyList)
const result = processData(this.propsInfo, keyList)
this.disChargeChartData.xdata = result.dates
arr.forEach((item, index) => {