fix: 修复用户需求排行榜分页排名显示问题
This commit is contained in:
parent
311de1262e
commit
1b2525dd9c
@ -157,10 +157,13 @@
|
||||
row-key="userId"
|
||||
size="middle"
|
||||
class="dark-table"
|
||||
@change="handleUserTableChange"
|
||||
>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.key === 'rank'">
|
||||
<span class="rank-badge" :class="getRankClass(index + 1)">{{ index + 1 }}</span>
|
||||
<span class="rank-badge" :class="getRankClass(getUserGlobalRank(index))">
|
||||
{{ getUserGlobalRank(index) }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'totalScore'">
|
||||
<span class="score-value">{{ formatScore(record.totalScore) }}</span>
|
||||
@ -631,6 +634,9 @@ const departmentList = ref<any[]>([])
|
||||
// 设计师绩效表格分页
|
||||
const designerTablePage = ref(1)
|
||||
|
||||
// 用户需求表格分页
|
||||
const userTablePage = ref(1)
|
||||
|
||||
// 扣分明细弹窗
|
||||
const deductionDetailVisible = ref(false)
|
||||
const deductionDetailLoading = ref(false)
|
||||
@ -1111,11 +1117,16 @@ const handleDeptChange = (deptId: number | undefined) => {
|
||||
loadDesignerData()
|
||||
}
|
||||
|
||||
// 计算全局排名(考虑分页)
|
||||
// 计算全局排名(考虑分页)- 设计师绩效
|
||||
const getGlobalRank = (index: number): number => {
|
||||
return (designerTablePage.value - 1) * 10 + index + 1
|
||||
}
|
||||
|
||||
// 计算全局排名(考虑分页)- 用户需求
|
||||
const getUserGlobalRank = (index: number): number => {
|
||||
return (userTablePage.value - 1) * 10 + index + 1
|
||||
}
|
||||
|
||||
// 处理设计师绩效表格变化(翻页等)
|
||||
const handleDesignerTableChange = (pagination: any) => {
|
||||
if (pagination && pagination.current) {
|
||||
@ -1123,6 +1134,13 @@ const handleDesignerTableChange = (pagination: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理用户需求表格变化(翻页等)
|
||||
const handleUserTableChange = (pagination: any) => {
|
||||
if (pagination && pagination.current) {
|
||||
userTablePage.value = pagination.current
|
||||
}
|
||||
}
|
||||
|
||||
// 显示扣分明细
|
||||
const showDeductionDetails = async (record: any) => {
|
||||
console.log('点击扣分数字:', record)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user