|
|
@@ -1,15 +1,19 @@
|
|
|
<template>
|
|
|
- <div class="course-detail-page">
|
|
|
- <div class="course-detail-container" v-if="courseInfo!==null">
|
|
|
+ <el-card class="course-detail-page">
|
|
|
+ <div v-if="courseInfo!==null" class="course-detail-container">
|
|
|
<div class="header">
|
|
|
<div class="course-img">
|
|
|
- <img alt="" :src="imgUrl">
|
|
|
+ <img :src="imgUrl" alt="">
|
|
|
</div>
|
|
|
<div class="course-info">
|
|
|
- <el-row>课程名称:{{ courseInfo.name }}</el-row>
|
|
|
- <el-row>教师:{{ courseInfo.teacher.name }}</el-row>
|
|
|
- <el-row>学期:{{ courseInfo.semester }}</el-row>
|
|
|
- <el-row>时间:{{ timestampToTime(courseInfo.startTime) }} 至 {{ timestampToTime(courseInfo.endTime) }}</el-row>
|
|
|
+ <el-row style="font-size: xx-large; font-weight: bold">
|
|
|
+ {{ courseInfo.name === undefined ? "空白课程" : courseInfo.name }}
|
|
|
+ </el-row>
|
|
|
+ <div class="course-info-main">
|
|
|
+ <el-row>教师:{{ courseInfo.teacher.name }}</el-row>
|
|
|
+ <el-row>学期:{{ courseInfo.semester }}</el-row>
|
|
|
+ <el-row>时间:{{ timestampToTime(courseInfo.startTime) }} 至 {{ timestampToTime(courseInfo.endTime) }}</el-row>
|
|
|
+ </div>
|
|
|
<el-row class="mooc-link">
|
|
|
MOOC链接:
|
|
|
<el-link v-if="courseInfo.moocUrl!==null" :href="courseInfo.moocUrl" target="_blank">点击此处<i
|
|
|
@@ -17,8 +21,8 @@
|
|
|
<span v-else>无</span>
|
|
|
</el-row>
|
|
|
<el-row v-if="isStudent">
|
|
|
- <el-button size="mini" :disabled="isCourseSelected" @click="handleSelectCourse">
|
|
|
- {{ isCourseSelected ? "已选课" : "立即选课" }}
|
|
|
+ <el-button :disabled="isCourseSelected" size="mini" @click="handleSelectCourse">
|
|
|
+ {{ isCourseSelected ? "已选课" : "确认选课" }}
|
|
|
</el-button>
|
|
|
<el-button v-if="isCourseSelected" size="mini" type="danger" @click="handleDropCourse">
|
|
|
退课
|
|
|
@@ -36,15 +40,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-divider></el-divider>
|
|
|
+ <el-divider v-if="isCourseSelected"/>
|
|
|
|
|
|
- <div class="course-tabs">
|
|
|
+ <div v-if="isCourseSelected" class="course-tabs">
|
|
|
<el-radio-group v-model="tabName" size="large">
|
|
|
<el-radio-button label="tasks">任务时间轴</el-radio-button>
|
|
|
<el-radio-button label="notice">通知栏</el-radio-button>
|
|
|
<el-radio-button label="courseware">课件列表</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- <div v-if="true">
|
|
|
+ <div>
|
|
|
<el-popover v-if="isTeacher && tabName==='notice'"
|
|
|
v-model:visible="noticePopover"
|
|
|
:width="160"
|
|
|
@@ -54,7 +58,7 @@
|
|
|
公告
|
|
|
</div>
|
|
|
<div class="notice-type-txt">
|
|
|
- <el-link type="success" href="javascript:void(0);" @click="selAndInitAnnouncement('announcement')">发布公告
|
|
|
+ <el-link href="javascript:void(0);" type="success" @click="selAndInitAnnouncement('announcement')">发布公告
|
|
|
</el-link>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
@@ -63,7 +67,7 @@
|
|
|
作业
|
|
|
</div>
|
|
|
<div class="notice-type-txt">
|
|
|
- <el-link type="warning" href="javascript:void(0);" @click="selAndInitAnnouncement('homework')">发布作业
|
|
|
+ <el-link href="javascript:void(0);" type="warning" @click="selAndInitAnnouncement('homework')">发布作业
|
|
|
</el-link>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
@@ -72,7 +76,7 @@
|
|
|
考试
|
|
|
</div>
|
|
|
<div class="notice-type-txt">
|
|
|
- <el-link type="danger" href="javascript:void(0);" @click="selAndInitAnnouncement('exam')">发布考试</el-link>
|
|
|
+ <el-link href="javascript:void(0);" type="danger" @click="selAndInitAnnouncement('exam')">发布考试</el-link>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
<template #reference>
|
|
|
@@ -80,8 +84,8 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
- <el-upload v-if="isTeacher && tabName==='courseware'" action="" :http-request="handleFileUploading"
|
|
|
- :on-success="handleFileUploadSuccess" :show-file-list="false">
|
|
|
+ <el-upload v-if="isTeacher && tabName==='courseware'" :http-request="handleFileUploading" :on-success="handleFileUploadSuccess"
|
|
|
+ :show-file-list="false" action="">
|
|
|
<el-button plain type="primary">上传课件</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
@@ -118,9 +122,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog v-model="announcementFormDialog" :title="'添加发布'" :before-close="beforeFormClose">
|
|
|
- <el-form label-position="right" :model="announcementForm" :rules="announcementFormRule" label-width="60px"
|
|
|
- ref="announceFormRef">
|
|
|
+ <el-dialog v-model="announcementFormDialog" :before-close="beforeFormClose" :title="'添加发布'">
|
|
|
+ <el-form ref="announceFormRef" :model="announcementForm" :rules="announcementFormRule" label-position="right"
|
|
|
+ label-width="60px">
|
|
|
<el-form-item label="类别" prop="type">
|
|
|
<el-select v-model="announcementForm.type">
|
|
|
<el-option label="公告" value="announcement"></el-option>
|
|
|
@@ -132,26 +136,29 @@
|
|
|
<el-input v-model="announcementForm.title"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="内容">
|
|
|
- <el-input v-model="announcementForm.content" type="textarea" :rows="3"></el-input>
|
|
|
+ <el-input v-model="announcementForm.content" :rows="3" type="textarea"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div style="margin: auto;width: fit-content">
|
|
|
- <el-button type="primary" plain @click="handlePublishAnnouncement">确认发布</el-button>
|
|
|
- <el-button type="danger" plain @click="beforeFormClose">我再想想</el-button>
|
|
|
+ <el-button plain type="primary" @click="handlePublishAnnouncement">确认发布</el-button>
|
|
|
+ <el-button plain type="danger" @click="beforeFormClose">我再想想</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
+ </el-card>
|
|
|
+ <GlobalFooter/>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import NoticeItem from "./components/NoticeItem";
|
|
|
import FileEntry from "./components/FileEntry";
|
|
|
-import {ElMessageBox, ElMessage} from "element-plus";
|
|
|
+import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import variables from "@/utils/variables";
|
|
|
+import GlobalFooter from "@/components/GlobalFooter";
|
|
|
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
components: {
|
|
|
+ GlobalFooter,
|
|
|
// eslint-disable-next-line vue/no-unused-components
|
|
|
NoticeItem,
|
|
|
// eslint-disable-next-line vue/no-unused-components
|
|
|
@@ -194,11 +201,11 @@ export default {
|
|
|
color: "",
|
|
|
},
|
|
|
noticeTypeMap: {
|
|
|
- announce: {type: "公告", title: "发布公告", color: themeColor.orange},
|
|
|
- homework: {type: "作业", title: "发布作业", color: themeColor.blue},
|
|
|
- exam: {type: "考试", title: "发布考试", color: themeColor.red},
|
|
|
+ announce: { type: "公告", title: "发布公告", color: themeColor.orange },
|
|
|
+ homework: { type: "作业", title: "发布作业", color: themeColor.blue },
|
|
|
+ exam: { type: "考试", title: "发布考试", color: themeColor.red },
|
|
|
},
|
|
|
- newNoticeInfo: {noticeDescription: "", priority: "1", fileList: []},
|
|
|
+ newNoticeInfo: { noticeDescription: "", priority: "1", fileList: [] },
|
|
|
postNoticeInfo: {},
|
|
|
fileEntryList: [{
|
|
|
id: 1,
|
|
|
@@ -247,7 +254,7 @@ export default {
|
|
|
},
|
|
|
imgUrl() {
|
|
|
return this.courseInfo.imageUrl === null ? this.noImgUrl : this.courseInfo.imageUrl;
|
|
|
- // + "?t=" + Date.now().valueOf();
|
|
|
+ // + "?t=" + Date.now().valueOf();
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -258,9 +265,9 @@ export default {
|
|
|
.then(res => {
|
|
|
this.isCourseSelected = res.data.data;
|
|
|
this.$apis.getAnnouncementsByCourseId(this.$route.params.id)
|
|
|
- .then(res => {
|
|
|
- this.announcementList = res.data.data;
|
|
|
- });
|
|
|
+ .then(res => {
|
|
|
+ this.announcementList = res.data.data;
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -295,7 +302,7 @@ export default {
|
|
|
},
|
|
|
handlePublishAnnouncement() {
|
|
|
let announcementVO = {
|
|
|
- sender: {id: this.$store.state.user.id,},
|
|
|
+ sender: { id: this.$store.state.user.id, },
|
|
|
courseId: this.courseInfo.id,
|
|
|
title: this.announcementForm.title,
|
|
|
content: this.announcementForm.content,
|
|
|
@@ -323,7 +330,7 @@ export default {
|
|
|
confirmButtonText: "立即选课",
|
|
|
cancelButtonText: "我再想想",
|
|
|
})
|
|
|
- .then(({value}) => {
|
|
|
+ .then(({ value }) => {
|
|
|
if (value !== this.courseInfo.invitationCode) {
|
|
|
ElMessage.error("选课码错误");
|
|
|
} else {
|