CN-65 fix: statistics-legend单位显示

This commit is contained in:
chenjinsong
2021-07-22 18:35:15 +08:00
parent 55c14eca8c
commit 16ae86101e
2 changed files with 5 additions and 4 deletions

View File

@@ -8,8 +8,8 @@
<div v-for="(item,index) in data" :key="index" class="table-below-box"> <div v-for="(item,index) in data" :key="index" class="table-below-box">
<div class="table__below-color"><div :style="{backgroundColor: getChartColor(index)}"></div></div> <div class="table__below-color"><div :style="{backgroundColor: getChartColor(index)}"></div></div>
<div class="table__below-title" :title="item.legend">{{item.legend}}</div> <div class="table__below-title" :title="item.legend">{{item.legend}}</div>
<div class="table__below-statistics" :title="item.aggregation.avg">{{unitConvert(item.aggregation.avg)}}</div> <div class="table__below-statistics" :title="item.aggregation.avg">{{unitConvert(item.aggregation.avg, chartInfo.params.unitType).join(' ')}}</div>
<div class="table__below-statistics" :title="item.aggregation.max">{{unitConvert(item.aggregation.max)}}</div> <div class="table__below-statistics" :title="item.aggregation.max">{{unitConvert(item.aggregation.max, chartInfo.params.unitType).join(' ')}}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -22,7 +22,8 @@ import unitConvert from '@/utils/unit-convert'
export default { export default {
name: 'StatisticsLegend', name: 'StatisticsLegend',
props: { props: {
data: Array data: Array,
chartInfo: Object
}, },
setup () { setup () {
return { return {

View File

@@ -72,7 +72,7 @@
<pie-table :tableData="pieTableData" ref="pieTable" :chartInfo="chartInfo" :time-filter="timeFilter" :order="orderPieTable"/> <pie-table :tableData="pieTableData" ref="pieTable" :chartInfo="chartInfo" :time-filter="timeFilter" :order="orderPieTable"/>
</template> </template>
<template v-else-if="isEchartsWithStatistics"> <template v-else-if="isEchartsWithStatistics">
<statistics-legend :data="statisticsData"></statistics-legend> <statistics-legend :data="statisticsData" :chart-info="chartInfo"></statistics-legend>
</template> </template>
</template> </template>
</echarts-frame> </echarts-frame>