Fixed: Dashboard PRBP

This commit is contained in:
zhaojisen
2025-02-18 15:57:09 +08:00
committed by ZhaoJiSen
parent 19469508f7
commit e6efd91414
2 changed files with 20 additions and 10 deletions

View File

@@ -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>

View File

@@ -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