tmp-upload #4
@@ -146,23 +146,23 @@
|
||||
{
|
||||
"id": 14,
|
||||
"name": "赵十六",
|
||||
"score": 732,
|
||||
"score": 0,
|
||||
"level": "C",
|
||||
"avatar": "🎯",
|
||||
"department": "财务部",
|
||||
"completedTasks": 20,
|
||||
"bonus": 300,
|
||||
"bonus": 0,
|
||||
"team": "力争上游"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"name": "钱十七",
|
||||
"score": 715,
|
||||
"score": 0,
|
||||
"level": "C",
|
||||
"avatar": "🎯",
|
||||
"department": "人力资源部",
|
||||
"completedTasks": 18,
|
||||
"bonus": 300,
|
||||
"bonus": 0,
|
||||
"team": "蓄势待发"
|
||||
}
|
||||
],
|
||||
@@ -377,7 +377,8 @@
|
||||
"department": "left",
|
||||
"bonus": "left"
|
||||
},
|
||||
"defaultDisplayRows": 7
|
||||
"defaultDisplayRows": 7,
|
||||
"filterZeroScore": true
|
||||
},
|
||||
"team": {
|
||||
"showMemberCount": false,
|
||||
@@ -402,7 +403,8 @@
|
||||
"leader": "left",
|
||||
"bonus": "left"
|
||||
},
|
||||
"defaultDisplayRows": 0
|
||||
"defaultDisplayRows": 0,
|
||||
"filterZeroScore": false
|
||||
},
|
||||
"championLogos": {
|
||||
"teamChampion": "",
|
||||
@@ -436,10 +438,7 @@
|
||||
"enabled": true
|
||||
},
|
||||
"pattern": {
|
||||
"strongBeats": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"strongBeats": [],
|
||||
"totalBeats": 4,
|
||||
"accentMultiplier": 1.5,
|
||||
"accentFrequencyOffset": 10,
|
||||
|
||||
@@ -88,6 +88,12 @@
|
||||
<span class="text-gold">显示头像列</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" v-model="localDisplayConfig.individual.filterZeroScore">
|
||||
<span class="text-gold">过滤业绩为0的记录</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<label class="checkbox-label">
|
||||
<span class="text-gold">移动端默认显示行数:</span>
|
||||
@@ -112,7 +118,7 @@
|
||||
</div>
|
||||
|
||||
<div class="column-alignment-section">
|
||||
<h4 class="text-gold">列对齐设置</h4>
|
||||
<h4 style="color: #007bff;">英雄排名列表-列对齐设置</h4>
|
||||
<div class="column-alignment-item">
|
||||
<label class="text-gold">排名列对齐:</label>
|
||||
<select v-model="localDisplayConfig.individual.columnAlignments.rank" class="align-select">
|
||||
@@ -172,7 +178,7 @@
|
||||
</div>
|
||||
|
||||
<div class="column-alignment-section">
|
||||
<h4 class="text-gold">列对齐设置</h4>
|
||||
<h4 style="color: #007bff;">战区排名列表-列对齐设置</h4>
|
||||
<div class="column-alignment-item">
|
||||
<label class="text-gold">排名列对齐:</label>
|
||||
<select v-model="localDisplayConfig.team.columnAlignments.rank" class="align-select">
|
||||
@@ -294,6 +300,12 @@
|
||||
<span class="text-gold">显示队长列</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" v-model="localDisplayConfig.team.filterZeroScore">
|
||||
<span class="text-gold">过滤业绩为0的记录</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<label class="checkbox-label">
|
||||
<span class="text-gold">移动端默认显示行数:</span>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<span v-if="localDisplayConfig.team?.showLeader" class="leader-col" :style="{ textAlign: localDisplayConfig.team?.columnAlignments?.leader || 'left' }">队长</span>
|
||||
<span v-if="localDisplayConfig.team?.showBonus" class="bonus-col" :style="{ textAlign: localDisplayConfig.team?.columnAlignments?.bonus || 'left' }">奖金</span>
|
||||
</div>
|
||||
<div v-for="(item, index) in teamRankings" :key="item.id" class="table-row"
|
||||
<div v-for="(item, index) in filteredTeamRankings" :key="item.id" class="table-row"
|
||||
:style="{ 'grid-template-columns': teamGridTemplate }" :class="{
|
||||
'top-three': index < 3,
|
||||
'highlight': index === 0
|
||||
@@ -93,22 +93,22 @@
|
||||
<!-- 英雄冠军 -->
|
||||
<div class="individual-champion">
|
||||
<div class="individual-avatar champion-container">
|
||||
<div class="crown-animation" v-if="individualRankings.length > 0">
|
||||
<div class="crown-animation" v-if="filteredIndividualRankings.length > 0">
|
||||
👑
|
||||
</div>
|
||||
<img v-if="individualRankings[0]?.avatar && individualRankings[0].avatar.startsWith('/')"
|
||||
:src="individualRankings[0].avatar" alt="冠军头像" class="avatar-image avatar-image-champion"
|
||||
<img v-if="filteredIndividualRankings[0]?.avatar && filteredIndividualRankings[0].avatar.startsWith('/')"
|
||||
:src="filteredIndividualRankings[0].avatar" alt="冠军头像" class="avatar-image avatar-image-champion"
|
||||
:style="{ width: localDisplayConfig.championLogos?.individualChampionSize + 'px', height: localDisplayConfig.championLogos?.individualChampionSize + 'px' }">
|
||||
<img v-else-if="localDisplayConfig.championLogos?.individualChampion"
|
||||
:src="localDisplayConfig.championLogos.individualChampion" alt="英雄冠军" class="champion-logo"
|
||||
:style="{ width: localDisplayConfig.championLogos?.individualChampionSize + 'px', height: localDisplayConfig.championLogos?.individualChampionSize + 'px' }">
|
||||
<span v-else
|
||||
:style="{ fontSize: localDisplayConfig.championLogos?.individualChampionSize ? (localDisplayConfig.championLogos.individualChampionSize * 0.8) + 'px' : '2rem' }">
|
||||
{{ individualRankings[0]?.avatar || '👤' }}
|
||||
{{ filteredIndividualRankings[0]?.avatar || '👤' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="champion-name">
|
||||
{{ individualRankings[0]?.name || '暂无冠军' }}
|
||||
{{ filteredIndividualRankings[0]?.name || '暂无冠军' }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 英雄排名 -->
|
||||
@@ -126,7 +126,7 @@
|
||||
<span v-if="localDisplayConfig.individual?.showDepartment" class="dept-col" :style="{ textAlign: localDisplayConfig.individual?.columnAlignments?.department || 'left' }">部门</span>
|
||||
<span v-if="localDisplayConfig.individual?.showBonus" class="bonus-col" :style="{ textAlign: localDisplayConfig.individual?.columnAlignments?.bonus || 'left' }">奖金</span>
|
||||
</div>
|
||||
<div v-for="(item, index) in individualRankings" :key="item.id" class="table-row"
|
||||
<div v-for="(item, index) in filteredIndividualRankings" :key="item.id" class="table-row"
|
||||
:style="{ 'grid-template-columns': individualGridTemplate }" :class="{
|
||||
'top-three': index < 3,
|
||||
'highlight': index === 0
|
||||
@@ -209,6 +209,7 @@ function createDefaultDisplayConfig() {
|
||||
showTeam: true, // 默认显示战区列
|
||||
showAvatar: false, // 默认不显示头像列
|
||||
defaultDisplayRows: 10, // 默认显示10行
|
||||
filterZeroScore: false, // 默认不过滤业绩为0的记录
|
||||
columnWidths: {
|
||||
team: 120 // 默认战区列宽
|
||||
},
|
||||
@@ -231,6 +232,7 @@ function createDefaultDisplayConfig() {
|
||||
showLeader: true,
|
||||
showBonus: false,
|
||||
defaultDisplayRows: 0, // 默认显示所有行
|
||||
filterZeroScore: false, // 默认不过滤业绩为0的记录
|
||||
columnWidths: {},
|
||||
columnAlignments: {
|
||||
rank: 'left',
|
||||
@@ -276,6 +278,26 @@ function mergeConfig(config1, config2) {
|
||||
// 响应式数据 - 使用ref包装导入的数据,确保响应式更新
|
||||
const individualRankings = ref(importedIndividualRankings || []);
|
||||
const teamRankings = ref(importedTeamRankings || []);
|
||||
|
||||
// 计算属性 - 过滤后的个人排名数据
|
||||
const filteredIndividualRankings = computed(() => {
|
||||
let filtered = individualRankings.value;
|
||||
// 如果配置了过滤业绩为0的记录
|
||||
if (localDisplayConfig.value?.individual?.filterZeroScore) {
|
||||
filtered = filtered.filter(item => item.score > 0);
|
||||
}
|
||||
return filtered;
|
||||
});
|
||||
|
||||
// 计算属性 - 过滤后的战区排名数据
|
||||
const filteredTeamRankings = computed(() => {
|
||||
let filtered = teamRankings.value;
|
||||
// 如果配置了过滤业绩为0的记录
|
||||
if (localDisplayConfig.value?.team?.filterZeroScore) {
|
||||
filtered = filtered.filter(item => item.totalScore > 0);
|
||||
}
|
||||
return filtered;
|
||||
});
|
||||
// 确保即使displayConfig存在,也要和默认配置合并,保证结构完整性
|
||||
const localDisplayConfig = ref(() => {
|
||||
if (displayConfig) {
|
||||
|
||||
Reference in New Issue
Block a user