CN-39 feat: 地图

This commit is contained in:
chenjinsong
2021-07-01 15:39:48 +08:00
parent fbdf0ba81e
commit 3a30733be0
29 changed files with 126 additions and 5867 deletions

View File

@@ -1,6 +1,8 @@
import { ElMessageBox } from 'element-plus'
import i18n from '@/i18n'
import _ from 'lodash'
import { storageKey } from '@/utils/constants'
import { getCache, setCache } from '@/utils/cache'
export const tableSort = {
// 是否需要排序
@@ -388,11 +390,16 @@ export function replaceUrlPlaceholder (url, params) {
// 下划线转换驼峰
export function lineToHump (name) {
return name.replace(/\_(\w)/g, function(all, letter){
return name.replace(/\_(\w)/g, function (all, letter) {
return letter.toUpperCase()
})
}
// 驼峰转换下划线
export function humpToLine (name) {
return name.replace(/([A-Z])/g,"_$1").toLowerCase()
return name.replace(/([A-Z])/g, '_$1').toLowerCase()
}
export function getCapitalGeo (countryId) {
!getCache('capitalGeo') && setCache('capitalGeo', JSON.parse(sessionStorage.getItem(storageKey.iso36112)))
return getCache('capitalGeo')[countryId]
}