提交 050a286a authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 91aa5bac
...@@ -41,7 +41,9 @@ function handleTop(data: CourseListItemType) { ...@@ -41,7 +41,9 @@ function handleTop(data: CourseListItemType) {
<el-tooltip :content="!!data.is_top ? '取消置顶' : '置顶'"> <el-tooltip :content="!!data.is_top ? '取消置顶' : '置顶'">
<div class="course-item__top" :class="{ 'is-active': !!data.is_top }" @click="handleTop(data)"></div> <div class="course-item__top" :class="{ 'is-active': !!data.is_top }" @click="handleTop(data)"></div>
</el-tooltip> </el-tooltip>
<router-link :to="`/course/view?course_id=${data.course_id}&semester_id=${data.semester_id}`"> <router-link
:to="`/course/view?course_id=${data.course_id}&semester_id=${data.semester_id}&chapter_id=${data.section?.chapter_id}&section_id=${data.section?.section_id}&resource_id=${data.section?.resource_id}`"
>
<div class="course-item-bd"> <div class="course-item-bd">
<div class="course-item-pic"> <div class="course-item-pic">
<img :src="data.cover" /><span class="course-item__type">{{ electiveTypeText }}</span> <img :src="data.cover" /><span class="course-item__type">{{ electiveTypeText }}</span>
......
...@@ -93,7 +93,7 @@ onMounted(() => { ...@@ -93,7 +93,7 @@ onMounted(() => {
<el-table-column prop="watch_video_length" label="学习时长" width="180" align="center" /> <el-table-column prop="watch_video_length" label="学习时长" width="180" align="center" />
<el-table-column prop="name" label="百分比" width="180" align="center"> <el-table-column prop="name" label="百分比" width="180" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-progress :percentage="row.schedule" /> <el-progress :percentage="parseFloat(row.schedule)" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -11,6 +11,20 @@ let chapterList = $ref<CourseChapterType[]>([]) ...@@ -11,6 +11,20 @@ let chapterList = $ref<CourseChapterType[]>([])
const { query } = useRoute() const { query } = useRoute()
const courseId = $ref(query.course_id as string) const courseId = $ref(query.course_id as string)
const semesterId = $ref(query.semester_id as string) const semesterId = $ref(query.semester_id as string)
const chapterId = $ref(query.chapter_id as string)
const sectionId = $ref(query.section_id as string)
// 章
const chapterIds = $ref<string[]>([])
if (chapterId) {
chapterIds.push(chapterId)
}
// 节
const sectionIds = $ref<string[]>([])
if (sectionId) {
sectionIds.push(sectionId)
}
// 获取章节列表 // 获取章节列表
function fetchList() { function fetchList() {
if (!courseId || !semesterId) { if (!courseId || !semesterId) {
...@@ -69,10 +83,10 @@ function targetUrl(resource: CourseResourceType, section: CourseSectionType, cha ...@@ -69,10 +83,10 @@ function targetUrl(resource: CourseResourceType, section: CourseSectionType, cha
} }
</script> </script>
<template> <template>
<el-collapse class="course-chapters"> <el-collapse class="course-chapters" v-model="chapterIds">
<el-collapse-item :name="item.id" v-for="item in chapterList" :key="item.id"> <el-collapse-item :name="item.id" v-for="item in chapterList" :key="item.id">
<template #title><i class="icon-chapter"></i>{{ item.name }}</template> <template #title><i class="icon-chapter"></i>{{ item.name }}</template>
<el-collapse class="course-sections"> <el-collapse class="course-sections" v-model="sectionIds">
<el-collapse-item :name="section.id" v-for="section in item.sections" :key="section.id"> <el-collapse-item :name="section.id" v-for="section in item.sections" :key="section.id">
<template #title><i class="icon-chapter"></i>{{ section.name }}</template> <template #title><i class="icon-chapter"></i>{{ section.name }}</template>
<ul> <ul>
......
...@@ -45,6 +45,9 @@ const update = () => { ...@@ -45,6 +45,9 @@ const update = () => {
<el-form-item label="上传附件" prop="files"> <el-form-item label="上传附件" prop="files">
<AppUpload v-model="form.files"> <AppUpload v-model="form.files">
<el-button round>点击上传</el-button> <el-button round>点击上传</el-button>
<template #tip>
(可以上传 word、ppt、png、jpg、zip、rar等资源,多文件请先压缩打包成一个文件后,再上传)
</template>
<p>{{ form.files }}</p> <p>{{ form.files }}</p>
</AppUpload> </AppUpload>
</el-form-item> </el-form-item>
......
...@@ -43,10 +43,12 @@ const update = () => { ...@@ -43,10 +43,12 @@ const update = () => {
style="width: 360px" style="width: 360px"
> >
<el-form-item label="昵称" prop="real_name"> <el-form-item label="昵称" prop="real_name">
<el-input v-model="form.real_name" /> <el-input v-model="form.real_name" maxlength="10" />
</el-form-item> </el-form-item>
<el-form-item label="头像" prop="avatar"> <el-form-item label="头像" prop="avatar">
<AppUpload v-model="form.avatar"></AppUpload> <AppUpload v-model="form.avatar" accept="image/*">
<template #tip>支持png,jpg,jpep图片格式,最大为2MB</template>
</AppUpload>
</el-form-item> </el-form-item>
<el-form-item label="性别" prop="gender"> <el-form-item label="性别" prop="gender">
<el-radio-group v-model="form.gender" class="ml-4"> <el-radio-group v-model="form.gender" class="ml-4">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论