Merge pull request #3323 from jumpserver/pr@dev@perf_dashboard_data

perf: 优化首页 rank 的宽度
This commit is contained in:
老广 2023-08-08 17:12:48 +08:00 committed by GitHub
commit 992025e618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 5 deletions

View File

@ -13,6 +13,7 @@
<script> <script>
import RankTable from '../components/RankTable.vue' import RankTable from '../components/RankTable.vue'
export default { export default {
components: { components: {
RankTable RankTable
@ -31,7 +32,8 @@ export default {
}, },
{ {
prop: 'total', prop: 'total',
label: this.$t('dashboard.LoginCount') label: this.$t('dashboard.LoginCount'),
width: '80px'
} }
] ]
}, },
@ -47,7 +49,8 @@ export default {
}, },
{ {
prop: 'total', prop: 'total',
label: this.$t('dashboard.NumberOfVisits') label: this.$t('dashboard.NumberOfVisits'),
width: '80px'
} }
] ]
} }

View File

@ -6,10 +6,10 @@
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%"
class="table" class="table"
style="width: 100%"
> >
<el-table-column :label="$tc('dashboard.ranking')"> <el-table-column :label="$tc('dashboard.ranking')" width="60px">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
@ -17,8 +17,9 @@
<el-table-column <el-table-column
v-for="i in config.columns" v-for="i in config.columns"
:key="i.prop" :key="i.prop"
:prop="i.prop"
:label="i.label" :label="i.label"
:prop="i.prop"
:width="i.width"
/> />
</el-table> </el-table>
</div> </div>
@ -81,5 +82,10 @@ export default {
} }
>>> .el-table th, .el-table tr { >>> .el-table th, .el-table tr {
background-color: #F5F6F7!important; background-color: #F5F6F7!important;
}
>>> .el-table .cell {
white-space: nowrap;
} }
</style> </style>