chore: 优化奖金模块的显示,去掉不需要的代码
This commit is contained in:
@@ -241,26 +241,6 @@ function createDefaultBonusRules() {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建默认英雄排名数据的函数(包含战区信息)
|
|
||||||
function createDefaultIndividualRankings() {
|
|
||||||
return [
|
|
||||||
{ id: 1, name: '张三', avatar: '🦸', score: 980, level: 'S', department: '技术部', team: '精英战区', bonus: 10000 },
|
|
||||||
{ id: 2, name: '李四', avatar: '🦹', score: 920, level: 'S', department: '市场部', team: '创新队', bonus: 8000 },
|
|
||||||
{ id: 3, name: '王五', avatar: '👨', score: 880, level: 'A', department: '销售部', team: '精英战区', bonus: 5000 },
|
|
||||||
{ id: 4, name: '赵六', avatar: '👩', score: 850, level: 'A', department: '运营部', team: '创新队', bonus: 3000 },
|
|
||||||
{ id: 5, name: '钱七', avatar: '🧑', score: 820, level: 'A', department: '技术部', team: '冠军队', bonus: 3000 }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建默认战区排名数据的函数
|
|
||||||
function createDefaultTeamRankings() {
|
|
||||||
return [
|
|
||||||
{ id: 1, name: '精英战区', totalScore: 3650, memberCount: 8, leader: '张三', bonus: 50000 },
|
|
||||||
{ id: 2, name: '创新队', totalScore: 3200, memberCount: 6, leader: '李四', bonus: 30000 },
|
|
||||||
{ id: 3, name: '冠军队', totalScore: 2800, memberCount: 5, leader: '赵六', bonus: 20000 }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化默认显示配置
|
// 初始化默认显示配置
|
||||||
const defaultDisplayConfig = createDefaultDisplayConfig();
|
const defaultDisplayConfig = createDefaultDisplayConfig();
|
||||||
|
|
||||||
@@ -437,20 +417,6 @@ const drumsPosition = ref({ x: 20, y: 20 });
|
|||||||
// 奖金设置模块位置状态 - 使用reactive存储实际定位值
|
// 奖金设置模块位置状态 - 使用reactive存储实际定位值
|
||||||
const bonusPosition = reactive({ x: 'auto', y: 'auto' });
|
const bonusPosition = reactive({ x: 'auto', y: 'auto' });
|
||||||
|
|
||||||
// 初始化奖金模块位置
|
|
||||||
onMounted(() => {
|
|
||||||
// 等待DOM渲染完成后再设置位置
|
|
||||||
setTimeout(() => {
|
|
||||||
const bonusElement = document.querySelector('.bonus-section');
|
|
||||||
if (bonusElement) {
|
|
||||||
// 应用默认位置(左上角)
|
|
||||||
bonusElement.style.top = '260px';
|
|
||||||
bonusElement.style.left = '240px';
|
|
||||||
bonusElement.style.right = 'auto';
|
|
||||||
bonusElement.style.bottom = 'auto';
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
let isDragging = false;
|
let isDragging = false;
|
||||||
let isBonusDragging = false;
|
let isBonusDragging = false;
|
||||||
let dragOffset = { x: 0, y: 0 };
|
let dragOffset = { x: 0, y: 0 };
|
||||||
@@ -825,17 +791,6 @@ onMounted(async () => {
|
|||||||
// 添加拖放相关的事件监听
|
// 添加拖放相关的事件监听
|
||||||
document.addEventListener('mousemove', drag);
|
document.addEventListener('mousemove', drag);
|
||||||
document.addEventListener('mouseup', endDrag);
|
document.addEventListener('mouseup', endDrag);
|
||||||
|
|
||||||
// 定时器位置已在模板中固定设置,无需额外初始化
|
|
||||||
|
|
||||||
const bonusElement = document.querySelector('.bonus-section');
|
|
||||||
if (bonusElement && bonusPosition.x === 'auto' && bonusPosition.y === 'auto') {
|
|
||||||
// 确保奖金模块在右下角
|
|
||||||
bonusElement.style.right = '20px';
|
|
||||||
bonusElement.style.bottom = '20px';
|
|
||||||
bonusElement.style.left = 'auto';
|
|
||||||
bonusElement.style.top = 'auto';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 监听结束时间变化(在真实环境中,可能需要通过props或store来监听)
|
// 监听结束时间变化(在真实环境中,可能需要通过props或store来监听)
|
||||||
@@ -957,8 +912,8 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
.bonus-section {
|
.bonus-section {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 20px;
|
top: 360px;
|
||||||
left: 20px;
|
left: 320px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
transition: transform 0.2s ease;
|
transition: transform 0.2s ease;
|
||||||
@@ -1309,72 +1264,6 @@ onUnmounted(() => {
|
|||||||
to { transform: translateY(-10px); }
|
to { transform: translateY(-10px); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 奖金设置部分(浮动布局) */
|
|
||||||
.bonus-section {
|
|
||||||
position: fixed;
|
|
||||||
top: 20px;
|
|
||||||
left: 20px;
|
|
||||||
z-index: 100;
|
|
||||||
cursor: move;
|
|
||||||
transition: transform 0.2s ease;
|
|
||||||
padding: 15px;
|
|
||||||
/* border-radius: 20px; */
|
|
||||||
/* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); */
|
|
||||||
/* background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(250, 245, 240, 0.95)); */
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bonus-section h2 {
|
|
||||||
color: #d63031;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bonus-rules-row {
|
|
||||||
display: flex;
|
|
||||||
gap: 30px;
|
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bonus-rule-item {
|
|
||||||
background: rgba(255, 255, 255, 0.8);
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-radius: 12px;
|
|
||||||
border-left: 5px solid #e17055;
|
|
||||||
flex: 1;
|
|
||||||
min-width: 220px;
|
|
||||||
max-width: 100%;
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bonus-rule-item:hover {
|
|
||||||
transform: translateY(-5px);
|
|
||||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rule-header {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #d63031;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rule-details p {
|
|
||||||
margin: 3px 0;
|
|
||||||
font-size: 1rem;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: normal;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 按钮样式 */
|
/* 按钮样式 */
|
||||||
.btn-game-secondary {
|
.btn-game-secondary {
|
||||||
background: linear-gradient(45deg, #6c5ce7, #a29bfe);
|
background: linear-gradient(45deg, #6c5ce7, #a29bfe);
|
||||||
|
|||||||
Reference in New Issue
Block a user