parent
caf1587264
commit
982ec52326
34 changed files with 30416 additions and 33021 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,263 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between"> |
||||
<el-page-header @back="back" :content="form.id ? '编辑课程' : '新增课程'"></el-page-header> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<el-form :disabled="isDetail" label-width="80px" label-suffix=":"> |
||||
<el-form-item label="课程名称"> |
||||
<div class="d-inline-block"> |
||||
<el-input placeholder="请输入课程名称" v-model="form.name" clearable maxlength="25"></el-input> |
||||
</div> |
||||
</el-form-item> |
||||
<el-form-item label="课程分类"> |
||||
<div class="d-inline-block"> |
||||
<el-select v-model="form.classificationId" placeholder="请选择课程分类"> |
||||
<el-option v-for="item in classificationList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</div> |
||||
</el-form-item> |
||||
<el-form-item label="课程封面"> |
||||
<el-upload |
||||
class="avatar-uploader" |
||||
accept=".jpg,.png,.jpeg" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
:headers="headers" |
||||
name="file" |
||||
> |
||||
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> |
||||
<div class="uploader-default" v-else> |
||||
<i class="el-icon-plus"></i> |
||||
<p>上传封面</p> |
||||
</div> |
||||
|
||||
<div slot="tip" class="el-upload__tip"> |
||||
<p>只能上传jpg/png文件</p> |
||||
<p>课程封面图将按2:1显示,最佳分辨率1400*700</p> |
||||
</div> |
||||
</el-upload> |
||||
</el-form-item> |
||||
<el-form-item label="课程介绍"> |
||||
<quill :border="true" :readonly="isDetail" v-model="form.description" :height="400" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" v-throttle @click="save" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import Setting from "@/setting"; |
||||
import quill from "@/components/quill"; |
||||
|
||||
export default { |
||||
name: "courseAddEdit", |
||||
data() { |
||||
return { |
||||
headers: { |
||||
token: util.local.get(Setting.tokenKey) |
||||
}, |
||||
isDetail: Boolean(this.$route.query.show), |
||||
form: { |
||||
id: this.$route.query.id, |
||||
classificationId: '', |
||||
coverUrl: '', |
||||
name: '', |
||||
description: '', |
||||
distinguish: 1 |
||||
}, |
||||
classificationList: [], |
||||
uploadList: [], |
||||
submiting: false, |
||||
updateTime: 0 |
||||
}; |
||||
}, |
||||
watch: { |
||||
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
||||
form: { |
||||
handler(val){ |
||||
this.updateTime++ |
||||
}, |
||||
deep:true |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getClassification(); |
||||
this.form.id && this.getData(); |
||||
}, |
||||
components: { |
||||
quill |
||||
}, |
||||
methods: { |
||||
getClassification() { |
||||
this.$get(this.api.queryGlClassification).then(res => { |
||||
this.classificationList = res.classificationList; |
||||
}).catch(res => {}); |
||||
}, |
||||
getData() { |
||||
this.$get(`${this.api.getCourse}/${this.form.id}`).then(({ course }) => { |
||||
this.form = course |
||||
this.uploadList.push({ |
||||
name: "cover.jpg", |
||||
url: course.coverUrl |
||||
}) |
||||
}).catch(err => {}) |
||||
}, |
||||
handleExceed(files, fileList) { // 上传文件 |
||||
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.form.coverUrl = res.data.filesResult.fileUrl |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
let fileName = this.form.coverUrl.replace('https://huoran.oss-cn-shenzhen.aliyuncs.com/', ""); |
||||
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { |
||||
this.form.coverUrl = '' |
||||
}).catch(res => {}); |
||||
}, |
||||
save() { |
||||
if (this.submiting) return false |
||||
const { form } = this |
||||
if (!form.name) return util.warningMsg("请填写课程名称") |
||||
if (!form.classificationId) return util.warningMsg("请选择课程分类") |
||||
if (!form.coverUrl) return util.warningMsg("请上传课程封面") |
||||
this.submiting = true |
||||
if (form.id) { |
||||
this.$put(this.api.editCourse, form).then(res => { |
||||
this.submiting = false; |
||||
util.successMsg("修改成功"); |
||||
this.$router.back(); |
||||
}).catch(err => { |
||||
this.submiting = false; |
||||
}); |
||||
} else { |
||||
this.$post(this.api.addCourse, form).then(res => { |
||||
this.submiting = false; |
||||
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", { |
||||
type: "success", |
||||
confirmButtonText: "马上设置", |
||||
cancelButtonText: "稍后操作" |
||||
}).then(() => { |
||||
this.$router.push(`/course/contentSettings?id=${res.courseId}`); |
||||
}).catch(() => { |
||||
this.$router.back(); |
||||
}); |
||||
}).catch(err => { |
||||
this.submiting = false; |
||||
}); |
||||
} |
||||
}, |
||||
// 返回上一页 |
||||
backPage() { |
||||
this.$router.back() |
||||
}, |
||||
back() { |
||||
const { id } = this.form |
||||
const updateTime = this.updateTime |
||||
// 更改了信息才需要提示 |
||||
if ((id && updateTime > 2) || (!id && updateTime)) { |
||||
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.save() |
||||
}).catch(() => { |
||||
this.backPage() |
||||
}) |
||||
} else { |
||||
this.backPage() |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
$avatar-width: 104px; |
||||
/deep/ .avatar-uploader { |
||||
.el-upload { |
||||
position: relative; |
||||
width: $avatar-width; |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 2px; |
||||
cursor: pointer; |
||||
overflow: hidden; |
||||
|
||||
&:hover { |
||||
border-color: #409EFF; |
||||
} |
||||
|
||||
.uploader-default { |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
width: $avatar-width !important; |
||||
height: $avatar-width; |
||||
text-align: center; |
||||
background: rgba(0, 0, 0, 0.04); |
||||
|
||||
i { |
||||
font-size: 20px; |
||||
font-weight: bold; |
||||
color: #8c939d; |
||||
} |
||||
|
||||
p { |
||||
margin-top: 10px; |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
line-height: 1; |
||||
} |
||||
} |
||||
|
||||
.avatar { |
||||
width: $avatar-width; |
||||
height: $avatar-width; |
||||
display: block; |
||||
} |
||||
} |
||||
|
||||
.el-upload__tip { |
||||
margin-top: 0; |
||||
|
||||
p { |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.45); |
||||
line-height: 1; |
||||
|
||||
&:first-child { |
||||
margin-bottom: 5px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
/deep/ .d-inline-block { |
||||
width: 216px; |
||||
|
||||
.el-select, .el-input { |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -1,888 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between"> |
||||
<el-page-header @back="goBack" :content="sorting? '更改排序' : '内容设置'"></el-page-header> |
||||
</div> |
||||
</el-card> |
||||
<!--内容设置--> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="page"> |
||||
<div class="relative"> |
||||
<div class="p-title">内容设置</div> |
||||
<div class="btns" style="top: -10px"> |
||||
<template v-if="!sorting"> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:添加章节'" type="primary" round v-throttle @click="addChapter">添加章节</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:编辑顺序'" type="primary" round v-throttle @click="sort">编辑顺序</el-button> |
||||
</template> |
||||
<template v-else> |
||||
<el-button type="primary" round @click="move">批量移动</el-button> |
||||
<el-button type="primary" round v-throttle @click="cancelSort">取消</el-button> |
||||
<el-button type="primary" round v-throttle @click="saveSort">保存</el-button> |
||||
</template> |
||||
</div> |
||||
</div> |
||||
<el-divider></el-divider> |
||||
<div class="page-content"> |
||||
<div class="m-b-20" v-for="(chapter,index) in chapters" :key="chapter.id"> |
||||
<div class="flex j-between a-center m-b-10"> |
||||
<div>{{ chapter.name }}</div> |
||||
<div> |
||||
<template v-if="!sorting"> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:修改章节名称'" class="action-btn" type="primary" round v-throttle @click="editChapter(chapter)">修改章节名称</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:添加小节'" class="action-btn" type="primary" round v-throttle @click="addSection(chapter.id)">添加小节</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:章节删除'" class="action-btn" type="primary" round v-throttle @click="delChapter(chapter.id)">删除</el-button> |
||||
</template> |
||||
<template v-else> |
||||
<i class="el-icon-top sort-icon" :class="{disabled: index == 0}" style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i> |
||||
<i class="el-icon-bottom sort-icon" :class="{disabled: index == chapters.length-1}" @click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i> |
||||
</template> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table :data="chapter.subsectionList" class="table" stripe header-align="center"> |
||||
<el-table-column v-if="sorting" width="55" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-checkbox v-model="scope.row.check"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="资源名称"> |
||||
</el-table-column> |
||||
<el-table-column prop="fileType" label="资源类型" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ transferType(scope.row.fileType) }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="300"> |
||||
<template slot-scope="scope"> |
||||
<template v-if="!sorting"> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:查看'" type="text" @click="preview(scope.row)">查看</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:小节删除'" type="text" @click="delSection(scope.row)">删除</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:修改小节名称'" type="text" @click="editSectionName(scope.row,chapter.id)">修改小节名称</el-button> |
||||
<el-button v-auth="'/course/list:课程管理:内容设置:更换文件'" type="text" @click="switchFile(scope.row,chapter.id)">更换文件</el-button> |
||||
</template> |
||||
<template v-else> |
||||
<i class="el-icon-top sort-icon" :class="{disabled: scope.$index == 0}" style="margin-right: 5px" @click="sortSection(index,'up',scope.$index == 0,scope.$index)"></i> |
||||
<i class="el-icon-bottom sort-icon" :class="{disabled: scope.$index == chapter.subsectionList.length-1}" @click="sortSection(index,'down',scope.$index == chapter.subsectionList.length-1,scope.$index)"></i> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
|
||||
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="24%" :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="chapterVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="chapterSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="28%" @close="closeSection" :close-on-click-modal="false"> |
||||
<el-form label-width="80px"> |
||||
<el-form-item label="资源添加"> |
||||
<el-upload |
||||
:before-upload="beforeUpload" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
:file-list="uploadList" |
||||
:headers="headers" |
||||
name="file" |
||||
> |
||||
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
||||
</el-upload> |
||||
</el-form-item> |
||||
<el-form-item label="小节名称"> |
||||
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="sectionVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="sectionSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="更换文件" :visible.sync="switchVisible" width="28%" :close-on-click-modal="false" @close="closeSwitch"> |
||||
<div style="text-align: center"> |
||||
<el-upload |
||||
:before-upload="beforeUpload" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
:file-list="uploadList" |
||||
:headers="headers" |
||||
name="file" |
||||
> |
||||
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
||||
</el-upload> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="switchVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="switchSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="24%" :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="sectionNameVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="sectionNameSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{active: previewImg}" style="z-index: 2000"> |
||||
<div class="el-image-viewer__mask"></div> |
||||
<span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i class="el-icon-circle-close" style="color: #fff"></i></span> |
||||
<div class="el-image-viewer__canvas"> |
||||
<img :src="previewImg" class="el-image-viewer__img" style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;"> |
||||
</div> |
||||
</div> |
||||
<div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}" style="z-index: 2000"> |
||||
<div class="el-image-viewer__mask"></div> |
||||
<span class="el-image-viewer__btn el-image-viewer__close" :class="{'doc-close': isWord}" :style="{top: isWord ? '50px' : '5px'}" @click="closeIframe"><i class="el-icon-circle-close" style="color: #fff"></i></span> |
||||
<div class="el-image-viewer__canvas"> |
||||
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> |
||||
<template v-if="showMask"> |
||||
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div> |
||||
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> |
||||
</template> |
||||
<template v-if="showMask1"> |
||||
<div class="word-mask1" style="width: 200px;height: 50px;"></div> |
||||
<div class="word-mask" style="height: 40px;top: 48px;"></div> |
||||
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div> |
||||
</template> |
||||
<template v-if="showMask2 && iframeSrc"> |
||||
<div class="excel-mask1" style="height: 48px;"></div> |
||||
</template> |
||||
</div> |
||||
</div> |
||||
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}" style="z-index: 2000"> |
||||
<div class="el-image-viewer__mask"></div> |
||||
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i class="el-icon-circle-close" style="color: #fff"></i></span> |
||||
<div class="player" id="player"></div> |
||||
</div> |
||||
|
||||
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog title="资源移动" :visible.sync="moveVisible" :close-on-click-modal="false" width="330px"> |
||||
<el-form> |
||||
<el-form-item label="目标章节"> |
||||
<el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange"> |
||||
<el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="目标排序"> |
||||
<el-select v-model="moveForm.sort" placeholder="请选择目标排序"> |
||||
<el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="moveVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="moveConfirm">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import Setting from "@/setting"; |
||||
import { Loading } from "element-ui"; |
||||
import pdf from "@/components/pdf"; |
||||
|
||||
export default { |
||||
name: "contentSettings", |
||||
data() { |
||||
return { |
||||
headers: { |
||||
token: util.local.get(Setting.tokenKey) |
||||
}, |
||||
id: "", |
||||
originChapters: [], |
||||
chapters: [], |
||||
sorting: false, |
||||
uploading: false, |
||||
uploadList: [], |
||||
chapterVisible: false, |
||||
chapterId: "", |
||||
chapterName: "", |
||||
sectionVisible: false, |
||||
sectionName: "", |
||||
sectionId: "", |
||||
switchVisible: false, |
||||
sectionNameVisible: false, |
||||
fileId: "", |
||||
fileName: "", |
||||
fileUrl: "", |
||||
originalFileName: "", |
||||
fileType: "", |
||||
playAuth: "", |
||||
player: null, |
||||
previewImg: "", |
||||
iframeSrc: "", |
||||
curFile: {}, |
||||
isAddSection: false, |
||||
isWord: false, |
||||
isPPT: false, |
||||
isExcel: false, |
||||
showMask: false, |
||||
showMask1: false, |
||||
showMask2: false, |
||||
loadIns: null, |
||||
pdfVisible: false, |
||||
pdfSrc: "", |
||||
previewing: false, |
||||
moveVisible: false, |
||||
checkList: [], |
||||
sortList: [ |
||||
{ |
||||
id: 'bottom', |
||||
name: '置末' |
||||
}, |
||||
{ |
||||
id: 'top', |
||||
name: '置顶' |
||||
} |
||||
], |
||||
moveForm: { |
||||
id: '', |
||||
sort: 'bottom' |
||||
}, |
||||
moved: false // 是否移动过 |
||||
}; |
||||
}, |
||||
components: { pdf }, |
||||
mounted() { |
||||
this.insertScript(); |
||||
this.id = this.$route.query.id; |
||||
this.id && this.getData(); |
||||
// 处理预览资源后返回弹框不会消失的问题 |
||||
if (window.history && window.history.pushState) { |
||||
history.pushState(null, null, document.URL); |
||||
window.addEventListener("popstate", this.goBack, false); |
||||
} |
||||
}, |
||||
destroyed() { |
||||
window.removeEventListener("popstate", this.goBack, false); |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) |
||||
.then(res => { |
||||
this.chapters = res.chapterList; |
||||
}) |
||||
.catch(err => { |
||||
|
||||
}); |
||||
}, |
||||
goBack() { |
||||
// 如果是预览则关闭预览 |
||||
if (this.previewing) { |
||||
this.closeIframe(); |
||||
} else { |
||||
// 排序中 |
||||
if (this.sorting) { |
||||
// 已经移动了顺序 |
||||
if (this.moved) { |
||||
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.saveSort() |
||||
this.moved = false |
||||
}).catch(() => { |
||||
this.sorting = false |
||||
this.chapters = JSON.parse(JSON.stringify(this.originChapters)) |
||||
}) |
||||
} else { |
||||
this.sorting = false |
||||
} |
||||
} else { |
||||
this.$router.back() |
||||
} |
||||
} |
||||
}, |
||||
iframeOnload() { |
||||
document.querySelector("#fileIframe").onload = e => { |
||||
if (this.isPPT) { |
||||
this.showMask = true; |
||||
} else { |
||||
this.showMask = false; |
||||
} |
||||
if (this.isWord) { |
||||
this.showMask1 = true; |
||||
} else { |
||||
this.showMask1 = false; |
||||
} |
||||
if (this.isExcel) { |
||||
this.showMask2 = true; |
||||
} else { |
||||
this.showMask2 = false; |
||||
} |
||||
this.loadIns.close(); |
||||
}; |
||||
}, |
||||
insertScript() { |
||||
const linkTag = document.createElement("link"); |
||||
linkTag.rel = "stylesheet"; |
||||
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
||||
document.body.appendChild(linkTag); |
||||
|
||||
const scriptTag = document.createElement("script"); |
||||
scriptTag.type = "text/javascript"; |
||||
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; |
||||
document.body.appendChild(scriptTag); |
||||
}, |
||||
// 上传文件 |
||||
beforeUpload(file) { |
||||
let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1)); |
||||
if (type != "视频" && type != "图片" && type != "pdf" && (file.size / 1024 / 1024) > 10) { |
||||
util.errorMsg("请上传10M以内的文件"); |
||||
return false; |
||||
} |
||||
this.uploading = true; |
||||
this.originalFileName = file.name; |
||||
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); |
||||
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
util.warningMsg( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploading = false; |
||||
this.fileId = res.data.filesResult.fileId; |
||||
this.fileType = res.data.filesResult.fileType; |
||||
this.fileUrl = res.data.filesResult.fileUrl; |
||||
this.fileName = res.data.filesResult.ossFileName; |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
if ((file.size / 1024 / 1024) < 10) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
} |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList; |
||||
}, |
||||
uploadSure() { |
||||
this.importVisible = false; |
||||
this.pageNo = 1; |
||||
this.staffGradeId = ""; |
||||
this.keyword = ""; |
||||
this.getTeacher(); |
||||
}, |
||||
goback() { |
||||
this.$router.push("course"); |
||||
}, |
||||
transferType(ext) { |
||||
const suf = ext.toLowerCase() |
||||
if ("jpg,jpeg,png,gif,svg,psd".includes(suf)) return "图片"; |
||||
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(suf)) return "视频"; |
||||
return suf; |
||||
}, |
||||
addChapter() { |
||||
this.chapterName = ""; |
||||
this.chapterId = ""; |
||||
this.chapterVisible = true; |
||||
}, |
||||
sort() { |
||||
this.originChapters = JSON.parse(JSON.stringify(this.chapters)) |
||||
this.sorting = true; |
||||
}, |
||||
// 批量移动 |
||||
move() { |
||||
const list = this.chapters |
||||
const checkList = [] |
||||
list.map(e => { |
||||
e.subsectionList.map(n => { |
||||
n.check && checkList.push(n) |
||||
}) |
||||
}) |
||||
this.checkList = checkList |
||||
if (checkList.length) { |
||||
this.moveForm = { |
||||
id: '', |
||||
sort: 'bottom' |
||||
} |
||||
this.sortList = [ |
||||
{ |
||||
id: 'bottom', |
||||
name: '置末' |
||||
}, |
||||
{ |
||||
id: 'top', |
||||
name: '置顶' |
||||
} |
||||
] |
||||
this.moveVisible = true |
||||
} else { |
||||
this.$message.warning('请选择小节!') |
||||
} |
||||
}, |
||||
// 目标章节选择回调 |
||||
chapterChange(id) { |
||||
const list = [] |
||||
// 获取多少个小节 |
||||
this.chapters.find(e => e.id === id).subsectionList.map((e, i) => { |
||||
list.push({ |
||||
id: i, |
||||
name: i+1 |
||||
}) |
||||
}) |
||||
// 置末和置顶写死 |
||||
this.sortList = [ |
||||
{ |
||||
id: 'bottom', |
||||
name: '置末' |
||||
}, |
||||
...list, |
||||
{ |
||||
id: 'top', |
||||
name: '置顶' |
||||
} |
||||
] |
||||
}, |
||||
// 资源移动校验 |
||||
moveConfirm() { |
||||
let { id, sort } = this.moveForm |
||||
if (!id) return this.$message.warning('请选择目标章节') |
||||
if (sort === '') return this.$message.warning('请选择目标排序') |
||||
if (typeof sort === 'string') sort = sort === 'top' ? 0 : this.sortList.length - 2 // 置顶和置末直接给排序 |
||||
this.moveVisible = false |
||||
const list = this.checkList |
||||
list.map(e => e.check = false) |
||||
const ids = list.map(e => e.id) |
||||
const { chapters } = this |
||||
chapters.map(e => { |
||||
e.children = [] |
||||
e.subsectionList.map(n => { |
||||
if (!ids.includes(n.id)) { |
||||
e.children.push(n) |
||||
} |
||||
}) |
||||
e.subsectionList = e.children |
||||
delete e.children |
||||
if (e.id === id) e.subsectionList.splice(sort, 0, ...list) |
||||
}) |
||||
this.moved = true |
||||
}, |
||||
cancelSort() { |
||||
this.chapters = JSON.parse(JSON.stringify(this.originChapters)) |
||||
this.sorting = false; |
||||
}, |
||||
saveSort() { |
||||
this.chapters.forEach((n, k) => { |
||||
n.sort = k + 1; |
||||
n.subsectionList.forEach((j, i) => { |
||||
j.sort = i + 1 |
||||
j.chapterId = n.id |
||||
}); |
||||
}); |
||||
let data = { |
||||
chapterVOList: this.chapters |
||||
}; |
||||
this.$post(this.api.reorder, data).then(res => { |
||||
this.sorting = false; |
||||
}).catch(res => { |
||||
}); |
||||
}, |
||||
editChapter(item) { |
||||
this.chapterId = item.id; |
||||
this.chapterName = item.name; |
||||
this.chapterVisible = true; |
||||
}, |
||||
delChapter(id) { |
||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.deleteChapter}/${id}`).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
}); |
||||
}, |
||||
closeSection() { |
||||
this.isAddSection = false; |
||||
}, |
||||
addSection(id) { |
||||
this.chapterId = id; |
||||
this.sectionName = ""; |
||||
this.fileUrl = ""; |
||||
this.uploadList = []; |
||||
this.sectionId = ""; |
||||
this.isAddSection = true; |
||||
this.sectionVisible = true; |
||||
}, |
||||
chapterSubmit() { |
||||
if (!this.chapterName) return util.warningMsg("请填写章节名称"); |
||||
let data = { |
||||
courseId: this.id, |
||||
name: this.chapterName |
||||
}; |
||||
if (this.chapterId) { |
||||
data.id = this.chapterId; |
||||
this.$put(this.api.editChapter, data).then(res => { |
||||
util.successMsg("修改成功"); |
||||
this.chapterVisible = false; |
||||
this.getData(); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} else { |
||||
this.$post(this.api.addChapter, data).then(res => { |
||||
util.successMsg("添加成功"); |
||||
this.chapterVisible = false; |
||||
this.getData(); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
sectionSubmit() { |
||||
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
||||
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
||||
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
||||
let data = { |
||||
id: this.sectionId, |
||||
courseId: this.id, |
||||
chapterId: this.chapterId, |
||||
name: this.sectionName, |
||||
fileId: this.fileId, |
||||
fileUrl: this.fileUrl, |
||||
fileName: this.fileName, |
||||
fileType: this.fileType, |
||||
originalFileName: this.originalFileName |
||||
}; |
||||
this.$post(this.api.addSubsection, data).then(res => { |
||||
util.successMsg("添加成功"); |
||||
this.sectionVisible = false; |
||||
this.getData(); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}, |
||||
closeSwitch() { |
||||
this.fileId = ""; |
||||
this.fileName = ""; |
||||
this.fileType = ""; |
||||
this.fileUrl = ""; |
||||
this.sectionId = ""; |
||||
}, |
||||
preview(row) { |
||||
if (this.transferType(row.fileType) == "视频") { |
||||
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
||||
this.playAuth = res.data.playAuth; |
||||
if (this.player) { |
||||
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); |
||||
} else { |
||||
this.player = new Aliplayer({ |
||||
id: "player", |
||||
width: "100%", |
||||
autoplay: false, |
||||
vid: row.fileId, |
||||
playauth: this.playAuth, |
||||
encryptType: 1 //当播放私有加密流时需要设置。 |
||||
}); |
||||
} |
||||
}).catch(res => { |
||||
}); |
||||
} else if (this.transferType(row.fileType) == "图片") { |
||||
this.previewImg = row.fileUrl; |
||||
} else if (row.fileType == "pdf") { |
||||
this.pdfSrc = row.fileUrl; |
||||
this.pdfVisible = true; |
||||
} else { |
||||
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { |
||||
this.previewing = true; |
||||
this.loadIns = Loading.service(); |
||||
this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file"); |
||||
if (row.fileType == "pptx") { |
||||
this.isPPT = true; |
||||
this.isWord = false; |
||||
this.isExcel = false; |
||||
} else if (row.fileType == "doc" || row.fileType == "docx") { |
||||
this.isPPT = false; |
||||
this.isWord = true; |
||||
this.isExcel = false; |
||||
} else if (row.fileType == "xls" || row.fileType == "xlsx") { |
||||
this.isExcel = true; |
||||
this.isPPT = false; |
||||
this.isWord = false; |
||||
} else { |
||||
this.isPPT = false; |
||||
this.isWord = false; |
||||
this.isExcel = false; |
||||
} |
||||
this.iframeSrc = res.previewUrl; |
||||
this.$nextTick(() => { |
||||
this.iframeOnload(); |
||||
}); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
editSectionName(row, chapterId) { |
||||
this.chapterId = chapterId; |
||||
this.sectionId = row.id; |
||||
this.sectionName = row.name; |
||||
this.sectionNameVisible = true; |
||||
}, |
||||
switchFile(row, chapterId, sectionId) { |
||||
this.uploadList = []; |
||||
this.curFile = { |
||||
fileId: row.fileId, |
||||
fileName: row.fileName, |
||||
fileType: row.fileType, |
||||
fileUrl: row.fileUrl |
||||
}; |
||||
this.chapterId = chapterId; |
||||
this.sectionId = row.id; |
||||
this.sectionName = row.sectionName; |
||||
|
||||
this.switchVisible = true; |
||||
}, |
||||
switchSubmitFile() { |
||||
let data = { |
||||
id: this.sectionId, |
||||
courseId: this.id, |
||||
chapterId: this.chapterId, |
||||
name: this.sectionName, |
||||
fileId: this.fileId, |
||||
fileName: this.fileName, |
||||
fileType: this.fileType, |
||||
fileUrl: this.fileUrl, |
||||
originalFileName: this.originalFileName |
||||
}; |
||||
this.$put(this.api.editSubsection, data).then(res => { |
||||
util.successMsg("更换成功"); |
||||
this.switchVisible = false; |
||||
this.getData(); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}, |
||||
switchSubmit() { |
||||
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
||||
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
||||
if (this.transferType(this.curFile.fileType) == "视频") { |
||||
let data = { |
||||
videoIdList: [this.sectionId] |
||||
}; |
||||
this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => { |
||||
this.switchSubmitFile(); |
||||
}).catch(res => { |
||||
}); |
||||
} else { |
||||
this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => { |
||||
this.switchSubmitFile(); |
||||
}).catch(res => { |
||||
}); |
||||
} |
||||
}, |
||||
delSection(row) { |
||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
}); |
||||
}, |
||||
sortChapter(row, type, disabled, index) { |
||||
if (!disabled) { |
||||
if (type == "up") { |
||||
let tempItem = this.chapters.splice(index - 1, 1)[0]; |
||||
this.chapters.splice(index, 0, tempItem); |
||||
} else { |
||||
let tempItem = this.chapters.splice(index + 1, 1)[0]; |
||||
this.chapters.splice(index, 0, tempItem); |
||||
} |
||||
} |
||||
}, |
||||
sortSection(chapterIndex, type, disabled, index) { |
||||
if (!disabled) { |
||||
this.moved = true |
||||
let list = this.chapters[chapterIndex].subsectionList; |
||||
if (type == "up") { |
||||
let tempItem = list.splice(index - 1, 1)[0]; |
||||
list.splice(index, 0, tempItem); |
||||
} else { |
||||
let tempItem = list.splice(index + 1, 1)[0]; |
||||
list.splice(index, 0, tempItem); |
||||
} |
||||
this.chapters[chapterIndex].subsectionList = list; |
||||
|
||||
} |
||||
}, |
||||
sectionNameSubmit() { |
||||
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
||||
let data = { |
||||
id: this.sectionId, |
||||
courseId: this.id, |
||||
chapterId: this.chapterId, |
||||
name: this.sectionName |
||||
}; |
||||
this.$put(this.api.editSubsection, data).then(res => { |
||||
util.successMsg("修改成功"); |
||||
this.sectionNameVisible = false; |
||||
this.getData(); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}, |
||||
closePlayer() { |
||||
this.playAuth = ""; |
||||
this.player.pause(); |
||||
}, |
||||
closeIframe() { |
||||
this.iframeSrc = ""; |
||||
this.showMask = false; |
||||
this.showMask1 = false; |
||||
this.showMask2 = false; |
||||
this.previewing = false; |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.btns { |
||||
position: absolute; |
||||
top: 12px; |
||||
right: 24px; |
||||
|
||||
.el-button { |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
/deep/.el-progress-bar { |
||||
padding-right: 70px; |
||||
margin-right: -70px; |
||||
} |
||||
.sort-icon { |
||||
font-size: 24px; |
||||
cursor: pointer; |
||||
|
||||
&.disabled { |
||||
color: #ccc; |
||||
cursor: not-allowed |
||||
} |
||||
} |
||||
|
||||
.el-image-viewer__wrapper { |
||||
transform: translateY(-10px); |
||||
transition: transform .5s; |
||||
|
||||
&.active { |
||||
transform: translateY(0) |
||||
} |
||||
} |
||||
|
||||
.el-image-viewer__close { |
||||
z-index: 10000; |
||||
top: 15px; |
||||
right: 15px; |
||||
|
||||
&.doc-close { |
||||
i { |
||||
color: #000 !important; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.player { |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
transform: translate(-50%, -50%); |
||||
width: 1200px !important; |
||||
height: 600px !important; |
||||
} |
||||
|
||||
.fileIframe { |
||||
z-index: 1; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
bottom: 0; |
||||
right: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.mask { |
||||
z-index: 1000; |
||||
position: fixed; |
||||
background-color: rgb(57, 58, 61); |
||||
} |
||||
|
||||
.word-mask { |
||||
z-index: 1000; |
||||
position: fixed; |
||||
right: 0; |
||||
width: 100%; |
||||
background-color: rgb(243, 242, 241); |
||||
} |
||||
|
||||
.word-mask1 { |
||||
z-index: 1000; |
||||
position: fixed; |
||||
top: 0; |
||||
right: 0; |
||||
background-color: #2b579a; |
||||
} |
||||
|
||||
.word-mask2 { |
||||
z-index: 1000; |
||||
position: fixed; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.excel-mask1 { |
||||
z-index: 9; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 20%; |
||||
width: 80%; |
||||
background-color: #107c41; |
||||
} |
||||
</style> |
@ -1,222 +0,0 @@ |
||||
<template> |
||||
<!-- 课程管理 --> |
||||
<div style="padding-top: 24px"> |
||||
<div class="tool"> |
||||
<ul class="filter" style="align-items: flex-start"> |
||||
<li> |
||||
<label>课程分类:</label> |
||||
<el-select v-model="classificationId" clearable placeholder="请选择课程分类" @change="getData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索:</label> |
||||
<el-input placeholder="请输入课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button v-auth="'课程管理:新增'" type="info" round @click="addCourse">新增</el-button> |
||||
<el-button v-auth="'课程管理:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table :data="courseData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + (current - 1) * pageSize + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="课程名称"> |
||||
</el-table-column> |
||||
<el-table-column prop="gmtCreate" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="founder" label="创建人" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="章节数" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.chapterNum ? scope.row.chapterNum : 0 }}章({{ scope.row.subsectionNum ? scope.row.subsectionNum : 0 }}小节) |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="classification" label="课程分类"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="250"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'课程管理:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> |
||||
<el-divider v-auth="'课程管理:编辑信息'" direction="vertical"></el-divider> |
||||
<el-button v-auth="'课程管理:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> |
||||
<el-divider v-auth="'课程管理:内容设置'" direction="vertical"></el-divider> |
||||
<el-button v-auth="'课程管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> |
||||
<el-divider v-auth="'课程管理:预览'" direction="vertical"></el-divider> |
||||
<el-button v-auth="'课程管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="可授权状态" align="center" width="120"> |
||||
<template slot-scope="scope"> |
||||
<el-switch |
||||
v-auth="'课程管理:禁用'" |
||||
v-model="scope.row.isEnable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
style="margin: 0 5px" |
||||
:active-text="scope.row.isEnable ? '关' : '开'" |
||||
@change="switchOff($event,scope.row,scope.$index)" |
||||
></el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="current"> |
||||
</el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
|
||||
export default { |
||||
name: "courseManagement", |
||||
data() { |
||||
return { |
||||
keyword: "", |
||||
classificationId: "", |
||||
courseData: [], |
||||
multipleSelection: [], |
||||
classificationList: [], |
||||
current: +this.$route.query.page || 1, // 当前页码 |
||||
pageSize: 10, |
||||
totals: 0 |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getClassification(); |
||||
this.getData(); |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
classificationId: this.classificationId, |
||||
name: this.keyword |
||||
}; |
||||
this.$get(`${this.api.queryCourseByCondition}/${this.current}/${this.pageSize}`, data).then(res => { |
||||
this.courseData = res.courseList; |
||||
this.totals = res.total; |
||||
if (!this.courseData.length && this.totals) { |
||||
this.current--; |
||||
this.getData(); |
||||
} |
||||
}).catch(res => { |
||||
}); |
||||
}, |
||||
initData() { |
||||
this.current = 1; |
||||
this.getData(); |
||||
}, |
||||
getClassification() { |
||||
this.$get(this.api.queryGlClassification).then(res => { |
||||
this.classificationList = res.classificationList; |
||||
}).catch(res => { |
||||
}); |
||||
}, |
||||
changeType(type) { |
||||
this.classificationId = type; |
||||
this.initData(); |
||||
}, |
||||
preview(row) { |
||||
this.$router.push(`/course/preview?id=${row.id}`); |
||||
}, |
||||
config(row) { |
||||
this.$router.push(`/course/contentSettings?id=${row.id}`); |
||||
}, |
||||
addCourse() { |
||||
this.$router.push("/course/add"); |
||||
}, |
||||
editCourse(row) { |
||||
this.$router.push(`/course/add?id=${row.id}`); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.deleteCourse}/${row.id}`).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.initData(); |
||||
}).catch(res => { |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.customerId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllData() { |
||||
if (this.multipleSelection.length != "") { |
||||
let newArr = this.multipleSelection; |
||||
let delList = newArr.map(item => { |
||||
return item.id; |
||||
}); |
||||
this.$confirm(`此批量删除操作不可逆,是否确认删除${newArr[0].name}等${newArr.length}个选中项?`, "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
courseIds: delList.join() |
||||
}; |
||||
this.$del(this.api.deleteCourses, data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection(); |
||||
util.successMsg("删除成功"); |
||||
this.initData(); |
||||
}).catch(res => { |
||||
}); |
||||
if(this.multipleSelection.length === this.courseData.length && this.current>1) { |
||||
this.handleCurrentChange(this.current - 1) |
||||
} |
||||
}).catch(() => { |
||||
}); |
||||
} else { |
||||
util.errorMsg("请先选择数据 !"); |
||||
} |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.current = val; |
||||
this.$router.push(`list?page=${val}`) |
||||
this.getData(); |
||||
}, |
||||
switchOff(val, row, index) { |
||||
this.$put(`${this.api.enableCourse}?courseId=${row.id}&isEnable=${val}`) |
||||
.then(res => { |
||||
this.getData(); |
||||
val == 1 ? util.warningMsg("该教学资源已隐藏,对学生端用户不可见") : util.successMsg("该教学资源已公开,对学生端用户可见"); |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/ .tool { |
||||
.filter { |
||||
.el-input { |
||||
min-width: 215px; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -1,63 +0,0 @@ |
||||
<template> |
||||
<!-- 理论课程管理 --> |
||||
<div class="page"> |
||||
<div class="tabs"> |
||||
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> |
||||
</div> |
||||
<div class="page-content"> |
||||
<!-- 课程管理 --> |
||||
<CourseManagement v-if="active == 'first'" /> |
||||
<!-- 分类管理 --> |
||||
<SortManagement v-if="active == 'second'" /> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from "@/setting"; |
||||
import { mapState } from "vuex"; |
||||
import CourseManagement from "./courseManagement"; |
||||
import SortManagement from "./sortManagement"; |
||||
|
||||
export default { |
||||
name: "course", |
||||
components: { |
||||
CourseManagement, |
||||
SortManagement |
||||
}, |
||||
data() { |
||||
return { |
||||
active: "first", // 当前标签页 |
||||
tabs: { |
||||
first: "课程管理", |
||||
second: "分类管理" |
||||
}, |
||||
showTabs: true |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState("auth", [ |
||||
"btns" |
||||
]) |
||||
}, |
||||
mounted() { |
||||
Setting.dynamicRoute && this.initTabs(); |
||||
}, |
||||
methods: { |
||||
tabChange(index) { |
||||
this.active = index; |
||||
}, |
||||
initTabs() { |
||||
const { btns } = this |
||||
const tab1 = btns.includes('/course/list:课程管理') |
||||
const tab2 = btns.includes('/course/list:分类管理') |
||||
tab1 || delete this.tabs.first |
||||
tab2 || delete this.tabs.second |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
@ -1,166 +0,0 @@ |
||||
<template> |
||||
<!-- 分类管理 --> |
||||
<div> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
|
||||
</ul> |
||||
<div style="margin-top: 24px"> |
||||
<el-button v-auth="'分类管理:新增'" type="primary" round @click="addClass">新增</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="classificationList" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="课程分类名称"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="300"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'分类管理:修改'" type="text" @click="editClass(scope.row)">修改</el-button> |
||||
<el-divider v-auth="'分类管理:修改'" direction="vertical"></el-divider> |
||||
<el-button v-auth="'分类管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<el-dialog :title="isAddclass ? '添加分类' : '编辑分类'" :visible.sync="classVisible" width="400px" :close-on-click-modal="false" @close="closeColumn"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="分类名称" v-model="className"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="classVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="classSubmit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
|
||||
export default { |
||||
name: "sortManagement", |
||||
data() { |
||||
return { |
||||
classificationList: [], |
||||
multipleSelection: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
isAddclass: true, |
||||
classVisible: false, |
||||
curRow: {}, |
||||
className: "" |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.getData(); |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$get(this.api.queryGlClassification).then(res => { |
||||
this.classificationList = res.classificationList; |
||||
}).catch(res => { |
||||
}); |
||||
}, |
||||
addCourse() { |
||||
this.$router.push("/addcourse"); |
||||
}, |
||||
editCourse(row) { |
||||
this.$router.push(`/addcourse?id=${row.id}`); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.deleteClassification}/${row.id}`).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.customerId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
closeColumn() { |
||||
this.className = ""; |
||||
this.curRow = {}; |
||||
}, |
||||
delAllData() { |
||||
if (this.multipleSelection.length != "") { |
||||
let newArr = this.multipleSelection; |
||||
let delList = newArr.map(item => { |
||||
return item.id; |
||||
}); |
||||
// 批量删除 |
||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
let data = delList.join(); |
||||
this.$del(this.api.deleteClassification, data).then(res => { |
||||
this.multipleSelection = []; |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}).catch(() => { |
||||
}); |
||||
} else { |
||||
util.errorMsg("请先选择数据 !"); |
||||
} |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
addClass() { |
||||
this.isAddClass = true; |
||||
this.classVisible = true; |
||||
}, |
||||
editClass(row) { |
||||
this.curRow = row; |
||||
this.className = row.name; |
||||
this.isAddClass = false; |
||||
this.classVisible = true; |
||||
}, |
||||
classSubmit() { |
||||
if (!this.className) return util.warningMsg("请填写分类名称"); |
||||
let data = { |
||||
name: this.className |
||||
}; |
||||
if (this.curRow.id) { |
||||
data.id = this.curRow.id; |
||||
this.$put(this.api.editClassification, data).then(res => { |
||||
util.successMsg("修改成功"); |
||||
this.classVisible = false; |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
} else { |
||||
this.$post(`${this.api.addClassification}/${this.className}?distinguish=1`).then(res => { |
||||
util.successMsg("添加成功"); |
||||
this.classVisible = false; |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
@ -1,502 +0,0 @@ |
||||
<template> |
||||
<!-- 课程预览 --> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between"> |
||||
<el-page-header @back="goBack" :content="'课程预览'"></el-page-header> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="m-b-20" style="background: none;"> |
||||
<div class="flex"> |
||||
<div class="cover" :class="{'is-word': showMask1}"> |
||||
<img v-if="coverUrl" :src="coverUrl" alt="" width="100%" height="100%"> |
||||
<template v-else-if="iframeSrc"> |
||||
<iframe class="inner fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> |
||||
<template v-if="showMask"> |
||||
<div class="mask" style="width: 500px;height: 30px;top: 53px;right: 320px"></div> |
||||
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> |
||||
</template> |
||||
<template v-if="showMask1"> |
||||
<div class="word-mask" style="height: 40px;"></div> |
||||
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div> |
||||
</template> |
||||
<template v-if="showMask2"> |
||||
<div class="excel-mask1" style="height: 48px;"></div> |
||||
</template> |
||||
</template> |
||||
<div class="pdf inner" v-else-if="pdfSrc"> |
||||
<p class="arrow"> |
||||
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span> |
||||
{{ currentPage }} / {{ pageCount }} |
||||
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span> |
||||
</p> |
||||
<pdf |
||||
class="pdf-wrap" |
||||
:src="pdfSrc" |
||||
:page="currentPage" |
||||
@num-pages="pageCount=$event" |
||||
@page-loaded="currentPage=$event" |
||||
@loaded="loadPdfHandler"> |
||||
</pdf> |
||||
</div> |
||||
<div class="inner" v-else-if="playAuth"> |
||||
<div class="video_wid" id="player"></div> |
||||
</div> |
||||
</div> |
||||
<div class="catalog flex-1"> |
||||
<div class="list"> |
||||
<h4 class="title">{{ courseName }}</h4> |
||||
<div class="desc-wrap"> |
||||
<div class="desc" :class="{active: desShrink}" v-html="description"></div> |
||||
<i class="arrow" :class="{active: desShrink}" v-if="description.length > 40"> |
||||
<span>...</span> |
||||
<img src="@/assets/img/arrow-down.png" alt="" @click="desShrink = !desShrink"> |
||||
</i> |
||||
</div> |
||||
<div class="chapters"> |
||||
<template v-if="videoList.length"> |
||||
<div class="chapter" v-for="(item,index) in videoList" :key="index"> |
||||
<div class="chapterName">{{ item.name }}</div> |
||||
<div class="section" v-if="item.subsectionList.length"> |
||||
<div v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)"> |
||||
<p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import { mapState } from "vuex"; |
||||
import pdf from "vue-pdf"; |
||||
import "quill/dist/quill.core.css"; |
||||
import "quill/dist/quill.snow.css"; |
||||
import "quill/dist/quill.bubble.css"; |
||||
|
||||
export default { |
||||
name: "coursePreview", |
||||
data() { |
||||
return { |
||||
id: this.$route.query.id, |
||||
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", |
||||
videoSrc: "", |
||||
videoList: [], |
||||
courseName: "", |
||||
description: "", |
||||
coverUrl: "", |
||||
playAuth: "", |
||||
player: null, |
||||
previewImg: "", |
||||
iframeSrc: "", |
||||
isWord: false, |
||||
isPPT: false, |
||||
isExcel: false, |
||||
showMask: false, |
||||
showMask1: false, |
||||
showMask2: false, |
||||
closePosi: { |
||||
top: "80px" |
||||
}, |
||||
pdfVisible: false, |
||||
pdfSrc: "", |
||||
currentPage: 0, // pdf文件页码 |
||||
pageCount: 0, // pdf文件总页数 |
||||
fileType: "pdf", // 文件类型 |
||||
desShrink: false, |
||||
curLink: "", // 当前选中 |
||||
}; |
||||
}, |
||||
components: { pdf }, |
||||
mounted() { |
||||
this.insertScript(); |
||||
this.getData(); |
||||
this.getChapter(); |
||||
}, |
||||
methods: { |
||||
goBack() { |
||||
this.$router.back(); |
||||
}, |
||||
async getData() { |
||||
let res = await this.$get(`${this.api.getCourse}/${this.id}`); |
||||
this.courseName = res.course.name; |
||||
this.description = res.course.description; |
||||
this.coverUrl = res.course.coverUrl; |
||||
}, |
||||
async getChapter() { |
||||
let res = await this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`); |
||||
this.videoList = res.chapterList; |
||||
}, |
||||
insertScript() { |
||||
const linkTag = document.createElement("link"); |
||||
linkTag.rel = "stylesheet"; |
||||
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
||||
document.body.appendChild(linkTag); |
||||
|
||||
const scriptTag = document.createElement("script"); |
||||
scriptTag.type = "text/javascript"; |
||||
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; |
||||
document.body.appendChild(scriptTag); |
||||
}, |
||||
transferType(ext) { |
||||
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; |
||||
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; |
||||
return ext; |
||||
}, |
||||
preview(row, chapterName) { |
||||
this.curLink = `${chapterName}${row.name}`; |
||||
this.player = null; |
||||
this.playauth = ""; |
||||
this.coverUrl = ""; |
||||
this.pdfSrc = ""; |
||||
this.iframeSrc = ""; |
||||
if (this.transferType(row.fileType) == "视频") { |
||||
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
||||
this.playAuth = res.data.playAuth; |
||||
this.$nextTick(() => { |
||||
if (this.player) { |
||||
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); |
||||
} else { |
||||
this.player = new Aliplayer({ |
||||
id: "player", |
||||
width: "100%", |
||||
autoplay: false, |
||||
vid: row.fileId, |
||||
playauth: this.playAuth, |
||||
encryptType: 1 //当播放私有加密流时需要设置。 |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
}).catch(res => { |
||||
}); |
||||
} else if (this.transferType(row.fileType) == "图片") { |
||||
this.coverUrl = row.fileUrl; |
||||
} else if (row.fileType == "pdf") { |
||||
this.pdfSrc = row.fileUrl; |
||||
this.pdfVisible = true; |
||||
} else { |
||||
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { |
||||
if (row.fileType == "pptx") { |
||||
this.isPPT = true; |
||||
this.isWord = false; |
||||
this.isExcel = false; |
||||
} else if (row.fileType == "doc" || row.fileType == "docx") { |
||||
this.isPPT = false; |
||||
this.isWord = true; |
||||
this.isExcel = false; |
||||
} else if (row.fileType == "xls" || row.fileType == "xlsx") { |
||||
this.isExcel = true; |
||||
this.isPPT = false; |
||||
this.isWord = false; |
||||
} else { |
||||
this.isPPT = false; |
||||
this.isWord = false; |
||||
this.isExcel = false; |
||||
} |
||||
if (this.isPPT) { |
||||
this.showMask = true; |
||||
} else { |
||||
this.showMask = false; |
||||
} |
||||
if (this.isWord) { |
||||
this.showMask1 = true; |
||||
} else { |
||||
this.showMask1 = false; |
||||
} |
||||
if (this.isExcel) { |
||||
this.showMask2 = true; |
||||
} else { |
||||
this.showMask2 = false; |
||||
} |
||||
this.iframeSrc = res.previewUrl; |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
closePlayer() { |
||||
this.playAuth = ""; |
||||
this.player.pause(); |
||||
}, |
||||
closeIframe() { |
||||
this.iframeSrc = ""; |
||||
this.showMask = false; |
||||
this.showMask1 = false; |
||||
}, |
||||
closePdf() { |
||||
this.pdfSrc = ""; |
||||
this.currentPage = 1; |
||||
}, |
||||
changePdfPage(val) { |
||||
if (val === 0 && this.currentPage > 1) { |
||||
this.currentPage--; |
||||
} |
||||
if (val === 1 && this.currentPage < this.pageCount) { |
||||
this.currentPage++; |
||||
} |
||||
}, |
||||
loadPdfHandler(e) { |
||||
this.currentPage = 1; |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
$height: 700px; |
||||
.video_wid, .cover { |
||||
position: relative; |
||||
width: 76%; |
||||
max-width: 1400px; |
||||
height: $height !important; |
||||
border: 0; |
||||
} |
||||
|
||||
.cover { |
||||
img { |
||||
border-radius: 8px; |
||||
} |
||||
|
||||
&.is-word { |
||||
overflow: hidden; |
||||
} |
||||
} |
||||
|
||||
.fileIframe { |
||||
height: $height !important; |
||||
} |
||||
|
||||
.video_wid, .inner { |
||||
width: 100%; |
||||
height: 100% !important; |
||||
border: 0; |
||||
overflow: auto; |
||||
} |
||||
|
||||
.cover.is-word { |
||||
.inner { |
||||
height: calc(100% + 38px) !important; |
||||
margin-top: -38px; |
||||
} |
||||
} |
||||
|
||||
.video_wid:focus { |
||||
outline: none; |
||||
} |
||||
|
||||
.catalog { |
||||
margin-left: 40px; |
||||
} |
||||
|
||||
.list { |
||||
height: $height; |
||||
overflow-y: auto; |
||||
padding: 24px 16px; |
||||
background: #fff; |
||||
|
||||
.title { |
||||
margin-bottom: 8px; |
||||
color: rgba(0, 0, 0, 0.85); |
||||
font-size: 20px; |
||||
} |
||||
|
||||
.desc-wrap { |
||||
position: relative; |
||||
|
||||
.desc { |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
line-height: 22px; |
||||
@include mul-ellipsis(2); |
||||
|
||||
&.active { |
||||
display: block; |
||||
overflow: visible; |
||||
} |
||||
} |
||||
|
||||
.arrow { |
||||
position: absolute; |
||||
bottom: 2px; |
||||
right: 0; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
width: 46px; |
||||
background-color: #fff; |
||||
|
||||
span { |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
} |
||||
|
||||
img { |
||||
width: 16px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
&.active { |
||||
span { |
||||
opacity: 0; |
||||
} |
||||
|
||||
img { |
||||
transform: rotate(180deg); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.chapters { |
||||
margin-top: 16px; |
||||
max-height: calc(100% - 53px); |
||||
overflow: auto; |
||||
} |
||||
|
||||
.chapter { |
||||
margin-bottom: 20px; |
||||
|
||||
.chapterName { |
||||
color: rgba(0, 0, 0, 0.85); |
||||
font-size: 16px; |
||||
} |
||||
|
||||
.section { |
||||
padding: 5px 15px; |
||||
margin-top: 8px; |
||||
background: rgba(0, 0, 0, 0.02); |
||||
|
||||
.sectionName { |
||||
margin: 10px 0; |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
cursor: pointer; |
||||
@include ellipsis; |
||||
&.active{ |
||||
color: #9278FF; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.el-image-viewer__wrapper { |
||||
transform: translateY(-10px); |
||||
transition: transform .5s; |
||||
|
||||
&.active { |
||||
transform: translateY(0) |
||||
} |
||||
} |
||||
|
||||
.el-image-viewer__close { |
||||
z-index: 2000; |
||||
top: 15px; |
||||
right: 15px; |
||||
|
||||
&.doc-close { |
||||
i { |
||||
color: #000 !important; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.list::-webkit-scrollbar { |
||||
width: 4px; |
||||
} |
||||
|
||||
.list::-webkit-scrollbar-thumb { |
||||
border-radius: 10px; |
||||
background: rgba(0, 0, 0, 0.06); |
||||
} |
||||
|
||||
.mask { |
||||
z-index: 9; |
||||
position: absolute; |
||||
background-color: rgb(57, 58, 61); |
||||
} |
||||
|
||||
.word-mask { |
||||
z-index: 9; |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
width: 100%; |
||||
background-color: rgb(243, 242, 241); |
||||
} |
||||
|
||||
.word-mask1 { |
||||
z-index: 9; |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
width: 100%; |
||||
background-color: #185abd; |
||||
} |
||||
|
||||
.word-mask2 { |
||||
z-index: 9; |
||||
position: absolute; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.excel-mask1 { |
||||
z-index: 9; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 20%; |
||||
width: 60%; |
||||
background-color: #107c41; |
||||
} |
||||
|
||||
/deep/ .pdf-dia { |
||||
border-radius: 0 !important; |
||||
|
||||
.el-dialog__header { |
||||
display: none; |
||||
} |
||||
|
||||
.el-dialog__body { |
||||
padding: 0; |
||||
} |
||||
|
||||
.el-dialog__headerbtn { |
||||
top: 10px; |
||||
|
||||
.el-dialog__close { |
||||
color: #fff; |
||||
font-size: 16px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.pdf { |
||||
.arrow { |
||||
padding: 10px 0; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
font-size: 16px; |
||||
color: #fff; |
||||
background-color: #333; |
||||
|
||||
.turn { |
||||
margin: 0 10px; |
||||
font-size: 18px; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
|
||||
.pdf-wrap { |
||||
width: 80%; |
||||
margin: 0 auto; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue