fix: 1、搜索组件有关枚举的添加国际化;2、修复tag模式下切换key,value还保留上次选择的问题;3、修复切换语言环境,搜索参数包含其他语言导致不能识别转换的问题

This commit is contained in:
刘洪洪
2023-12-20 18:38:38 +08:00
parent 19160c0da1
commit abab03eb12
10 changed files with 84 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
import { ElMessageBox, ElMessage } from 'element-plus'
import i18n from '@/i18n'
import _ from 'lodash'
import { storageKey, iso36112, topDomain, echartsFontSize, dbGeoDataTableName, networkTable, dbDrilldownTableConfig, ZH, EN } from '@/utils/constants'
import { storageKey, iso36112, topDomain, echartsFontSize, dbGeoDataTableName, networkTable, dbDrilldownTableConfig, ZH, EN, securityLevel } from '@/utils/constants'
import { getIso36112JsonData, getDictList } from '@/utils/api'
import { format } from 'echarts'
import router from '@/router'
@@ -1447,3 +1447,19 @@ export const changeTimeByDate = (date) => {
}
}
}
/**
* 转换严重程度severity的国际化值
*/
export const changeI18nOfSeverity = (severity) => {
if (severity) {
const obj = securityLevel.find(d => d.value === severity)
if (obj) {
return i18n.global.t(obj.label)
} else {
return severity
}
} else {
return '-'
}
}