fix:修改部分legend 未国际化的问题
This commit is contained in:
@@ -72,7 +72,7 @@ import {
|
|||||||
isAppRelatedDomain,
|
isAppRelatedDomain,
|
||||||
isBlock
|
isBlock
|
||||||
} from './charts/tools'
|
} from './charts/tools'
|
||||||
import { tableTitleMapping } from '@/components/charts/chart-table-title'
|
import { tableTitleMapping, legendMapping } from '@/components/charts/chart-table-title'
|
||||||
import { replaceUrlPlaceholder } from '@/utils/tools'
|
import { replaceUrlPlaceholder } from '@/utils/tools'
|
||||||
import { getNowTime, getSecond } from '@/utils/date-util'
|
import { getNowTime, getSecond } from '@/utils/date-util'
|
||||||
import { chartPieTableTopOptions, chartTableDefaultPageSize, chartTableTopOptions } from '@/utils/constants'
|
import { chartPieTableTopOptions, chartTableDefaultPageSize, chartTableTopOptions } from '@/utils/constants'
|
||||||
@@ -163,6 +163,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/* 参数 extraParams 额外请求参数,isRefresh 是否是刷新 */
|
/* 参数 extraParams 额外请求参数,isRefresh 是否是刷新 */
|
||||||
getChartData (url, extraParams = {}, isRefresh) {
|
getChartData (url, extraParams = {}, isRefresh) {
|
||||||
|
const vm = this
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.standaloneTimeRange.use = !!isRefresh
|
this.standaloneTimeRange.use = !!isRefresh
|
||||||
try {
|
try {
|
||||||
@@ -208,6 +209,13 @@ export default {
|
|||||||
response = testData.data2
|
response = testData.data2
|
||||||
}
|
}
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
if (Array.isArray(response.data.result)) {
|
||||||
|
response.data.result.forEach(item => {
|
||||||
|
if (item.legend && legendMapping[`${this.entity && this.entity.ip ? 'ip_' : ''}${item.legend}`]) {
|
||||||
|
item.legend = vm.$t(legendMapping[`${this.entity && this.entity.ip ? 'ip_' : ''}${item.legend}`])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
this.chartData = response.data.result
|
this.chartData = response.data.result
|
||||||
this.table.tableData = response.data.result
|
this.table.tableData = response.data.result
|
||||||
this.table.tableColumns = this.getTableTitle(response.data.result)
|
this.table.tableColumns = this.getTableTitle(response.data.result)
|
||||||
@@ -323,7 +331,7 @@ export default {
|
|||||||
},
|
},
|
||||||
groupShow (chartInfo) {
|
groupShow (chartInfo) {
|
||||||
this.$emit('groupShow', chartInfo)
|
this.$emit('groupShow', chartInfo)
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.showLoading(true)
|
this.showLoading(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user