fix: 适配 echarts map 的地名

This commit is contained in:
puhui999
2024-04-22 11:04:53 +08:00
parent afdee2cd48
commit deb4585d4b
3 changed files with 62 additions and 54 deletions

View File

@ -1,4 +1,4 @@
import { toNumber } from 'lodash-es'
import {toNumber} from 'lodash-es'
/**
*
@ -418,3 +418,20 @@ export const erpCalculatePercentage = (value: number, total: number) => {
if (total === 0) return 0
return ((value / total) * 100).toFixed(2)
}
/**
* 适配 echarts map 的地名
*
* @param areaName 地区名称
*/
export const areaReplace = (areaName: string) => {
if (!areaName) {
return areaName
}
return areaName
.replace('维吾尔自治区', '')
.replace('壮族自治区', '')
.replace('回族自治区', '')
.replace('自治区', '')
.replace('省', '')
}