mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
Fixed: Dashboard PRBP
This commit is contained in:
@@ -32,8 +32,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'total',
|
||||
label: this.$t('LoginCount'),
|
||||
width: this.$i18n.locale === 'zh-CN' ? '120px' : '220px'
|
||||
label: this.$t('LoginCount')
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -49,8 +48,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'total',
|
||||
label: this.$t('NumberOfVisits'),
|
||||
width: this.$i18n.locale === 'zh-CN' ? '140px' : '140px'
|
||||
label: this.$t('NumberOfVisits')
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -58,7 +56,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -9,19 +9,22 @@
|
||||
class="table"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column :label="$tc('Ranking')" :width="this.$i18n.locale === 'zh-CN' ? '80px' : '110px'">
|
||||
<el-table-column :label="$tc('Ranking')">
|
||||
<template #header>
|
||||
<el-tooltip :content="$t('Ranking')" placement="top" :open-delay="500">
|
||||
<span style="cursor: pointer;">{{ $t('Ranking') }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-for="i in config.columns"
|
||||
:key="i.prop"
|
||||
:prop="i.prop"
|
||||
:width="i.width"
|
||||
:width="getColumnWidth(i)"
|
||||
>
|
||||
<template #header>
|
||||
<el-tooltip :content="i.label" placement="top" :open-delay="500">
|
||||
@@ -64,6 +67,19 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getColumnWidth(column) {
|
||||
if (column.prop === 'total') {
|
||||
const locale = this.$i18n.locale
|
||||
switch (locale) {
|
||||
case 'en':
|
||||
return '120px'
|
||||
case 'pt-br':
|
||||
return '220px'
|
||||
default:
|
||||
return '100px'
|
||||
}
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.$axios.get(this.tableUrl).then(res => {
|
||||
this.tableData = this.config.data ? res?.[this.config.data] : res
|
||||
|
||||
Reference in New Issue
Block a user