修改目录

This commit is contained in:
2025-05-17 16:18:36 +08:00
parent 8e052811e3
commit 6bacf24d12
33 changed files with 1851 additions and 12787 deletions

11
src/views/backend.vue Normal file
View File

@@ -0,0 +1,11 @@
<script setup>
</script>
<template>
<router-view></router-view>
</template>
<style scoped>
</style>

176
src/views/backend/Login.vue Normal file
View File

@@ -0,0 +1,176 @@
<template>
<div class="login-container">
<div class="bg-container">
<img :src="bgImg" alt="登录背景" />
</div>
<div class="bottom-text">
<p>© Byz解忧杂货铺</p>
</div>
<div class="content-container">
<div class="login-right">
<button class="back-btn" @click="handleBack" title="返回主界面">
返回主界面
</button>
<LoginModule v-if="!showRegister" @register="showRegister = true" />
<RegisterModule v-else @login="showRegister = false" />
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import loginBg from '@/assets/login_1.jpg'
import loginBg1 from '@/assets/login_2.jpg'
import loginBg3 from '@/assets/login_3.jpg'
import LoginModule from '@/components/login_module.vue'
import RegisterModule from '@/components/register_module.vue'
const images = [loginBg, loginBg1,loginBg3]
const randomIndex = Math.floor(Math.random() * images.length)
const bgImg = ref(images[randomIndex])
const router = useRouter()
const showRegister = ref(false)
const handleBack = () => {
router.push('/')
}
</script>
<style scoped>
.login-container {
width: 100vw;
height: 100vh;
position: relative;
overflow: hidden;
}
.bg-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.bg-container img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: left;
}
.content-container {
position: absolute;
top: 0;
right: 0;
width: 25%;
min-width: 320px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
}
.login-right {
position: relative;
width: 100%;
height: calc(100vh - 120px);
margin: 0;
background: linear-gradient(135deg, #afe9ef 0%, #a0c4ff 100%);
border-radius: 16px 0 0 20px;
box-shadow: -8px 0 25px rgba(0, 0, 0, 0.51);
display: flex;
align-items: center;
justify-content: center;
}
.back-btn {
position: absolute;
top: 18px;
left: 28px;
background: #e6f7ff;
color: #409eff;
border: none;
border-radius: 18px;
padding: 6px 18px 6px 14px;
font-size: 15px;
font-weight: 500;
box-shadow: 0 2px 8px rgba(64,158,255,0.10);
cursor: pointer;
transition: background 0.2s, color 0.2s;
z-index: 10;
display: flex;
align-items: center;
gap: 4px;
}
.back-btn:hover {
background: #b3e5fc;
color: #1976d2;
}
@media (max-width: 900px) {
.content-container {
width: 40%;
min-width: 220px;
}
.login-right {
}
.login-form {
max-width: 220px;
}
}
@media (max-width: 600px) {
.content-container {
width: 100%;
min-width: 0;
left: 0;
right: 0;
}
.login-right {
border-radius: 0;
margin: 0;
height: 100vh;
min-width: 0;
max-width: 100vw;
box-shadow: none;
background: linear-gradient(135deg, #afe9ef 0%, #b6d0ff 100%);
}
.login-form {
width: 96%;
min-width: 0;
max-width: 100vw;
}
.back-btn {
display: none;
}
}
.bottom-text {
position: absolute;
left: 24px;
bottom: 24px;
z-index: 2;
color: #fff;
font-size: 16px;
font-weight: 300;
letter-spacing: 1px;
text-shadow: 0 2px 8px rgba(0,0,0,0.25);
background: rgba(0, 0, 0, 0.18);
border-radius: 8px;
padding: 6px 18px;
box-shadow: 0 2px 8px rgba(0,0,0,0.10);
user-select: none;
transition: background 0.3s;
}
.bottom-text p {
margin: 0;
opacity: 0.92;
}
</style>

262
src/views/index.vue Normal file
View File

@@ -0,0 +1,262 @@
<script setup lang="ts">
</script>
<template>
<div class="app">
<nav class="navbar">
<div class="nav-container">
<div class="nav-left">
<div class="nav-brand">红色警戒3数据分析中心</div>
<router-link to="/maps" class="nav-link">最近上传地图</router-link>
<router-link to="/weekly" class="nav-link">热门下载地图</router-link>
<router-link to="/weapon-match" class="nav-link">Weapon 匹配</router-link>
<router-link to="/competition" class="nav-link">赛程信息</router-link>
<router-link to="/demands" class="nav-link">办事大厅</router-link>
</div>
<div class="nav-right">
<router-link to="/backend/login" class="nav-link login-btn">
<i class="fas fa-user"></i>
管理登录
</router-link>
</div>
</div>
</nav>
<main class="main-content">
<router-view></router-view>
</main>
<footer class="footer">
<div class="footer-bottom">
<p>Byz解忧杂货铺</p>
</div>
</footer>
</div>
</template>
<style scoped>
.app {
min-height: 100vh;
display: flex;
flex-direction: column;
overflow-x: hidden;
width: 100%;
}
.main-content {
margin-top: 60px;
padding: 20px;
flex: 1;
max-width: 1400px;
width: 100%;
margin-left: auto;
margin-right: auto;
margin-bottom: 0;
}
.footer {
background: linear-gradient(135deg, #416bdf 0%, #71eaeb 100%);
color: white;
padding: 2rem 0;
margin: 0;
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.navbar {
background: linear-gradient(135deg, #71eaeb 0%, #416bdf 100%);
padding: 0;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}
.nav-left {
display: flex;
align-items: center;
gap: 30px;
}
.nav-right {
display: flex;
align-items: center;
}
.nav-brand {
color: white;
font-size: 1.5rem;
font-weight: 600;
text-decoration: none;
white-space: nowrap;
}
.nav-link {
color: rgba(255, 255, 255, 0.9);
text-decoration: none;
padding: 8px 16px;
border-radius: 6px;
transition: all 0.3s ease;
font-weight: 500;
position: relative;
}
.nav-link:hover {
background-color: rgba(255, 255, 255, 0.1);
color: white;
}
.router-link-active {
background-color: rgba(255, 255, 255, 0.2);
color: white;
}
.router-link-exact-active {
background-color: rgba(255, 255, 255, 0.2);
color: white;
}
.login-btn {
display: flex;
align-items: center;
gap: 6px;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
padding: 8px 16px;
border-radius: 20px;
transition: all 0.3s ease;
}
.login-btn:hover {
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3);
transform: translateY(-1px);
}
.login-btn i {
font-size: 14px;
}
/* 响应式设计 */
@media (max-width: 768px) {
.nav-container {
padding: 0 15px;
}
.nav-left {
gap: 15px;
}
.nav-brand {
font-size: 1.2rem;
}
.nav-link {
padding: 6px 12px;
}
.login-btn {
padding: 6px 12px;
}
.main-content {
padding: 15px;
}
}
.footer-content {
max-width: 1200px;
margin: 0 auto;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
width: 100%;
padding: 0 2rem;
}
.footer-section {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.footer-section h3 {
font-size: 1.25rem;
font-weight: 600;
color: white;
margin-bottom: 1rem;
position: relative;
}
.footer-section h3::after {
content: '';
position: absolute;
bottom: -0.5rem;
left: 0;
width: 2rem;
height: 2px;
background: rgba(255, 255, 255, 0.3);
}
.footer-section p {
color: rgba(255, 255, 255, 0.9);
font-size: 0.95rem;
line-height: 1.6;
margin: 0;
}
.footer-bottom {
width: 100%;
max-width: 1200px;
text-align: center;
margin-top: 2rem;
padding-top: 1.5rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-bottom p {
color: rgba(255, 255, 255, 0.8);
font-size: 0.9rem;
margin: 0;
}
@media (max-width: 768px) {
.footer {
padding: 1.5rem 1rem;
}
.footer-content {
grid-template-columns: 1fr;
gap: 1.5rem;
}
.footer-section h3 {
font-size: 1.1rem;
}
.footer-bottom {
margin-top: 1.5rem;
padding-top: 1rem;
}
}
</style>

View File

@@ -0,0 +1,193 @@
<template>
<div class="demand-hall">
<div class="page-header">
<h1>赛程信息</h1>
<div class="header-subtitle">
<span class="date-range">点击即可查看和报名</span>
</div>
</div>
<div class="action-buttons">
<button class="btn-common btn-gradient btn-margin-right" @click="addNewCompetition">添加赛程</button>
<button class="btn-common btn-light" @click="refreshCompetitions">刷新赛程</button>
</div>
<div class="table-container">
<table class="maps-table">
<thead>
<tr>
<th>序号</th>
<th>赛程名称</th>
<th>比赛时间</th>
<th>是否结赛</th>
<th>主办人</th>
<th>联系方式</th>
<th>比赛方式</th>
<th>比赛类型</th>
</tr>
</thead>
<tbody>
<tr v-for="(competition, index) in competitions"
:key="competition.id"
@click="handleCompetitionClick(competition)"
class="competition-row">
<td>{{ index + 1 }}</td>
<td>{{ competition.name }}</td>
<td>{{ competition.time }}</td>
<td>
<span :class="['status-tag', competition.isFinished ? 'finished' : 'ongoing']">
{{ competition.isFinished ? '已结束' : '进行中' }}
</span>
</td>
<td>{{ competition.organizer }}</td>
<td>{{ competition.contact }}</td>
<td>{{ competition.mode }}</td>
<td>{{ competition.type }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
// 模拟赛程数据
const competitions = ref([
{
id: 1,
name: '单淘汰赛',
time: '2024-04-01 14:00',
isFinished: false,
organizer: '赵六',
contact: '13600136000',
mode: '单阶段',
type: '单淘汰'
}
])
// 处理赛程点击事件
const handleCompetitionClick = (competition) => {
router.push({
path: `/competition/${competition.id}`,
query: {
name: competition.name,
time: competition.time,
organizer: competition.organizer,
contact: competition.contact,
mode: competition.mode,
type: competition.type
}
})
}
// 刷新赛程数据
const refreshCompetitions = () => {
// 这里可以添加实际的API调用
console.log('刷新赛程数据')
}
// 添加新赛程
const addNewCompetition = () => {
// 这里可以添加跳转到添加赛程页面的逻辑
console.log('添加新赛程')
}
</script>
<style scoped>
.btn-common {
display: inline-block;
padding: 8px 22px;
font-size: 15px;
font-weight: 500;
border-radius: 6px;
border: 1px solid #b6d2ff;
cursor: pointer;
transition: background 0.2s, color 0.2s, border 0.2s;
outline: none;
box-shadow: none;
margin-bottom: 20px;
}
.btn-gradient {
background: linear-gradient(90deg, #71eaeb 0%, #416bdf 100%);
color: #fff;
border: 1px solid #71eaeb;
}
.btn-gradient:hover {
background: linear-gradient(90deg, #416bdf 0%, #71eaeb 100%);
color: #fff;
border: 1.5px solid #416bdf;
}
.btn-light {
background: linear-gradient(90deg, #e3f0ff 0%, #f7fbff 100%);
color: #2563eb;
border: 1px solid #b6d2ff;
}
.btn-light:hover {
background: linear-gradient(90deg, #d0e7ff 0%, #eaf4ff 100%);
color: #174ea6;
border: 1.5px solid #2563eb;
}
/* 按钮间距 */
.btn-margin-right {
margin-right: 16px;
}
.action-buttons {
margin-bottom: 20px;
}
.competition-row {
cursor: pointer;
transition: background-color 0.2s;
}
.competition-row:hover {
background-color: #f5f7fa;
}
.status-tag {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
}
.status-tag.ongoing {
background-color: #e1f3d8;
color: #67c23a;
}
.status-tag.finished {
background-color: #f4f4f5;
color: #909399;
}
.maps-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.maps-table th,
.maps-table td {
padding: 12px 16px;
text-align: left;
border-bottom: 1px solid #e4e7ed;
}
.maps-table th {
background-color: #f5f7fa;
color: #606266;
font-weight: 500;
}
.maps-table tbody tr:last-child td {
border-bottom: none;
}
</style>

View File

@@ -0,0 +1,216 @@
<template>
<div class="competition-detail">
<div class="page-header">
<div class="header-top">
<button class="back-button" @click="handleBack">
<i class="back-icon"></i>
返回列表
</button>
<h1>{{ competition.name }}</h1>
</div>
<div class="header-subtitle">
<span class="date-range">{{ competition.time }}</span>
</div>
</div>
<div class="tournament-container">
<div class="tournament-info">
<div class="info-item">
<span class="label">主办人</span>
<span class="value">{{ competition.organizer }}</span>
</div>
<div class="info-item">
<span class="label">联系方式</span>
<span class="value">{{ competition.contact }}</span>
</div>
<div class="info-item">
<span class="label">比赛方式</span>
<span class="value">{{ competition.mode }}</span>
</div>
<div class="info-item">
<span class="label">比赛类型</span>
<span class="value">{{ competition.type }}</span>
</div>
</div>
<!-- 单淘汰赛展示 -->
<div v-if="competition.type === '单淘汰'" class="tournament-bracket-container">
<div class="section-title">赛事对阵图</div>
<div class="bracket-wrapper">
<TournamentBracket
:rounds="tournamentRounds"
/>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import TournamentBracket from '@/components/TournamentBracket.vue'
const route = useRoute()
const router = useRouter()
const competition = ref({
name: route.query.name || '',
time: route.query.time || '',
organizer: route.query.organizer || '',
contact: route.query.contact || '',
mode: route.query.mode || '',
type: route.query.type || ''
})
// 单淘汰赛数据
const tournamentRounds = ref([
// 半决赛
{
games: [
{
player1: { id: "1", name: "战队 Alpha", score: 2, winner: true },
player2: { id: "2", name: "战队 Beta", score: 1, winner: false }
},
{
player1: { id: "3", name: "战队 Gamma", score: 0, winner: false },
player2: { id: "4", name: "战队 Delta", score: 2, winner: true }
}
]
},
// 决赛
{
games: [
{
player1: { id: "1", name: "战队 Alpha", score: 3, winner: true },
player2: { id: "4", name: "战队 Delta", score: 1, winner: false }
}
]
}
])
const handleBack = () => {
router.push('/competition')
}
</script>
<style scoped>
.competition-detail {
padding: 20px;
}
.page-header {
margin-bottom: 30px;
}
.page-header h1 {
font-size: 24px;
color: #333;
margin-bottom: 8px;
}
.header-subtitle {
color: #666;
}
.tournament-container {
display: flex;
flex-direction: column;
gap: 30px;
}
.tournament-info {
background: #f5f7fa;
padding: 20px;
border-radius: 8px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
}
.info-item {
display: flex;
align-items: center;
gap: 8px;
}
.info-item .label {
color: #666;
font-weight: 500;
}
.info-item .value {
color: #333;
}
.header-top {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 8px;
}
.back-button {
display: flex;
align-items: center;
gap: 4px;
padding: 8px 16px;
background: #f5f7fa;
border: 1px solid #dcdfe6;
border-radius: 4px;
color: #606266;
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
}
.back-button:hover {
background: #e6e8eb;
color: #409eff;
border-color: #c6e2ff;
}
.back-icon {
font-size: 16px;
line-height: 1;
}
@media (max-width: 768px) {
.tournament-info {
grid-template-columns: 1fr;
}
}
.tournament-bracket-container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
padding: 20px;
margin-top: 20px;
}
.section-title {
font-size: 18px;
font-weight: bold;
color: #2c3e50;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid #ebeef5;
}
.bracket-wrapper {
overflow-x: auto;
padding: 20px 0;
}
@media (max-width: 768px) {
.tournament-bracket-container {
padding: 15px;
}
.section-title {
font-size: 16px;
margin-bottom: 15px;
}
}
</style>

View File

@@ -42,7 +42,7 @@
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { getMapDetail } from '../api/maps'
import { getMapDetail } from '../../api/maps.js'
const route = useRoute()
const router = useRouter()

View File

@@ -114,9 +114,9 @@
<script setup>
import { ref, computed, onMounted, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { getMaps, getAllTags } from '../api/maps'
import '../assets/styles/common.css'
import '../assets/styles/Maps.css'
import { getMaps, getAllTags } from '../../api/maps.js'
import '../../assets/styles/common.css'
import '../../assets/styles/Maps.css'
const router = useRouter()
const maps = ref([])

View File

@@ -49,9 +49,9 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { getWeeklyTopMaps } from '../api/maps'
import '../assets/styles/common.css'
import '../assets/styles/WeeklyRecommend.css'
import { getWeeklyTopMaps } from '../../api/maps.js'
import '../../assets/styles/common.css'
import '../../assets/styles/WeeklyRecommend.css'
const router = useRouter()
const recommendedMaps = ref([])