mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-16 03:45:07 +08:00
fix: 适配 echarts map 的地名
This commit is contained in:
@ -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('省', '')
|
||||
}
|
||||
|
Reference in New Issue
Block a user