fix: 修复npm地图下钻后分数计算不对的问题

This commit is contained in:
chenjinsong
2023-08-04 17:12:01 +08:00
parent 680d94d929
commit 0cab5d42b1
2 changed files with 3 additions and 4 deletions

View File

@@ -118,7 +118,7 @@ export default {
res2.forEach((r, i) => { res2.forEach((r, i) => {
if (r.code === 200) { if (r.code === 200) {
mapData.forEach(t => { mapData.forEach(t => {
t[keyPre[i] + 'Score'] = r.data.result.find(d => d.country === t.country) t[keyPre[i] + 'Score'] = r.data.result.find(d => d.country === t.country && d.province === t.province)
}) })
} else { } else {
this.showError = true this.showError = true

View File

@@ -50,7 +50,7 @@ import { shallowRef } from 'vue'
import * as am4Core from '@amcharts/amcharts4/core' import * as am4Core from '@amcharts/amcharts4/core'
import * as am4Maps from '@amcharts/amcharts4/maps' import * as am4Maps from '@amcharts/amcharts4/maps'
import { computeScore, getGeoData } from '@/utils/tools' import { computeScore, getGeoData } from '@/utils/tools'
import { storageKey, unitTypes, countryNameIdMapping } from '@/utils/constants' import { storageKey, unitTypes } from '@/utils/constants'
import locationOptions from '@/views/charts2/charts/locationOptions' import locationOptions from '@/views/charts2/charts/locationOptions'
import { valueToRangeValue } from '@/utils/unit-convert' import { valueToRangeValue } from '@/utils/unit-convert'
import { getSecond } from '@/utils/date-util' import { getSecond } from '@/utils/date-util'
@@ -58,7 +58,6 @@ import { api } from '@/utils/api'
import axios from 'axios' import axios from 'axios'
import { get } from '@/utils/http' import { get } from '@/utils/http'
import chartMixin from '@/views/charts2/chart-mixin' import chartMixin from '@/views/charts2/chart-mixin'
// import { Rectangle3D } from '@amcharts/amcharts4/.internal/core/elements/3d/Rectangle3D'
import ChartError from '@/components/common/Error' import ChartError from '@/components/common/Error'
export default { export default {
name: 'NpmMap', name: 'NpmMap',
@@ -141,7 +140,7 @@ export default {
res2.forEach((r, i) => { res2.forEach((r, i) => {
if (r.code === 200) { if (r.code === 200) {
mapData.forEach(t => { mapData.forEach(t => {
const find = r.data.result.find(d => d.country === t.country) const find = r.data.result.find(d => d.country === t.country && t.province === d.province)
t[keyPre[i] + 'Score'] = find t[keyPre[i] + 'Score'] = find
}) })
} else { } else {