|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<uni-navbar-lite :showLeft="false" title="工分" />
|
|
|
<view class="list-page">
|
|
|
- <!-- 搜索栏 -->
|
|
|
+ <!-- 搜索栏 -->
|
|
|
<view class="search-bar">
|
|
|
<view class="search-box">
|
|
|
<image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
|
|
|
@@ -63,19 +63,19 @@
|
|
|
</text> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="stats-section">
|
|
|
<!-- 标签切换 -->
|
|
|
<view class="stats-tabs">
|
|
|
<text
|
|
|
- class="tab-item"
|
|
|
+ class="tab-item"
|
|
|
:class="{ 'tab-active': activeTab === 'ranking' }"
|
|
|
@click="switchTab('ranking')"
|
|
|
>
|
|
|
个人排名
|
|
|
</text>
|
|
|
<text
|
|
|
- class="tab-item"
|
|
|
+ class="tab-item"
|
|
|
:class="{ 'tab-active': activeTab === 'score' }"
|
|
|
@click="switchTab('score')"
|
|
|
>
|
|
|
@@ -83,7 +83,7 @@
|
|
|
</text>
|
|
|
</view>
|
|
|
<!-- 个人排名内容 -->
|
|
|
- <view v-if="activeTab === 'ranking'" class="ranking-content">
|
|
|
+ <view v-if="activeTab === 'ranking'" class="ranking-content">
|
|
|
<!-- 排名模块 -->
|
|
|
<view v-if="rankingItems.length > 0">
|
|
|
<view class="ranking-item-wrapper" v-for="(item, index) in rankingItems" :key="index">
|
|
|
@@ -134,15 +134,15 @@
|
|
|
自定义
|
|
|
</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 统计数据 -->
|
|
|
- <view class="stats-content">
|
|
|
+ <view class="stats-content">
|
|
|
<view class="total-score">
|
|
|
<text class="score-value">{{ totalScore }}分</text>
|
|
|
<text class="score-label">{{ monthTitle }}总工分</text>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="score-breakdown">
|
|
|
<view class="breakdown-item">
|
|
|
<text class="breakdown-label">维保工分</text>
|
|
|
@@ -237,7 +237,7 @@
|
|
|
|
|
|
<!-- 底部 TabBar -->
|
|
|
<custom-tabbar :current="3" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="uts">
|
|
|
@@ -263,7 +263,7 @@
|
|
|
const rank = ref<number | null>(null)
|
|
|
const totalRankingUsers = ref<number | null>(null)
|
|
|
const customDate = ref<string>('')
|
|
|
-
|
|
|
+
|
|
|
// 新增:标签切换相关
|
|
|
const activeTab = ref<string>('ranking') // 默认显示个人排名
|
|
|
|
|
|
@@ -273,7 +273,7 @@
|
|
|
rank: number;
|
|
|
total: number;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 新增:个人排名相关数据
|
|
|
const rankingItems = ref<RankingItem[]>([])
|
|
|
|
|
|
@@ -317,7 +317,7 @@
|
|
|
})
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
// 根据索引获取排名圆圈的大小类(复制并修改自开屏页)
|
|
|
@@ -332,17 +332,17 @@
|
|
|
try {
|
|
|
// 调用后端API获取用户数据
|
|
|
const response = await selectHomePageData();
|
|
|
-
|
|
|
+
|
|
|
// 根据响应结果更新rankingItems
|
|
|
if (response != null) {
|
|
|
- const respObj = response as UTSJSONObject;
|
|
|
- const data = respObj['data'] as UTSJSONObject;
|
|
|
-
|
|
|
+ const respObj = response as UTSJSONObject;
|
|
|
+ const data = respObj['data'] as UTSJSONObject;
|
|
|
+
|
|
|
// 初始化默认值
|
|
|
let deptName = '未知部门';
|
|
|
let center = '未知中心';
|
|
|
let companyName = '未知公司';
|
|
|
-
|
|
|
+
|
|
|
// 从scoreDept中提取部门、中心和公司名称
|
|
|
if (data.hasOwnProperty('scoreDept') && Array.isArray(data['scoreDept']) && (data['scoreDept'] as any[]).length > 0) {
|
|
|
const scoreDept = data['scoreDept'] as UTSJSONObject[];
|
|
|
@@ -357,10 +357,10 @@
|
|
|
companyName = firstItem['companyName'] as string;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 更新排名信息
|
|
|
const items : RankingItem[] = [];
|
|
|
-
|
|
|
+
|
|
|
// 部门排名(东山电场)
|
|
|
if (data.hasOwnProperty('deptSort') && data.hasOwnProperty('scoreDept')) {
|
|
|
const deptSort = typeof data['deptSort'] === 'number' ? data['deptSort'] as number : 0;
|
|
|
@@ -374,7 +374,7 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 中心排名(陆上设备维护中心)
|
|
|
if (data.hasOwnProperty('centerSort') && data.hasOwnProperty('scoreCenter')) {
|
|
|
const centerSort = typeof data['centerSort'] === 'number' ? data['centerSort'] as number : 0;
|
|
|
@@ -388,7 +388,7 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 公司排名
|
|
|
if (data.hasOwnProperty('companySort') && data.hasOwnProperty('scoreCompany')) {
|
|
|
const companySort = typeof data['companySort'] === 'number' ? data['companySort'] as number : 0;
|
|
|
@@ -402,7 +402,7 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 更新rankingItems
|
|
|
rankingItems.value = items;
|
|
|
}
|
|
|
@@ -414,7 +414,7 @@
|
|
|
// 新增:切换标签
|
|
|
function switchTab(tab: string) {
|
|
|
activeTab.value = tab;
|
|
|
-
|
|
|
+
|
|
|
// 当切换到个人排名标签时,获取排名数据
|
|
|
if (tab === 'ranking') {
|
|
|
fetchRankingData();
|
|
|
@@ -986,14 +986,14 @@
|
|
|
// 检查权限设置tabbar
|
|
|
tabbar[2] = checkPermi(['gxt:app:worktime']) ? 1 : 0
|
|
|
tabbar[3] = checkPermi(['gxt:app:score']) ? 1 : 0
|
|
|
-
|
|
|
+
|
|
|
loadStatusDictList()
|
|
|
loadInspectionTypeDictList()
|
|
|
loadMaintenanceTypeDictList()
|
|
|
loadData(false)
|
|
|
getStatistics()
|
|
|
dictLoaded.value = true
|
|
|
-
|
|
|
+
|
|
|
// 获取初始排名数据
|
|
|
fetchRankingData();
|
|
|
})
|
|
|
@@ -1333,6 +1333,8 @@
|
|
|
.cancel-btn {
|
|
|
color: #999;
|
|
|
padding: 10rpx 20rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.confirm-btn {
|
|
|
@@ -1431,7 +1433,7 @@
|
|
|
border-color: #ff7446;
|
|
|
}
|
|
|
|
|
|
-/* 个人排名模块样式 */
|
|
|
+/* 个人排名模块样式 */
|
|
|
.ranking-item-wrapper {
|
|
|
padding: 5rpx 30rpx;
|
|
|
margin-bottom: 5rpx;
|
|
|
@@ -1542,4 +1544,4 @@
|
|
|
font-size: 28rpx;
|
|
|
color: #999;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|