From 057a7f66b69da9d8571dd7a5bcc758c9fff0617b Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Thu, 19 Sep 2024 14:30:55 +0800 Subject: [PATCH] =?UTF-8?q?CN-1705=20fix:=20=E4=BF=AE=E5=A4=8D=E8=89=B2?= =?UTF-8?q?=E5=9D=97=E6=95=B0=E5=80=BC=E8=B6=85=E9=99=90=E5=90=8E=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/location/Index.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/views/location/Index.vue b/src/views/location/Index.vue index 9da876f8..1dee5a0e 100644 --- a/src/views/location/Index.vue +++ b/src/views/location/Index.vue @@ -56,7 +56,7 @@
-
{{legend.start}}~{{legend.end}}
+
{{legend.name}}
{{legend.count}}
@@ -546,7 +546,6 @@ export default { option.color = this.pieColorRamp.map(c => `rgb(${c},.7)`) option.series[0].name = this.$t('location.populationDensity') option.series[0].data = this.pieValueRamp.map((r, i) => ({ - name: `${r.start}~${r.end}`, value: r.count })) this.pieOption = option @@ -912,6 +911,11 @@ export default { color: this.pieColorRamp[i - 1] } item.count = data.filter(d => d.number >= item.start && d.number <= item.end).length + if (i === this.pieColorRamp.length) { + item.name = `>${item.start - 1}` + } else { + item.name = `${item.start}~${item.end}` + } result.push(item) } } @@ -968,7 +972,13 @@ export default { return featureCollection }, getHexagonFillColor (number) { - const ramp = this.pieValueRamp.filter(r => Number(number) >= r.start && Number(number) <= r.end) + const ramp = this.pieValueRamp.filter((r, i) => { + if (i < this.pieValueRamp.length - 1) { + return Number(number) >= r.start && Number(number) <= r.end + } else { + return Number(number) >= r.start + } + }) if (ramp.length > 0) { return ramp[0].color.split(',').map(n => Number(n)) } @@ -1686,6 +1696,7 @@ export default { } }, async timeFilter (n) { + this.boundaryBoxExtreme = {} if (this.activeTab === 'locationMap') { this.unbindHexagonEvents() this.mapChart.getLayer('hexagon') && this.mapChart.removeLayer('hexagon')