|
|
@@ -3,7 +3,7 @@
|
|
|
<div class="course-detail-container" v-if="courseInfo!==null">
|
|
|
<div class="header">
|
|
|
<div class="course-img">
|
|
|
- <img alt="" :src="courseInfo.imageUrl">
|
|
|
+ <img alt="" :src="courseInfo.imageUrl === null ? noImgUrl : courseInfo.imageUrl">
|
|
|
</div>
|
|
|
<div class="course-info">
|
|
|
<el-row>课程名称:{{ courseInfo.name }}</el-row>
|
|
|
@@ -26,143 +26,138 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <el-divider></el-divider>-->
|
|
|
- <!-- <div class="introduce">-->
|
|
|
- <!-- <span class="title">简介</span>-->
|
|
|
- <!-- <br/>-->
|
|
|
- <!-- <div class="introduce-content">-->
|
|
|
- <!-- {{ courseInfo.introduce }}-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <el-divider></el-divider>-->
|
|
|
- <!-- <div 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-teacher-permission="{role:role}">-->
|
|
|
- <!-- <el-popover v-if="tabName==='notice'" v-model:visible="showPopover" :width="160" placement="bottom">-->
|
|
|
- <!-- <div class="sel-notice-type">-->
|
|
|
- <!-- <div :style="{color:themeColor.orange}" class="notice-type-icon">-->
|
|
|
- <!-- 公告-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="notice-type-txt" @click="selAndInitNotice('announce')">-->
|
|
|
- <!-- 发布公告-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="sel-notice-type">-->
|
|
|
- <!-- <div :style="{color:themeColor.blue}" class="notice-type-icon">-->
|
|
|
- <!-- 作业-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="notice-type-txt" @click="selAndInitNotice('homework')">-->
|
|
|
- <!-- 发布作业-->
|
|
|
- <!-- </div>-->
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <div class="introduce">
|
|
|
+ <el-row class="title">简介</el-row>
|
|
|
+ <el-row class="introduce-content">
|
|
|
+ {{ courseInfo.description === "" ? "无" : courseInfo.description }}
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-row 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>
|
|
|
+ <el-row v-if="true">
|
|
|
+ <el-popover v-if="isTeacher && tabName==='notice'"
|
|
|
+ v-model:visible="noticePopover"
|
|
|
+ :width="160"
|
|
|
+ placement="bottom">
|
|
|
+ <el-row class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.green}" class="notice-type-icon">
|
|
|
+ 公告
|
|
|
+ </div>
|
|
|
+ <div class="notice-type-txt">
|
|
|
+ <el-link type="success" href="javascript:void(0);" @click="selAndInitNotice('announcement')">发布公告
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.orange}" class="notice-type-icon">
|
|
|
+ 作业
|
|
|
+ </div>
|
|
|
+ <div class="notice-type-txt">
|
|
|
+ <el-link type="warning" href="javascript:void(0);" @click="selAndInitNotice('homework')">发布作业</el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.red}" class="notice-type-icon">
|
|
|
+ 考试
|
|
|
+ </div>
|
|
|
+ <div class="notice-type-txt">
|
|
|
+ <el-link type="danger" href="javascript:void(0);" @click="selAndInitNotice('test')">发布考试</el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <template #reference>
|
|
|
+ <el-button plain type="primary" @click="noticePopover = true">添加发布
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ <el-upload v-if="isTeacher && tabName==='courseware'" action="" :http-request="handleFileUploading"
|
|
|
+ :on-success="handleFileUploadSuccess" :show-file-list="false">
|
|
|
+ <el-button plain type="primary">上传课件</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-row>
|
|
|
+ </el-row>
|
|
|
+ <div class="course-tab-content">
|
|
|
+ <div v-if="tabName==='tasks'" class="tab-tasks">
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="(task, index) in tasks"
|
|
|
+ :key="index"
|
|
|
+ :timestamp="task.timestamp"
|
|
|
+ >
|
|
|
+ {{ task.content }}
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="tabName==='notice'" class="tab-notice">
|
|
|
+ <NoticeItem v-for="(item,index) in noticeInfoList" :key="index" :notice-info="item"></NoticeItem>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="tabName==='courseware'" class="tab-courseware">
|
|
|
+ <div class="entry-header">
|
|
|
+ <span class="name">文件名</span>
|
|
|
+ <span class="size">文件大小</span>
|
|
|
+ <span class="uploadTime">上传时间</span>
|
|
|
+ <span class="operation">操作</span>
|
|
|
+ </div>
|
|
|
+ <FileEntry v-for="(entry,index) in fileEntryList"
|
|
|
+ :key="index"
|
|
|
+ :file-entry-info="entry"
|
|
|
+ @downloadFileIconClick="handleDownloadFileIconClick"
|
|
|
+ ></FileEntry>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <!-- <el-dialog-->
|
|
|
+ <!-- v-model="showNewNoticeDialog"-->
|
|
|
+ <!-- :title="newNoticeType.title"-->
|
|
|
+ <!-- width="40%"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- <div class="new-notice-content">-->
|
|
|
+ <!-- <div class="new-notice-item">-->
|
|
|
+ <!-- <span>创建者: </span>-->
|
|
|
+ <!-- <div class="flex-vc">-->
|
|
|
+ <!-- <span>kenny 67</span>-->
|
|
|
+ <!-- <div :style="{backgroundColor:newNoticeType.color}" class="mini-name-icon">刘</div>-->
|
|
|
<!-- </div>-->
|
|
|
- <!-- <div class="sel-notice-type">-->
|
|
|
- <!-- <div :style="{color:themeColor.red}" class="notice-type-icon">-->
|
|
|
- <!-- 考试-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="notice-type-txt" @click="selAndInitNotice('test')">-->
|
|
|
- <!-- 发布考试-->
|
|
|
- <!-- </div>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div class="new-notice-item">-->
|
|
|
+ <!-- <span>所属课程:</span>-->
|
|
|
+ <!-- <div>软件工程与计算 I 2021</div>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div class="new-notice-item">-->
|
|
|
+ <!-- <span>发布时间:</span>-->
|
|
|
+ <!-- <div>2021年12月15日 18时30分</div>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div class="content-description-area">-->
|
|
|
+ <!-- <span>内容描述:</span>-->
|
|
|
+ <!-- <el-input-->
|
|
|
+ <!-- v-model="newNoticeInfo.noticeDescription"-->
|
|
|
+ <!-- :rows="4"-->
|
|
|
+ <!-- placeholder="内容描述"-->
|
|
|
+ <!-- type="textarea"-->
|
|
|
+ <!-- />-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div class="new-notice-item">-->
|
|
|
+ <!-- <span>优先级: </span>-->
|
|
|
+ <!-- <div>-->
|
|
|
+ <!-- <el-radio v-model="newNoticeInfo.priority" border label="1" size="large">重要</el-radio>-->
|
|
|
+ <!-- <el-radio v-model="newNoticeInfo.priority" border label="2" size="large">一般</el-radio>-->
|
|
|
<!-- </div>-->
|
|
|
- <!-- <template #reference>-->
|
|
|
- <!-- <el-button plain type="warning" @click="showPopover = true">添加发布-->
|
|
|
- <!-- </el-button>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-popover>-->
|
|
|
- <!-- <el-upload-->
|
|
|
- <!-- v-if="tabName==='courseware'"-->
|
|
|
- <!-- :action="actionUrl"-->
|
|
|
- <!-- :http-request="handleFileUploading"-->
|
|
|
- <!-- :on-success="handFileUploadSuccess"-->
|
|
|
- <!-- :show-file-list="false"-->
|
|
|
- <!-- class="upload-demo width-100"-->
|
|
|
- <!-- method="put"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <el-button plain type="primary">上传课件</el-button>-->
|
|
|
- <!-- </el-upload>-->
|
|
|
+ <!-- </div>-->
|
|
|
<!-- </div>-->
|
|
|
- </div>
|
|
|
- <!-- <div class="course-tab-content">-->
|
|
|
- <!-- <div v-if="tabName==='tasks'" class="tab-tasks">-->
|
|
|
- <!-- <el-timeline>-->
|
|
|
- <!-- <el-timeline-item-->
|
|
|
- <!-- v-for="(task, index) in tasks"-->
|
|
|
- <!-- :key="index"-->
|
|
|
- <!-- :timestamp="task.timestamp"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- {{ task.content }}-->
|
|
|
- <!-- </el-timeline-item>-->
|
|
|
- <!-- </el-timeline>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div v-else-if="tabName==='notice'" class="tab-notice">-->
|
|
|
- <!-- <NoticeItem v-for="(item,index) in noticeInfoList" :key="index" :notice-info="item"></NoticeItem>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div v-else-if="tabName==='courseware'" class="tab-courseware">-->
|
|
|
- <!-- <div class="entry-header">-->
|
|
|
- <!-- <span class="name">文件名</span>-->
|
|
|
- <!-- <span class="size">文件大小</span>-->
|
|
|
- <!-- <span class="uploadTime">上传时间</span>-->
|
|
|
- <!-- <span class="operation">操作</span>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <FileEntry v-for="(entry,index) in fileEntryList"-->
|
|
|
- <!-- :key="index"-->
|
|
|
- <!-- :file-entry-info="entry"-->
|
|
|
- <!-- @downloadFileIconClick="handleDownloadFileIconClick"-->
|
|
|
- <!-- ></FileEntry>-->
|
|
|
-
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div>-->
|
|
|
- <!-- <el-dialog-->
|
|
|
- <!-- v-model="showNewNoticeDialog"-->
|
|
|
- <!-- :title="newNoticeType.title"-->
|
|
|
- <!-- width="40%"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <div class="new-notice-content">-->
|
|
|
- <!-- <div class="new-notice-item">-->
|
|
|
- <!-- <span>创建者: </span>-->
|
|
|
- <!-- <div class="flex-vc">-->
|
|
|
- <!-- <span>kenny 67</span>-->
|
|
|
- <!-- <div :style="{backgroundColor:newNoticeType.color}" class="mini-name-icon">刘</div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="new-notice-item">-->
|
|
|
- <!-- <span>所属课程:</span>-->
|
|
|
- <!-- <div>软件工程与计算 I 2021</div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="new-notice-item">-->
|
|
|
- <!-- <span>发布时间:</span>-->
|
|
|
- <!-- <div>2021年12月15日 18时30分</div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="content-description-area">-->
|
|
|
- <!-- <span>内容描述:</span>-->
|
|
|
- <!-- <el-input-->
|
|
|
- <!-- v-model="newNoticeInfo.noticeDescription"-->
|
|
|
- <!-- :rows="4"-->
|
|
|
- <!-- placeholder="内容描述"-->
|
|
|
- <!-- type="textarea"-->
|
|
|
- <!-- />-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="new-notice-item">-->
|
|
|
- <!-- <span>优先级: </span>-->
|
|
|
- <!-- <div>-->
|
|
|
- <!-- <el-radio v-model="newNoticeInfo.priority" border label="1" size="large">重要</el-radio>-->
|
|
|
- <!-- <el-radio v-model="newNoticeInfo.priority" border label="2" size="large">一般</el-radio>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="new-notice-btn">-->
|
|
|
- <!-- <el-button style="margin-right: 32px" type="primary">确认</el-button>-->
|
|
|
- <!-- <el-button type="danger">取消</el-button>-->
|
|
|
+ <!-- <div class="new-notice-btn">-->
|
|
|
+ <!-- <el-button style="margin-right: 32px" type="primary">确认</el-button>-->
|
|
|
+ <!-- <el-button type="danger">取消</el-button>-->
|
|
|
|
|
|
- <!-- </div>-->
|
|
|
+ <!-- </div>-->
|
|
|
|
|
|
- <!-- </el-dialog>-->
|
|
|
- <!-- </div>-->
|
|
|
+ <!-- </el-dialog>-->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -170,6 +165,7 @@
|
|
|
import NoticeItem from "./components/NoticeItem";
|
|
|
import FileEntry from "./components/FileEntry";
|
|
|
import {ElMessageBox, ElMessage} from "element-plus";
|
|
|
+import variables from "@/utils/variables";
|
|
|
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
@@ -181,6 +177,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
const themeColor = {
|
|
|
+ green: "#67C23A",
|
|
|
orange: "#E38800",
|
|
|
blue: "#1989FA",
|
|
|
red: "#F56C6C"
|
|
|
@@ -188,6 +185,10 @@ export default {
|
|
|
return {
|
|
|
courseInfo: null,
|
|
|
isCourseSelected: false,
|
|
|
+ noImgUrl: variables.noImgUrl,
|
|
|
+ themeColor,
|
|
|
+ tabName: "notice",
|
|
|
+ noticePopover: false,
|
|
|
|
|
|
newNoticeType: {
|
|
|
type: "",
|
|
|
@@ -220,8 +221,6 @@ export default {
|
|
|
}],
|
|
|
postNoticeInfo: {},
|
|
|
showNewNoticeDialog: false,
|
|
|
- tabName: "tasks",
|
|
|
- showPopover: false,
|
|
|
fileEntryList: [{
|
|
|
id: 1,
|
|
|
name: "课程作业",
|
|
|
@@ -259,7 +258,10 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
isStudent() {
|
|
|
- return ["STUDENT", "ADMIN", "SEEC"].indexOf(this.$store.state.user.role);
|
|
|
+ return ["STUDENT", "ADMIN", "SEEC"].indexOf(this.$store.state.user.role) !== -1;
|
|
|
+ },
|
|
|
+ isTeacher() {
|
|
|
+ return ["TEACHER", "ADMIN", "SEEC"].indexOf(this.$store.state.user.role) !== -1;
|
|
|
},
|
|
|
},
|
|
|
async mounted() {
|
|
|
@@ -282,8 +284,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
selAndInitNotice(noticeType) {
|
|
|
- Object.assign(this.newNoticeType, this.noticeTypeMap[noticeType]);
|
|
|
- this.showNewNoticeDialog = true;
|
|
|
+ console.log(noticeType);
|
|
|
+ // Object.assign(this.newNoticeType, this.noticeTypeMap[noticeType]);
|
|
|
+ // this.showNewNoticeDialog = true;
|
|
|
},
|
|
|
handleFileUploading() {
|
|
|
},
|