refactor: 移除用户应用相关代码和资源文件

清理未使用的用户应用代码、资源文件和配置
更新管理后台的路由和国际化配置
This commit is contained in:
2026-01-16 18:02:48 +08:00
parent b7ec446f19
commit 77315b36ed
209 changed files with 86 additions and 13988 deletions

View File

@ -0,0 +1,19 @@
<script setup lang="ts">
import { NButton, NSpace } from 'naive-ui'
</script>
<template>
<div class="competition-add">
<NSpace vertical>
<NButton type="primary">
Add Competition
</NButton>
</NSpace>
</div>
</template>
<style scoped lang="scss">
.competition-add {
padding: 20px;
}
</style>

View File

@ -0,0 +1,5 @@
<template>
<div>
<h1>dashboard_detail</h1>
</div>
</template>

View File

@ -0,0 +1,55 @@
<script setup lang="ts">
import { NButton, NGi, NGrid, NSpace } from 'naive-ui'
import { computed } from 'vue'
import { useAppStore } from '@/store/modules/app'
import CompetitionCard from './modules/competition-card.vue'
import { competitionList } from './modules/data'
// 引入 store 用于判断移动端布局 (与你提供的风格保持一致)
const appStore = useAppStore()
const gap = computed(() => (appStore.isMobile ? 12 : 16))
// 模拟新增操作
function handleAdd() {
window.$message?.success('点击了新增比赛活动')
}
</script>
<template>
<NSpace vertical :size="24">
<!-- 顶部 Header 区域 -->
<div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h2 class="m-0 text-xl text-gray-800 font-bold dark:text-white">
比赛列表
</h2>
<p class="mt-1 text-sm text-gray-500">
管理并配置所有阅读大比拼活动
</p>
</div>
<NButton type="primary" size="medium" class="px-6 font-medium" @click="handleAdd">
<template #icon>
<div class="i-carbon-add text-lg" />
</template>
新增比赛活动
</NButton>
</div>
<!-- 卡片列表区域 -->
<!-- 响应式布局手机1列平板2列中屏3列大屏4列 -->
<NGrid :x-gap="gap" :y-gap="gap" responsive="screen" item-responsive>
<NGi
v-for="item in competitionList"
:key="item.id"
span="24 s:12 m:8 l:6"
>
<CompetitionCard :item="item" />
</NGi>
</NGrid>
</NSpace>
</template>
<style scoped>
/* 针对不同屏幕微调间距 */
</style>

View File

@ -0,0 +1,84 @@
<script setup lang="ts">
import type { CompetitionItem } from './data'
import { NButton, NCard, NTag } from 'naive-ui'
import { computed } from 'vue'
interface Props {
item: CompetitionItem
}
const props = defineProps<Props>()
// 状态配置:颜色和文本
const statusConfig = computed(() => {
if (props.item.status === 'ongoing') {
return { type: 'success', text: '进行中', bgClass: 'bg-green-100 text-green-600' }
}
return { type: 'default', text: '未开始', bgClass: 'bg-gray-100 text-gray-500' }
})
// 处理标题换行
const formattedTitle = computed(() => props.item.title.replace(/\n/g, '<br/>'))
</script>
<template>
<NCard
:bordered="false"
class="group relative h-full overflow-hidden rounded-2xl transition-all duration-300 hover:shadow-lg"
content-style="padding: 24px; display: flex; flex-direction: column; height: 100%;"
>
<!-- 特殊背景装饰 (仅高亮卡片显示) -->
<div
v-if="item.isHighlight"
class="pointer-events-none absolute right-0 top-0 z-0 h-32 w-32 rounded-bl-full bg-blue-50/80 -mr-8 -mt-8"
/>
<div class="relative z-10 h-full flex flex-col justify-between">
<!-- 顶部内容 -->
<div>
<!-- 状态标签 -->
<div class="mb-4">
<NTag
:bordered="false"
size="small"
round
class="px-3 font-medium" :class="[statusConfig.bgClass]"
>
{{ statusConfig.text }}
</NTag>
</div>
<!-- 标题 -->
<h3
class="mb-3 min-h-[3rem] text-lg text-gray-800 font-bold leading-tight dark:text-white"
v-html="formattedTitle"
/>
<!-- 日期 -->
<div class="mb-6 flex items-center text-sm text-gray-400">
<div class="i-carbon-calendar mr-2 text-base" />
<span>{{ item.date }}</span>
</div>
</div>
<!-- 底部内容 -->
<div class="flex items-center justify-between border-t border-gray-50 pt-4 dark:border-gray-800">
<span class="text-xs text-gray-500 font-medium">
{{ item.teamCount }} 支参赛队伍
</span>
<NButton
text
type="primary"
size="small"
class="font-bold hover:underline"
>
查看配置详情
</NButton>
</div>
</div>
</NCard>
</template>
<style scoped>
/* 可选:微调样式 */
</style>

View File

@ -0,0 +1,70 @@
// src/views/competition/modules/data.ts
export interface CompetitionItem {
id: string
title: string
date: string
teamCount: number
status: 'ongoing' | 'pending' // ongoing: 进行中, pending: 未开始
isHighlight?: boolean // 用于标记第一个卡片的特殊背景
}
export const competitionList: CompetitionItem[] = [
{
id: '1',
title: '阅读之星大赛\n辞海遨游环节', // 使用换行符或在组件中处理换行
date: '2026.01.12',
teamCount: 40,
status: 'ongoing',
isHighlight: true,
},
{
id: '2',
title: '诗词大会总决赛',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '3',
title: '趣味百科大作战',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '4',
title: '经典文学研读周',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '5',
title: '未来科学家阅读赛',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '6',
title: '历史人文知识赛',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '7',
title: '少儿绘本创意营',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
{
id: '8',
title: '唐诗三百首挑战',
date: '2026.01.12',
teamCount: 32,
status: 'pending',
},
]