CN-1416 fix: 增加一些字符的国际化映射

This commit is contained in:
刘洪洪
2023-10-30 11:14:58 +08:00
parent 186e115adf
commit dbc68077ca
10 changed files with 261 additions and 99 deletions

View File

@@ -75,8 +75,8 @@
<div class="row__content" v-if="$_.get(basicInfo, 'domainInfo.category.reputationLevel')">
<div
class="row__tag row__tag__level"
:style="`background-color:${eventSeverityColor[basicInfo.domainInfo.category.reputationLevel]}`">
{{ basicInfo.domainInfo.category.reputationLevel }}
:style="`background-color:${riskLevelColor1[basicInfo.domainInfo.category.reputationLevel]}`">
{{ reputationLevel(basicInfo.domainInfo.category.reputationLevel) || '-' }}
</div>
</div>
<div class="row__content" v-else>-</div>
@@ -346,7 +346,7 @@
import axios from 'axios'
import { api } from '@/utils/api'
import { getMillisecond, dateFormatByAppearance } from '@/utils/date-util'
import { eventSeverityColor, unitTypes, countryNameIdMapping, riskLevelMapping, riskLevelColor } from '@/utils/constants'
import { eventSeverityColor, unitTypes, countryNameIdMapping, riskLevelMapping, riskLevelColor, riskLevelColor1 } from '@/utils/constants'
import unitConvert from '@/utils/unit-convert'
import _ from 'lodash'
export default {
@@ -358,6 +358,7 @@ export default {
return {
eventSeverityColor,
riskLevelColor,
riskLevelColor1,
basicInfo: {},
events: [],
reference: 'https://attack.mitre.org',
@@ -391,7 +392,15 @@ export default {
const m = riskLevelMapping.find(mapping => {
return mapping.value == level
})
return (m && m.name) || level
return (m && this.$t(m.label)) || level
}
},
reputationLevel () {
return function (level) {
const m = riskLevelMapping.find(mapping => {
return mapping.name == level
})
return (m && this.$t(m.label)) || level
}
},
locationRegion (info) {