fix: 1、搜索组件有关枚举的添加国际化;2、修复tag模式下切换key,value还保留上次选择的问题;3、修复切换语言环境,搜索参数包含其他语言导致不能识别转换的问题
This commit is contained in:
@@ -426,8 +426,8 @@ export const enumerateData = [
|
||||
{
|
||||
name: 'status',
|
||||
data: [
|
||||
{ code: 'Ended', value: 1 },
|
||||
{ code: 'Active', value: 0 }
|
||||
{ code: _this.$t('detections.ended'), code1: 'detections.ended', value: 1 },
|
||||
{ code: _this.$t('detections.active'), code1: 'detections.active', value: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -446,11 +446,11 @@ export const enumerateData = [
|
||||
{
|
||||
name: 'severity',
|
||||
data: [
|
||||
{ code: 'critical', value: 'critical' },
|
||||
{ code: 'high', value: 'high' },
|
||||
{ code: 'Medium', value: 'Medium' },
|
||||
{ code: 'low', value: 'low' },
|
||||
{ code: 'info', value: 'info' }
|
||||
{ code: _this.$t('overall.critical'), code1: 'overall.critical', value: 'critical' },
|
||||
{ code: _this.$t('overall.high'), code1: 'overall.high', value: 'high' },
|
||||
{ code: _this.$t('overall.medium'), code1: 'overall.medium', value: 'medium' },
|
||||
{ code: _this.$t('overall.low'), code1: 'overall.low', value: 'low' },
|
||||
{ code: _this.$t('overall.info'), code1: 'overall.info', value: 'info' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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 '-'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user