fix:CN-1377 1.日历插件的国际化;2.分页插件的国际化;3.”域名“国际化
This commit is contained in:
@@ -1,35 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="pagination" >
|
<div class="pagination" >
|
||||||
<el-pagination
|
<el-config-provider :locale="locale">
|
||||||
ref="page"
|
<el-pagination
|
||||||
@size-change="size"
|
ref="page"
|
||||||
@prev-click="prev"
|
@size-change="size"
|
||||||
@next-click="next"
|
@prev-click="prev"
|
||||||
@current-change="current"
|
@next-click="next"
|
||||||
:current-page="pageObj.pageNo"
|
@current-change="current"
|
||||||
:page-sizes="pageSizes?pageSizes:[20, 50, 100]"
|
:current-page="pageObj.pageNo"
|
||||||
:page-size="Number(pageObj.pageSize)"
|
:page-sizes="pageSizes?pageSizes:[20, 50, 100]"
|
||||||
:layout="layout"
|
:page-size="Number(pageObj.pageSize)"
|
||||||
:total="pageObj.total"
|
:layout="layout"
|
||||||
v-bind="bind"
|
:total="pageObj.total"
|
||||||
>
|
v-bind="bind"
|
||||||
<el-select v-model="pageSize" :placeholder="pageSize+$t('pageSize')" size="mini"
|
>
|
||||||
:popper-append-to-body="appendToBody" class="pagination-size-select" @change="size"
|
<el-select v-model="pageSize" :placeholder="pageSize+$t('pageSize')" size="mini"
|
||||||
:popper-class="popClass" @visible-change="popperVisible">
|
:popper-append-to-body="appendToBody" class="pagination-size-select" @change="size"
|
||||||
<el-option v-for="(item, index) in pageSizes" :key="index" :label="item.label" :value="item.value"></el-option>
|
:popper-class="popClass" @visible-change="popperVisible">
|
||||||
</el-select>
|
<el-option v-for="(item, index) in pageSizes" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defaultPageSize, storageKey } from '@/utils/constants'
|
import { defaultPageSize, storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
import { urlParamsHandler, overwriteUrl } from '@/utils/tools'
|
import { urlParamsHandler, overwriteUrl } from '@/utils/tools'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { parseInt } from 'lodash'
|
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 {
|
export default {
|
||||||
name: 'pagination',
|
name: 'pagination',
|
||||||
@@ -60,9 +64,15 @@ export default {
|
|||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
const pageSize = ref(defaultPageSize)
|
const pageSize = ref(defaultPageSize)
|
||||||
const currentPageNo = ref(props.storePageNoOnUrl ? (query.pageNo || (props.pageObj.pageNo || 1)) : (props.pageObj.pageNo || 1))
|
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 {
|
return {
|
||||||
pageSize,
|
pageSize,
|
||||||
currentPageNo
|
currentPageNo,
|
||||||
|
locale
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
<el-row class="date-range-panel-top" style="position: relative">
|
<el-row class="date-range-panel-top" style="position: relative">
|
||||||
<el-col :span="16" class="date-range-panel-content date-range-panel-content-left">
|
<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>
|
<div class="date-range-title" style="padding-left: 0">{{$t('dateTime.absoluteTimeRange')}}</div>
|
||||||
|
<el-config-provider :locale="locale">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="newDateValue"
|
v-model="newDateValue"
|
||||||
ref="newDatePicker"
|
ref="newDatePicker"
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
@change="timeArrChange"
|
@change="timeArrChange"
|
||||||
/>
|
/>
|
||||||
|
</el-config-provider>
|
||||||
<div class="content-title">{{$t('dateTime.from')}}</div>
|
<div class="content-title">{{$t('dateTime.from')}}</div>
|
||||||
<div @click="myDatePickerShow" tabindex="1" class="content-input">
|
<div @click="myDatePickerShow" tabindex="1" class="content-input">
|
||||||
{{ dateFormatByAppearance(getMillisecond(myStartTime)) }}
|
{{ dateFormatByAppearance(getMillisecond(myStartTime)) }}
|
||||||
@@ -82,6 +84,9 @@ import { ref, computed, watch, reactive } from 'vue'
|
|||||||
import { storageKey } from '@/utils/constants'
|
import { storageKey } from '@/utils/constants'
|
||||||
import { getMillisecond, millTimestampDiffFromTz, timestampToList } from '@/utils/date-util'
|
import { getMillisecond, millTimestampDiffFromTz, timestampToList } from '@/utils/date-util'
|
||||||
import { useStore } from 'vuex'
|
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 {
|
export default {
|
||||||
name: 'DateTimeRange',
|
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 {
|
return {
|
||||||
myStartTime,
|
myStartTime,
|
||||||
myEndTime,
|
myEndTime,
|
||||||
@@ -316,7 +327,8 @@ export default {
|
|||||||
timeArrChange,
|
timeArrChange,
|
||||||
returnValue,
|
returnValue,
|
||||||
quickChange,
|
quickChange,
|
||||||
historyChange
|
historyChange,
|
||||||
|
locale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="entity-detail-basic-info">
|
<div class="entity-detail-basic-info">
|
||||||
<chart-error v-if="showError" :content="errorMsg"/>
|
<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">
|
||||||
<div class="entity-basic-info__name">
|
<div class="entity-basic-info__name">
|
||||||
<span id="entityName">{{entity.entityName}}</span>
|
<span id="entityName">{{entity.entityName}}</span>
|
||||||
@@ -90,6 +90,29 @@ export default {
|
|||||||
hideTagArea: false
|
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: {
|
methods: {
|
||||||
getTagColor,
|
getTagColor,
|
||||||
tagValueHandler (value) {
|
tagValueHandler (value) {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
<div style="display: flex;flex-direction: column;height: calc(100% - 42px);">
|
<div style="display: flex;flex-direction: column;height: calc(100% - 42px);">
|
||||||
<div class="explorer-result" v-if="showList" style="position: relative;">
|
<div class="explorer-result" v-if="showList" style="position: relative;">
|
||||||
<loading :loading="loadingCount" style="width: 240px"></loading>
|
<loading :loading="loadingCount" style="width: 240px"></loading>
|
||||||
<span>{{ summaryCount.totalCount }} </span>results,IP
|
<span>{{ summaryCount.totalCount }} </span>{{$t('overall.results')}},IP
|
||||||
<span>{{ summaryCount.ipCount }}</span>,Domain
|
<span>{{ summaryCount.ipCount }}</span>,{{$t('overall.domain')}}
|
||||||
<span>{{ summaryCount.domainCount }}</span>,APP
|
<span>{{ summaryCount.domainCount }}</span>,APP
|
||||||
<span>{{ summaryCount.appCount }}</span>
|
<span>{{ summaryCount.appCount }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<div class="entity-overview">
|
<div class="entity-overview">
|
||||||
<div class="overview-left">
|
<div class="overview-left">
|
||||||
<span class="overview-left-loading">
|
<span class="overview-left-loading">
|
||||||
<span class="overview-left-loading-span">Domain</span>
|
<span class="overview-left-loading-span">{{$t('overall.domain')}}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overview-right">
|
<div class="overview-right">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="graph-detail__icon"><i :class="iconClass"></i></div>
|
<div class="graph-detail__icon"><i :class="iconClass"></i></div>
|
||||||
|
|
||||||
<div class="graph-detail-header">
|
<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">
|
||||||
<div class="graph-basic-info-name__block">
|
<div class="graph-basic-info-name__block">
|
||||||
<div class="graph-basic-info-name" :title="$_.get(node, 'id', '')" id="entityName">{{ $_.get(node, 'id', '') }}</div>
|
<div class="graph-basic-info-name" :title="$_.get(node, 'id', '')" id="entityName">{{ $_.get(node, 'id', '') }}</div>
|
||||||
@@ -144,6 +144,27 @@ export default {
|
|||||||
}
|
}
|
||||||
return className
|
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 () {
|
handleDate () {
|
||||||
return function (key) {
|
return function (key) {
|
||||||
const date = _.get(this.node, key, '')
|
const date = _.get(this.node, key, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user