CN-197 perf: 调整地图的tooltip

This commit is contained in:
chenjinsong
2021-10-11 19:12:52 +08:00
parent 747a7ecd7c
commit 14a8365e20
6 changed files with 87 additions and 80 deletions

View File

@@ -10,8 +10,8 @@
<div v-for="(item, index) in data" :key="index" class="table-below-box" :class="{'table-below-box--inactivated': !item.active}" @click="toggleLegend(index)">
<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.avg">{{unitConvert(item.aggregation.avg, chartInfo.params.unitType).join(' ')}}</div>
<div class="table__below-statistics" :title="item.aggregation.max">{{unitConvert(item.aggregation.max, chartInfo.params.unitType).join(' ')}}</div>
<div class="table__below-statistics" :title="item.aggregation.avg">{{valueToRangeValue(item.aggregation.avg, chartInfo.params.unitType).join(' ')}}</div>
<div class="table__below-statistics" :title="item.aggregation.max">{{valueToRangeValue(item.aggregation.max, chartInfo.params.unitType).join(' ')}}</div>
</div>
</div>
</div>
@@ -20,7 +20,7 @@
<script>
import { getChartColor } from '@/components/charts/chart-options'
import unitConvert from '@/utils/unit-convert'
import unitConvert, { valueToRangeValue } from '@/utils/unit-convert'
export default {
name: 'StatisticsLegend',
props: {
@@ -35,7 +35,8 @@ export default {
setup () {
return {
getChartColor,
unitConvert
unitConvert,
valueToRangeValue
}
}
}

View File

@@ -138,9 +138,6 @@ export default {
from: String,
pageObj: Object,
loading: Boolean
},
components: {
},
data () {
return {

View File

@@ -117,6 +117,9 @@
position: absolute;
top: 21px;
left: 82px;
overflow: hidden;
max-width: 200px;
text-overflow: ellipsis;
}
}
}