fix:CN-1377 1.日历插件的国际化;2.分页插件的国际化;3.”域名“国际化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="pagination" >
|
||||
<el-config-provider :locale="locale">
|
||||
<el-pagination
|
||||
ref="page"
|
||||
@size-change="size"
|
||||
@@ -20,16 +21,19 @@
|
||||
</el-select>
|
||||
|
||||
</el-pagination>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defaultPageSize, storageKey } from '@/utils/constants'
|
||||
|
||||
import { urlParamsHandler, overwriteUrl } from '@/utils/tools'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { parseInt } from 'lodash'
|
||||
import ElConfigProvider from 'element-plus'
|
||||
import cn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import en from 'element-plus/lib/locale/lang/en'
|
||||
|
||||
export default {
|
||||
name: 'pagination',
|
||||
@@ -60,9 +64,15 @@ export default {
|
||||
const { query } = useRoute()
|
||||
const pageSize = ref(defaultPageSize)
|
||||
const currentPageNo = ref(props.storePageNoOnUrl ? (query.pageNo || (props.pageObj.pageNo || 1)) : (props.pageObj.pageNo || 1))
|
||||
const language = localStorage.getItem(storageKey.language) || 'en' // 初始未选择默认 en 英文
|
||||
let locale = en
|
||||
if (language === 'cn') {
|
||||
locale = cn
|
||||
}
|
||||
return {
|
||||
pageSize,
|
||||
currentPageNo
|
||||
currentPageNo,
|
||||
locale
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<el-row class="date-range-panel-top" style="position: relative">
|
||||
<el-col :span="16" class="date-range-panel-content date-range-panel-content-left">
|
||||
<div class="date-range-title" style="padding-left: 0">{{$t('dateTime.absoluteTimeRange')}}</div>
|
||||
<el-config-provider :locale="locale">
|
||||
<el-date-picker
|
||||
v-model="newDateValue"
|
||||
ref="newDatePicker"
|
||||
@@ -30,6 +31,7 @@
|
||||
type="datetimerange"
|
||||
@change="timeArrChange"
|
||||
/>
|
||||
</el-config-provider>
|
||||
<div class="content-title">{{$t('dateTime.from')}}</div>
|
||||
<div @click="myDatePickerShow" tabindex="1" class="content-input">
|
||||
{{ dateFormatByAppearance(getMillisecond(myStartTime)) }}
|
||||
@@ -82,6 +84,9 @@ import { ref, computed, watch, reactive } from 'vue'
|
||||
import { storageKey } from '@/utils/constants'
|
||||
import { getMillisecond, millTimestampDiffFromTz, timestampToList } from '@/utils/date-util'
|
||||
import { useStore } from 'vuex'
|
||||
import ElConfigProvider from 'element-plus'
|
||||
import cn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import en from 'element-plus/lib/locale/lang/en'
|
||||
|
||||
export default {
|
||||
name: 'DateTimeRange',
|
||||
@@ -294,6 +299,12 @@ export default {
|
||||
})
|
||||
}
|
||||
}
|
||||
const language = localStorage.getItem(storageKey.language) || 'en' // 初始未选择默认 en 英文
|
||||
let locale = en
|
||||
if (language === 'cn') {
|
||||
locale = cn
|
||||
}
|
||||
|
||||
return {
|
||||
myStartTime,
|
||||
myEndTime,
|
||||
@@ -316,7 +327,8 @@ export default {
|
||||
timeArrChange,
|
||||
returnValue,
|
||||
quickChange,
|
||||
historyChange
|
||||
historyChange,
|
||||
locale
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="entity-detail-basic-info">
|
||||
<chart-error v-if="showError" :content="errorMsg"/>
|
||||
<div class="entity-type">{{entityType[entity.entityType]}}</div>
|
||||
<div class="entity-type">{{entityTypeName}}</div>
|
||||
<div class="entity-basic-info">
|
||||
<div class="entity-basic-info__name">
|
||||
<span id="entityName">{{entity.entityName}}</span>
|
||||
@@ -90,6 +90,29 @@ export default {
|
||||
hideTagArea: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
entityTypeName () {
|
||||
const type = this.entity.entityType
|
||||
let entityTypeName = '-'
|
||||
switch (type) {
|
||||
case ('ip'): {
|
||||
entityTypeName = 'IP'
|
||||
break
|
||||
}
|
||||
case ('domain'): {
|
||||
entityTypeName = this.$t('overall.domain')
|
||||
break
|
||||
}
|
||||
case ('app'): {
|
||||
entityTypeName = 'APP'
|
||||
break
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
return entityTypeName
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTagColor,
|
||||
tagValueHandler (value) {
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
<div style="display: flex;flex-direction: column;height: calc(100% - 42px);">
|
||||
<div class="explorer-result" v-if="showList" style="position: relative;">
|
||||
<loading :loading="loadingCount" style="width: 240px"></loading>
|
||||
<span>{{ summaryCount.totalCount }} </span>results,IP
|
||||
<span>{{ summaryCount.ipCount }}</span>,Domain
|
||||
<span>{{ summaryCount.totalCount }} </span>{{$t('overall.results')}},IP
|
||||
<span>{{ summaryCount.ipCount }}</span>,{{$t('overall.domain')}}
|
||||
<span>{{ summaryCount.domainCount }}</span>,APP
|
||||
<span>{{ summaryCount.appCount }}</span>
|
||||
</div>
|
||||
@@ -92,7 +92,7 @@
|
||||
<div class="entity-overview">
|
||||
<div class="overview-left">
|
||||
<span class="overview-left-loading">
|
||||
<span class="overview-left-loading-span">Domain</span>
|
||||
<span class="overview-left-loading-span">{{$t('overall.domain')}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="overview-right">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="graph-detail__icon"><i :class="iconClass"></i></div>
|
||||
|
||||
<div class="graph-detail-header">
|
||||
<div class="entity-graph-type">{{ $_.get(node, 'myData.entityType') ? entityType[$_.get(node, 'myData.entityType')] : '-' }}</div>
|
||||
<div class="entity-graph-type">{{entityTypeName}}</div>
|
||||
<div class="graph-basic-info">
|
||||
<div class="graph-basic-info-name__block">
|
||||
<div class="graph-basic-info-name" :title="$_.get(node, 'id', '')" id="entityName">{{ $_.get(node, 'id', '') }}</div>
|
||||
@@ -144,6 +144,27 @@ export default {
|
||||
}
|
||||
return className
|
||||
},
|
||||
entityTypeName () {
|
||||
const type = _.get(this.node, 'myData.entityType', '')
|
||||
let entityTypeName = '-'
|
||||
switch (type) {
|
||||
case ('ip'): {
|
||||
entityTypeName = 'IP'
|
||||
break
|
||||
}
|
||||
case ('domain'): {
|
||||
entityTypeName = this.$t('overall.domain')
|
||||
break
|
||||
}
|
||||
case ('app'): {
|
||||
entityTypeName = 'APP'
|
||||
break
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
return entityTypeName
|
||||
},
|
||||
handleDate () {
|
||||
return function (key) {
|
||||
const date = _.get(this.node, key, '')
|
||||
|
||||
Reference in New Issue
Block a user