CN-1416 fix: 增加一些字符的国际化映射
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
<div class="basic-info__item" v-if="item.eventSeverity">
|
<div class="basic-info__item" v-if="item.eventSeverity">
|
||||||
<i class="cn-icon cn-icon-severity-level"></i>
|
<i class="cn-icon cn-icon-severity-level"></i>
|
||||||
<span>{{ $t('network.severity') }} : </span>
|
<span>{{ $t('network.severity') }} : </span>
|
||||||
<span :test-id="`severity${index}`">{{ toUpperCaseByString(item.eventSeverity) || '-' }}</span>
|
<span :test-id="`severity${index}`">{{ changeSecurity(item.eventSeverity) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="basic-info__item">
|
<div class="basic-info__item">
|
||||||
<i class="cn-icon cn-icon-time2"></i>
|
<i class="cn-icon cn-icon-time2"></i>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { dateFormatByAppearance } from '@/utils/date-util'
|
import { dateFormatByAppearance } from '@/utils/date-util'
|
||||||
import { eventSeverityColor, entityDetailTabsName } from '@/utils/constants'
|
import { eventSeverityColor, entityDetailTabsName, securityLevel } from '@/utils/constants'
|
||||||
import unitConvert from '@/utils/unit-convert'
|
import unitConvert from '@/utils/unit-convert'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { api } from '@/utils/api'
|
import { api } from '@/utils/api'
|
||||||
@@ -130,6 +130,18 @@ export default {
|
|||||||
this.showError = true
|
this.showError = true
|
||||||
this.errorMsg = this.errorMsgHandler(e)
|
this.errorMsg = this.errorMsgHandler(e)
|
||||||
this.$emit('checkTag', entityDetailTabsName.performanceEvent, 0)
|
this.$emit('checkTag', entityDetailTabsName.performanceEvent, 0)
|
||||||
|
},
|
||||||
|
changeSecurity (value) {
|
||||||
|
if (value) {
|
||||||
|
const obj = securityLevel.find(d => d.value === value)
|
||||||
|
let label = value
|
||||||
|
if (obj) {
|
||||||
|
label = this.$t(obj.label)
|
||||||
|
}
|
||||||
|
return label
|
||||||
|
} else {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="basic-info__item" v-if="item.eventSeverity">
|
<div class="basic-info__item" v-if="item.eventSeverity">
|
||||||
<i class="cn-icon cn-icon-severity-level"></i>
|
<i class="cn-icon cn-icon-severity-level"></i>
|
||||||
<span>{{ $t('network.severity') }} : </span>
|
<span>{{ $t('network.severity') }} : </span>
|
||||||
<span>{{ toUpperCaseByString(item.eventSeverity) || '-' }}</span>
|
<span>{{ changeSecurity(item.eventSeverity) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="basic-info__item" v-if="item.eventType">
|
<div class="basic-info__item" v-if="item.eventType">
|
||||||
<i class="cn-icon cn-icon-event-type"></i>
|
<i class="cn-icon cn-icon-event-type"></i>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { dateFormatByAppearance } from '@/utils/date-util'
|
import { dateFormatByAppearance } from '@/utils/date-util'
|
||||||
import { eventSeverityColor, entityDetailTabsName } from '@/utils/constants'
|
import { eventSeverityColor, entityDetailTabsName, securityLevel } from '@/utils/constants'
|
||||||
import unitConvert from '@/utils/unit-convert'
|
import unitConvert from '@/utils/unit-convert'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { api } from '@/utils/api'
|
import { api } from '@/utils/api'
|
||||||
@@ -155,6 +155,18 @@ export default {
|
|||||||
this.isNoData = false
|
this.isNoData = false
|
||||||
this.showError = true
|
this.showError = true
|
||||||
this.errorMsg = this.errorMsgHandler(e)
|
this.errorMsg = this.errorMsgHandler(e)
|
||||||
|
},
|
||||||
|
changeSecurity (value) {
|
||||||
|
if (value) {
|
||||||
|
const obj = securityLevel.find(d => d.value === value)
|
||||||
|
let label = value
|
||||||
|
if (obj) {
|
||||||
|
label = this.$t(obj.label)
|
||||||
|
}
|
||||||
|
return label
|
||||||
|
} else {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<template #default="scope" :column="item">
|
<template #default="scope" :column="item">
|
||||||
<div class="data-recent-table">
|
<div class="data-recent-table">
|
||||||
<template v-if="item.prop === 'eventSeverity'">
|
<template v-if="item.prop === 'eventSeverity'">
|
||||||
<span class="data-recent-table-severity" :class="scope.row[item.prop]" :test-id="`eventSeverity-${scope.row.eventSeverity}-${scope.$index}`">{{scope.row[item.prop]}}</span>
|
<span class="data-recent-table-severity" :class="scope.row[item.prop]" :test-id="`eventSeverity-${scope.row.eventSeverity}-${scope.$index}`">{{ getEventSeverity(scope.row[item.prop]) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'eventKey'">
|
<template v-else-if="item.prop === 'eventKey'">
|
||||||
<span class="data-recent-table-entity click-active" @click="jumpPage(scope.row)" :test-id="`eventKey-${splitEventKey(scope.row.eventKey)}-${scope.$index}`">{{splitEventKey(scope.row[item.prop])}}</span>
|
<span class="data-recent-table-entity click-active" @click="jumpPage(scope.row)" :test-id="`eventKey-${splitEventKey(scope.row.eventKey)}-${scope.$index}`">{{splitEventKey(scope.row[item.prop])}}</span>
|
||||||
@@ -57,6 +57,7 @@ import ChartError from '@/components/common/Error'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { dataForNpmRecentEvents } from '@/utils/static-data'
|
import { dataForNpmRecentEvents } from '@/utils/static-data'
|
||||||
import { beforeRouterPush } from '@/utils/tools'
|
import { beforeRouterPush } from '@/utils/tools'
|
||||||
|
import { securityLevel } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'NpmRecentEvents',
|
name: 'NpmRecentEvents',
|
||||||
@@ -158,6 +159,14 @@ export default {
|
|||||||
this.isNoData = false
|
this.isNoData = false
|
||||||
this.showError = true
|
this.showError = true
|
||||||
this.errorMsg = this.errorMsgHandler(res)
|
this.errorMsg = this.errorMsgHandler(res)
|
||||||
|
},
|
||||||
|
getEventSeverity (severity) {
|
||||||
|
const obj = securityLevel.find(d => d.value === severity)
|
||||||
|
if (obj) {
|
||||||
|
return this.$t(obj.label)
|
||||||
|
} else {
|
||||||
|
return severity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
Reference in New Issue
Block a user