路由更新
This commit is contained in:
227
schoolNewsWeb/src/views/study-plan/CourseCenterView.vue
Normal file
227
schoolNewsWeb/src/views/study-plan/CourseCenterView.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div class="course-center">
|
||||
<div class="course-header">
|
||||
<h2>课程中心</h2>
|
||||
<div class="course-categories">
|
||||
<div
|
||||
class="category-tab"
|
||||
v-for="category in categories"
|
||||
:key="category.id"
|
||||
:class="{ active: activeCategory === category.id }"
|
||||
@click="activeCategory = category.id"
|
||||
>
|
||||
{{ category.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-grid">
|
||||
<div class="course-card" v-for="course in filteredCourses" :key="course.id" @click="viewCourse(course)">
|
||||
<div class="course-cover">
|
||||
<img :src="course.cover" :alt="course.title" />
|
||||
<div class="course-duration">{{ course.duration }}</div>
|
||||
</div>
|
||||
<div class="course-info">
|
||||
<h3>{{ course.title }}</h3>
|
||||
<p class="course-description">{{ course.description }}</p>
|
||||
<div class="course-meta">
|
||||
<span class="course-teacher">
|
||||
<i class="icon">👨🏫</i>
|
||||
{{ course.teacher }}
|
||||
</span>
|
||||
<span class="course-students">
|
||||
<i class="icon">👥</i>
|
||||
{{ course.students }} 人学习
|
||||
</span>
|
||||
</div>
|
||||
<div class="course-footer">
|
||||
<div class="course-rating">
|
||||
<span class="rating-stars">★★★★★</span>
|
||||
<span class="rating-score">{{ course.rating }}</span>
|
||||
</div>
|
||||
<el-button type="primary" size="small">开始学习</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElButton } from 'element-plus';
|
||||
|
||||
const router = useRouter();
|
||||
const activeCategory = ref('all');
|
||||
const courses = ref<any[]>([]);
|
||||
|
||||
const categories = [
|
||||
{ id: 'all', name: '全部课程' },
|
||||
{ id: 'party-history', name: '党史教育' },
|
||||
{ id: 'theory', name: '理论学习' },
|
||||
{ id: 'policy', name: '政策解读' },
|
||||
{ id: 'ethics', name: '道德修养' }
|
||||
];
|
||||
|
||||
const filteredCourses = computed(() => {
|
||||
if (activeCategory.value === 'all') return courses.value;
|
||||
return courses.value.filter(course => course.category === activeCategory.value);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// TODO: 加载课程数据
|
||||
});
|
||||
|
||||
function viewCourse(course: any) {
|
||||
router.push(`/study/course/${course.id}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.course-center {
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.course-header {
|
||||
margin-bottom: 32px;
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.course-categories {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.category-tab {
|
||||
padding: 8px 20px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
background: #ffe6e6;
|
||||
color: #C62828;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #C62828;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.course-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.course-card {
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
border-color: #C62828;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
}
|
||||
|
||||
.course-cover {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background: #f5f5f5;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.course-duration {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
right: 12px;
|
||||
padding: 4px 12px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.course-info {
|
||||
padding: 20px;
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
margin-bottom: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.course-description {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 16px;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.course-meta {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
|
||||
.icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.course-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.course-rating {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.rating-stars {
|
||||
color: #FFB400;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.rating-score {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
}
|
||||
</style>
|
||||
|
||||
113
schoolNewsWeb/src/views/study-plan/StudyPlanView.vue
Normal file
113
schoolNewsWeb/src/views/study-plan/StudyPlanView.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="study-plan-page">
|
||||
<div class="page-header">
|
||||
<h1>学习计划</h1>
|
||||
<p class="page-description">制定学习计划,完成学习任务,提升思政素养</p>
|
||||
</div>
|
||||
|
||||
<div class="plan-tabs">
|
||||
<div
|
||||
class="plan-tab"
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
:class="{ active: activeTab === tab.key }"
|
||||
@click="activeTab = tab.key"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="plan-content">
|
||||
<component :is="currentComponent" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import StudyTasks from './components/StudyTasks.vue';
|
||||
import CourseCenter from './components/CourseCenter.vue';
|
||||
|
||||
const activeTab = ref('tasks');
|
||||
|
||||
const tabs = [
|
||||
{ key: 'tasks', label: '学习任务' },
|
||||
{ key: 'courses', label: '课程中心' }
|
||||
];
|
||||
|
||||
const componentMap: Record<string, any> = {
|
||||
'tasks': StudyTasks,
|
||||
'courses': CourseCenter
|
||||
};
|
||||
|
||||
const currentComponent = computed(() => componentMap[activeTab.value]);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.study-plan-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f5f5;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
background: white;
|
||||
padding: 40px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
h1 {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.page-description {
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.plan-tabs {
|
||||
background: white;
|
||||
padding: 0 40px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
|
||||
.plan-tab {
|
||||
padding: 16px 24px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
position: relative;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
color: #C62828;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #C62828;
|
||||
font-weight: 600;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: #C62828;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.plan-content {
|
||||
background: white;
|
||||
border-radius: 0 0 8px 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
297
schoolNewsWeb/src/views/study-plan/StudyTasksView.vue
Normal file
297
schoolNewsWeb/src/views/study-plan/StudyTasksView.vue
Normal file
@@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div class="study-tasks">
|
||||
<!-- 任务统计 -->
|
||||
<div class="task-statistics">
|
||||
<div class="stat-card" v-for="stat in statistics" :key="stat.label">
|
||||
<div class="stat-value">{{ stat.value }}</div>
|
||||
<div class="stat-label">{{ stat.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 任务列表 -->
|
||||
<div class="task-section">
|
||||
<div class="section-header">
|
||||
<h2>任务列表</h2>
|
||||
<div class="filter-tabs">
|
||||
<div
|
||||
class="filter-tab"
|
||||
v-for="filter in filters"
|
||||
:key="filter.key"
|
||||
:class="{ active: activeFilter === filter.key }"
|
||||
@click="activeFilter = filter.key"
|
||||
>
|
||||
{{ filter.label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-list">
|
||||
<div class="task-item" v-for="task in filteredTasks" :key="task.id">
|
||||
<div class="task-icon" :class="`status-${task.status}`">
|
||||
<i :class="getTaskIcon(task.status)"></i>
|
||||
</div>
|
||||
<div class="task-content">
|
||||
<h3>{{ task.title }}</h3>
|
||||
<p class="task-description">{{ task.description }}</p>
|
||||
<div class="task-meta">
|
||||
<span class="task-type">{{ task.type }}</span>
|
||||
<span class="task-deadline">截止时间:{{ task.deadline }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-fill" :style="{ width: task.progress + '%' }"></div>
|
||||
</div>
|
||||
<span class="progress-text">{{ task.progress }}%</span>
|
||||
</div>
|
||||
<div class="task-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="goToTask(task)"
|
||||
v-if="task.status !== 'completed'"
|
||||
>
|
||||
{{ task.status === 'not-started' ? '开始学习' : '继续学习' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
@click="viewTaskDetail(task)"
|
||||
>
|
||||
查看详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElButton } from 'element-plus';
|
||||
|
||||
const router = useRouter();
|
||||
const activeFilter = ref('all');
|
||||
const tasks = ref<any[]>([]);
|
||||
|
||||
const statistics = ref([
|
||||
{ label: '总任务数', value: 0 },
|
||||
{ label: '进行中', value: 0 },
|
||||
{ label: '已完成', value: 0 },
|
||||
{ label: '完成率', value: '0%' }
|
||||
]);
|
||||
|
||||
const filters = [
|
||||
{ key: 'all', label: '全部任务' },
|
||||
{ key: 'not-started', label: '未开始' },
|
||||
{ key: 'in-progress', label: '进行中' },
|
||||
{ key: 'completed', label: '已完成' }
|
||||
];
|
||||
|
||||
const filteredTasks = computed(() => {
|
||||
if (activeFilter.value === 'all') return tasks.value;
|
||||
return tasks.value.filter(task => task.status === activeFilter.value);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// TODO: 加载学习任务数据
|
||||
});
|
||||
|
||||
function getTaskIcon(status: string) {
|
||||
const iconMap: Record<string, string> = {
|
||||
'not-started': '⭕',
|
||||
'in-progress': '⏳',
|
||||
'completed': '✅'
|
||||
};
|
||||
return iconMap[status] || '⭕';
|
||||
}
|
||||
|
||||
function goToTask(task: any) {
|
||||
router.push(`/study/task/${task.id}`);
|
||||
}
|
||||
|
||||
function viewTaskDetail(task: any) {
|
||||
router.push(`/study/task/${task.id}/detail`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.study-tasks {
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.task-statistics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
padding: 24px;
|
||||
background: linear-gradient(135deg, #C62828, #E53935);
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.task-section {
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.filter-tab {
|
||||
padding: 8px 16px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
background: #ffe6e6;
|
||||
color: #C62828;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #C62828;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.task-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.task-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
padding: 20px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
border-color: #C62828;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.task-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.status-not-started {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
&.status-in-progress {
|
||||
background: #fff3e0;
|
||||
}
|
||||
|
||||
&.status-completed {
|
||||
background: #e8f5e9;
|
||||
}
|
||||
}
|
||||
|
||||
.task-content {
|
||||
flex: 1;
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #141F38;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.task-description {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.task-meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.task-type {
|
||||
color: #C62828;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.task-deadline {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.task-progress {
|
||||
width: 150px;
|
||||
flex-shrink: 0;
|
||||
|
||||
.progress-bar {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #C62828, #E53935);
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.task-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user