web-学习管理、upload组件修改

This commit is contained in:
2025-10-21 16:21:10 +08:00
parent 3b4a639b95
commit f72a5cec61
13 changed files with 1288 additions and 127 deletions

View File

@@ -0,0 +1,53 @@
<template>
<div class="course-management">
<CourseList
v-if="currentView === 'list'"
@add="handleAdd"
@edit="handleEdit"
/>
<CourseAdd
v-else-if="currentView === 'add' || currentView === 'edit'"
:courseID="currentCourseId"
@success="handleSuccess"
@cancel="handleCancel"
/>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { CourseList, CourseAdd } from './components';
import type { Course } from '@/types/study';
type ViewType = 'list' | 'add' | 'edit';
const currentView = ref<ViewType>('list');
const currentCourseId = ref<string>();
function handleAdd() {
currentView.value = 'add';
currentCourseId.value = undefined;
}
function handleEdit(course: Course) {
currentView.value = 'edit';
currentCourseId.value = course.courseID;
}
function handleSuccess() {
currentView.value = 'list';
currentCourseId.value = undefined;
}
function handleCancel() {
currentView.value = 'list';
currentCourseId.value = undefined;
}
</script>
<style lang="scss" scoped>
.course-management {
height: 100%;
background: #f5f7fa;
}
</style>