fix: 修复设计师绩效排行榜分页排名显示问题,第二页应显示11-20名

This commit is contained in:
Your Name 2026-01-16 14:01:28 +08:00
parent 42299bbe30
commit 311de1262e

View File

@ -237,11 +237,12 @@
row-key="userId"
size="middle"
class="dark-table"
@change="handleDesignerTableChange"
>
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'rank'">
<span class="rank-badge" :class="getRankClass(index + 1)">
{{ index + 1 }}
<span class="rank-badge" :class="getRankClass(getGlobalRank(index))">
{{ getGlobalRank(index) }}
</span>
</template>
<template v-else-if="column.key === 'onTimeRate'">
@ -627,6 +628,9 @@ const warningFilter = ref('all')
const selectedDeptId = ref<number | undefined>(undefined)
const departmentList = ref<any[]>([])
// 设计师绩效表格分页
const designerTablePage = ref(1)
// 扣分明细弹窗
const deductionDetailVisible = ref(false)
const deductionDetailLoading = ref(false)
@ -1103,9 +1107,22 @@ const loadDepartments = async () => {
// 部门筛选变化
const handleDeptChange = (deptId: number | undefined) => {
selectedDeptId.value = deptId
designerTablePage.value = 1 // 重置到第一页
loadDesignerData()
}
// 计算全局排名(考虑分页)
const getGlobalRank = (index: number): number => {
return (designerTablePage.value - 1) * 10 + index + 1
}
// 处理设计师绩效表格变化(翻页等)
const handleDesignerTableChange = (pagination: any) => {
if (pagination && pagination.current) {
designerTablePage.value = pagination.current
}
}
// 显示扣分明细
const showDeductionDetails = async (record: any) => {
console.log('点击扣分数字:', record)