CN-65 perf: 数据的单位的展示逻辑完善

This commit is contained in:
chenjinsong
2021-07-21 22:46:08 +08:00
parent 1f28cb7148
commit 3ae20a4a85
11 changed files with 275 additions and 197 deletions

View File

@@ -8,8 +8,8 @@
<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-title" :title="item.legend">{{item.legend}}</div>
<div class="table__below-statistics" :title="item.aggregation.max">{{shortFormatter(item.aggregation.max)}}</div>
<div class="table__below-statistics" :title="item.aggregation.avg">{{shortFormatter(item.aggregation.avg)}}</div>
<div class="table__below-statistics" :title="item.aggregation.avg">{{unitConvert(item.aggregation.avg)}}</div>
<div class="table__below-statistics" :title="item.aggregation.max">{{unitConvert(item.aggregation.max)}}</div>
</div>
</div>
</div>
@@ -18,24 +18,16 @@
<script>
import { getChartColor } from '@/components/charts/chart-options'
import { shortFormatter } from '@/components/charts/chart-formatter'
import unitConvert from '@/utils/unit-convert'
export default {
name: 'StatisticsLegend',
props: {
data: Array
},
watch: {
data: {
immediate: true,
deep: true,
handler (n) {
}
}
},
setup () {
return {
getChartColor,
shortFormatter
unitConvert
}
}
}