|
|
@ -1,95 +1,171 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-page-header @back="goBack" :content="sorting? '更改排序' : '内容设置'"></el-page-header> |
|
|
|
<el-page-header @back="goBack" |
|
|
|
|
|
|
|
:content="sorting? '更改排序' : '内容设置'"></el-page-header> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
<!--内容设置--> |
|
|
|
<!--内容设置--> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20"> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<div class="relative"> |
|
|
|
<div class="relative"> |
|
|
|
<div class="p-title">内容设置</div> |
|
|
|
<div class="p-title">内容设置</div> |
|
|
|
<div class="btns" style="top: -10px"> |
|
|
|
<div class="btns" |
|
|
|
|
|
|
|
style="top: -10px"> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:添加章节'" type="primary" round @click="addChapter">添加章节</el-button> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:添加章节'" |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:编辑顺序'" type="primary" round @click="sort">编辑顺序</el-button> |
|
|
|
type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="addChapter">添加章节</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:编辑顺序'" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="sort">编辑顺序</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<el-button type="primary" round @click="move">批量移动</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" round @click="cancelSort">取消</el-button> |
|
|
|
round |
|
|
|
<el-button type="primary" round @click="saveSort">保存</el-button> |
|
|
|
@click="move">批量移动</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="cancelSort">取消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="saveSort">保存</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-divider></el-divider> |
|
|
|
<el-divider></el-divider> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="m-b-20" v-for="(chapter,index) in chapters" :key="chapter.id"> |
|
|
|
<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 class="flex j-between a-center m-b-10"> |
|
|
|
<div>{{ chapter.name }}</div> |
|
|
|
<div>{{ chapter.name }}</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:修改章节名称'" class="action-btn" type="primary" round @click="editChapter(chapter)">修改章节名称</el-button> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:修改章节名称'" |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:添加小节'" class="action-btn" type="primary" round @click="addSection(chapter.id)">添加小节</el-button> |
|
|
|
class="action-btn" |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:章节删除'" class="action-btn" type="primary" round @click="delChapter(chapter.id)">删除</el-button> |
|
|
|
type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="editChapter(chapter)">修改章节名称</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:添加小节'" |
|
|
|
|
|
|
|
class="action-btn" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="addSection(chapter.id)">添加小节</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:章节删除'" |
|
|
|
|
|
|
|
class="action-btn" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="delChapter(chapter.id)">删除</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<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-top sort-icon" |
|
|
|
<i class="el-icon-bottom sort-icon" :class="{disabled: index == chapters.length-1}" @click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i> |
|
|
|
: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> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="chapter.subsectionList" class="table" stripe header-align="center"> |
|
|
|
<el-table :data="chapter.subsectionList" |
|
|
|
<el-table-column v-if="sorting" width="55" align="center"> |
|
|
|
class="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
|
|
<el-table-column v-if="sorting" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-checkbox v-model="scope.row.check"></el-checkbox> |
|
|
|
<el-checkbox v-model="scope.row.check"></el-checkbox> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" |
|
|
|
<el-table-column prop="name" label="资源名称" min-width="200"> |
|
|
|
width="100" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="name" |
|
|
|
|
|
|
|
label="资源名称" |
|
|
|
|
|
|
|
min-width="200"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="fileType" label="资源类型" min-width="120" align="center"> |
|
|
|
<el-table-column prop="fileType" |
|
|
|
|
|
|
|
label="资源类型" |
|
|
|
|
|
|
|
min-width="120" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ transferType(scope.row.fileType) }} |
|
|
|
{{ transferType(scope.row.fileType) }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="fileType" label="格式" min-width="120" align="center"> |
|
|
|
<el-table-column prop="fileType" |
|
|
|
|
|
|
|
label="格式" |
|
|
|
|
|
|
|
min-width="120" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="300"> |
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<template v-if="!sorting"> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:查看'" type="text" @click="preview(scope.row)">查看</el-button> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:查看'" |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:小节删除'" type="text" @click="delSection(scope.row)">删除</el-button> |
|
|
|
type="text" |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:修改小节名称'" type="text" @click="editSectionName(scope.row,chapter.id)">修改小节名称</el-button> |
|
|
|
@click="preview(scope.row)">查看</el-button> |
|
|
|
<el-button v-auth="'/course/list:课程管理:内容设置:更换文件'" type="text" @click="switchFile(scope.row,chapter.id)">更换文件</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> |
|
|
|
<template v-else> |
|
|
|
<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-top sort-icon" |
|
|
|
<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> |
|
|
|
: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> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="540px" :close-on-click-modal="false"> |
|
|
|
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" |
|
|
|
|
|
|
|
:visible.sync="chapterVisible" |
|
|
|
|
|
|
|
width="540px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-form> |
|
|
|
<el-form> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input> |
|
|
|
<el-input placeholder="请输入章节名称,便于对小节归类" |
|
|
|
|
|
|
|
v-model="chapterName" |
|
|
|
|
|
|
|
maxlength="50"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="chapterVisible = false">取消</el-button> |
|
|
|
<el-button @click="chapterVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="chapterSubmit">确定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="chapterSubmit">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="添加小节" |
|
|
|
|
|
|
|
:visible.sync="sectionVisible" |
|
|
|
|
|
|
|
width="540px" |
|
|
|
|
|
|
|
@close="closeSection" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form-item label="资源添加"> |
|
|
|
<el-form-item label="资源添加"> |
|
|
|
<el-upload |
|
|
|
<el-upload :before-upload="beforeUpload" |
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
:on-success="uploadSuccess" |
|
|
@ -100,27 +176,37 @@ |
|
|
|
:file-list="uploadList" |
|
|
|
:file-list="uploadList" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers" |
|
|
|
:http-request="handleRequest" |
|
|
|
:http-request="handleRequest" |
|
|
|
name="file" |
|
|
|
name="file"> |
|
|
|
> |
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
<div slot="tip" class="el-upload__tip">视频请上传MP4格式,大小不超过30M;office文件大小不要超过10M</div> |
|
|
|
<div slot="tip" |
|
|
|
|
|
|
|
class="el-upload__tip">视频请上传MP4格式,大小不超过30M;office文件大小不要超过10M</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> |
|
|
|
<el-progress v-if="showProgress" |
|
|
|
|
|
|
|
:stroke-width="3" |
|
|
|
|
|
|
|
:percentage="progressPercent"></el-progress> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="小节名称"> |
|
|
|
<el-form-item label="小节名称"> |
|
|
|
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
|
|
|
<el-input placeholder="请输入小节名称" |
|
|
|
|
|
|
|
v-model="sectionName" |
|
|
|
|
|
|
|
maxlength="50"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="sectionVisible = false">取消</el-button> |
|
|
|
<el-button @click="sectionVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="sectionSubmit">确定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="sectionSubmit">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false" @close="closeSwitch"> |
|
|
|
<el-dialog title="更换文件" |
|
|
|
|
|
|
|
:visible.sync="switchVisible" |
|
|
|
|
|
|
|
width="540px" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
@close="closeSwitch"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<el-upload |
|
|
|
<el-upload :before-upload="beforeUpload" |
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
:on-success="uploadSuccess" |
|
|
@ -131,83 +217,139 @@ |
|
|
|
:file-list="uploadList" |
|
|
|
:file-list="uploadList" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers" |
|
|
|
:http-request="handleRequest" |
|
|
|
:http-request="handleRequest" |
|
|
|
name="file" |
|
|
|
name="file"> |
|
|
|
> |
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> |
|
|
|
<el-progress v-if="showProgress" |
|
|
|
|
|
|
|
:stroke-width="3" |
|
|
|
|
|
|
|
:percentage="progressPercent"></el-progress> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="switchVisible = false">取消</el-button> |
|
|
|
<el-button @click="switchVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="switchSubmit">确定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="switchSubmit">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="修改小节名称" |
|
|
|
|
|
|
|
:visible.sync="sectionNameVisible" |
|
|
|
|
|
|
|
width="540px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-form> |
|
|
|
<el-form> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
|
|
|
<el-input placeholder="请输入小节名称" |
|
|
|
|
|
|
|
v-model="sectionName" |
|
|
|
|
|
|
|
maxlength="50"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="sectionNameVisible = false">取消</el-button> |
|
|
|
<el-button @click="sectionNameVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="sectionNameSubmit">确定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="sectionNameSubmit">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{active: previewImg}" style="z-index: 2000"> |
|
|
|
<div v-show="previewImg" |
|
|
|
|
|
|
|
class="el-image-viewer__wrapper" |
|
|
|
|
|
|
|
:class="{active: previewImg}" |
|
|
|
|
|
|
|
style="z-index: 2000"> |
|
|
|
<div class="el-image-viewer__mask"></div> |
|
|
|
<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> |
|
|
|
<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"> |
|
|
|
<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%;"> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
<div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}" style="z-index: 2000"> |
|
|
|
<div v-show="iframeSrc" |
|
|
|
|
|
|
|
class="el-image-viewer__wrapper" |
|
|
|
|
|
|
|
:class="{active: iframeSrc}" |
|
|
|
|
|
|
|
style="z-index: 2000"> |
|
|
|
<div class="el-image-viewer__mask"></div> |
|
|
|
<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> |
|
|
|
<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"> |
|
|
|
<div class="el-image-viewer__canvas"> |
|
|
|
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> |
|
|
|
<iframe v-if="iframeSrc" |
|
|
|
|
|
|
|
class="fileIframe" |
|
|
|
|
|
|
|
id="fileIframe" |
|
|
|
|
|
|
|
:src="iframeSrc" |
|
|
|
|
|
|
|
frameborder="0"></iframe> |
|
|
|
<template v-if="showMask"> |
|
|
|
<template v-if="showMask"> |
|
|
|
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div> |
|
|
|
<div class="mask" |
|
|
|
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> |
|
|
|
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> |
|
|
|
<template v-if="showMask1"> |
|
|
|
<template v-if="showMask1"> |
|
|
|
<div class="word-mask1" style="width: 200px;height: 50px;"></div> |
|
|
|
<div class="word-mask1" |
|
|
|
<div class="word-mask" style="height: 40px;top: 48px;"></div> |
|
|
|
style="width: 200px;height: 50px;"></div> |
|
|
|
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></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> |
|
|
|
<template v-if="showMask2 && iframeSrc"> |
|
|
|
<template v-if="showMask2 && iframeSrc"> |
|
|
|
<div class="excel-mask1" style="height: 48px;"></div> |
|
|
|
<div class="excel-mask1" |
|
|
|
|
|
|
|
style="height: 48px;"></div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}" style="z-index: 2000"> |
|
|
|
<div v-show="playAuth" |
|
|
|
|
|
|
|
class="el-image-viewer__wrapper" |
|
|
|
|
|
|
|
:class="{active: playAuth}" |
|
|
|
|
|
|
|
style="z-index: 2000"> |
|
|
|
<div class="el-image-viewer__mask"></div> |
|
|
|
<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> |
|
|
|
<span class="el-image-viewer__btn el-image-viewer__close" |
|
|
|
<div class="player" id="player"></div> |
|
|
|
@click="closePlayer"><i class="el-icon-circle-close" |
|
|
|
|
|
|
|
style="color: #fff"></i></span> |
|
|
|
|
|
|
|
<div class="player" |
|
|
|
|
|
|
|
id="player"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf> |
|
|
|
<pdf :visible.sync="pdfVisible" |
|
|
|
|
|
|
|
:src.sync="pdfSrc"></pdf> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="资源移动" :visible.sync="moveVisible" :close-on-click-modal="false" width="330px"> |
|
|
|
<el-dialog title="资源移动" |
|
|
|
|
|
|
|
:visible.sync="moveVisible" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
width="330px"> |
|
|
|
<el-form> |
|
|
|
<el-form> |
|
|
|
<el-form-item label="目标章节"> |
|
|
|
<el-form-item label="目标章节"> |
|
|
|
<el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange"> |
|
|
|
<el-select v-model="moveForm.id" |
|
|
|
<el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
placeholder="请选择目标章节" |
|
|
|
|
|
|
|
@change="chapterChange"> |
|
|
|
|
|
|
|
<el-option v-for="(item, i) in chapters" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="目标排序"> |
|
|
|
<el-form-item label="目标排序"> |
|
|
|
<el-select v-model="moveForm.sort" placeholder="请选择目标排序"> |
|
|
|
<el-select v-model="moveForm.sort" |
|
|
|
<el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
placeholder="请选择目标排序"> |
|
|
|
|
|
|
|
<el-option v-for="(item, i) in sortList" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="moveVisible = false">取消</el-button> |
|
|
|
<el-button @click="moveVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="moveConfirm">确定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="moveConfirm">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -222,7 +364,7 @@ import axios from 'axios' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "contentSettings", |
|
|
|
name: "contentSettings", |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
@ -284,7 +426,7 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { pdf }, |
|
|
|
components: { pdf }, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.insertScript(); |
|
|
|
this.insertScript(); |
|
|
|
this.id = this.$route.query.id; |
|
|
|
this.id = this.$route.query.id; |
|
|
|
this.id && this.getData(); |
|
|
|
this.id && this.getData(); |
|
|
@ -294,11 +436,11 @@ export default { |
|
|
|
window.addEventListener("popstate", this.goBack, false); |
|
|
|
window.addEventListener("popstate", this.goBack, false); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
destroyed () { |
|
|
|
window.removeEventListener("popstate", this.goBack, false); |
|
|
|
window.removeEventListener("popstate", this.goBack, false); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
this.$get(`${this.api.queryChaptersAndSubsections}?courseId=${this.id}`) |
|
|
|
this.$get(`${this.api.queryChaptersAndSubsections}?courseId=${this.id}`) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
this.chapters = res.chapterList; |
|
|
|
this.chapters = res.chapterList; |
|
|
@ -307,7 +449,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
goBack() { |
|
|
|
goBack () { |
|
|
|
// 如果是预览则关闭预览 |
|
|
|
// 如果是预览则关闭预览 |
|
|
|
if (this.previewing) { |
|
|
|
if (this.previewing) { |
|
|
|
this.closeIframe(); |
|
|
|
this.closeIframe(); |
|
|
@ -333,7 +475,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
iframeOnload() { |
|
|
|
iframeOnload () { |
|
|
|
document.querySelector("#fileIframe").onload = e => { |
|
|
|
document.querySelector("#fileIframe").onload = e => { |
|
|
|
if (this.isPPT) { |
|
|
|
if (this.isPPT) { |
|
|
|
this.showMask = true; |
|
|
|
this.showMask = true; |
|
|
@ -353,7 +495,7 @@ export default { |
|
|
|
this.loadIns.close(); |
|
|
|
this.loadIns.close(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
insertScript() { |
|
|
|
insertScript () { |
|
|
|
const linkTag = document.createElement("link"); |
|
|
|
const linkTag = document.createElement("link"); |
|
|
|
linkTag.rel = "stylesheet"; |
|
|
|
linkTag.rel = "stylesheet"; |
|
|
|
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
|
|
|
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
|
|
@ -365,7 +507,7 @@ export default { |
|
|
|
document.body.appendChild(scriptTag); |
|
|
|
document.body.appendChild(scriptTag); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上传文件 |
|
|
|
// 上传文件 |
|
|
|
beforeUpload(file) { |
|
|
|
beforeUpload (file) { |
|
|
|
let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1)); |
|
|
|
let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1)); |
|
|
|
if (type != "视频" && type != "图片" && type != "pdf" && (file.size / 1024 / 1024) > 10) { |
|
|
|
if (type != "视频" && type != "图片" && type != "pdf" && (file.size / 1024 / 1024) > 10) { |
|
|
|
util.errorMsg("请上传10M以内的文件"); |
|
|
|
util.errorMsg("请上传10M以内的文件"); |
|
|
@ -381,13 +523,13 @@ export default { |
|
|
|
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); |
|
|
|
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); |
|
|
|
this.showProgress = true |
|
|
|
this.showProgress = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleExceed(files, fileList) { |
|
|
|
handleExceed (files, fileList) { |
|
|
|
util.warningMsg( |
|
|
|
util.warningMsg( |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 自定义上传 |
|
|
|
// 自定义上传 |
|
|
|
handleRequest(data) { |
|
|
|
handleRequest (data) { |
|
|
|
const param = new FormData() |
|
|
|
const param = new FormData() |
|
|
|
param.append('file', data.file) |
|
|
|
param.append('file', data.file) |
|
|
|
const config = { |
|
|
|
const config = { |
|
|
@ -400,7 +542,6 @@ export default { |
|
|
|
// 获取上传进度,自带的组件上传进度不准确 |
|
|
|
// 获取上传进度,自带的组件上传进度不准确 |
|
|
|
onUploadProgress: progressEvent => { |
|
|
|
onUploadProgress: progressEvent => { |
|
|
|
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2)) |
|
|
|
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2)) |
|
|
|
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent) |
|
|
|
|
|
|
|
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per |
|
|
|
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -415,55 +556,55 @@ export default { |
|
|
|
this.fileName = ossFileName |
|
|
|
this.fileName = ossFileName |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
this.uploading = false; |
|
|
|
this.uploading = false; |
|
|
|
this.fileId = res.data.filesResult.fileId; |
|
|
|
this.fileId = res.data.filesResult.fileId; |
|
|
|
this.fileType = res.data.filesResult.fileType; |
|
|
|
this.fileType = res.data.filesResult.fileType; |
|
|
|
this.fileUrl = res.data.filesResult.fileUrl; |
|
|
|
this.fileUrl = res.data.filesResult.fileUrl; |
|
|
|
this.fileName = res.data.filesResult.ossFileName; |
|
|
|
this.fileName = res.data.filesResult.ossFileName; |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError (err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
message: "上传出错,请重试!", |
|
|
|
message: "上传出错,请重试!", |
|
|
|
type: "error", |
|
|
|
type: "error", |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
if ((file.size / 1024 / 1024) < 10) { |
|
|
|
if ((file.size / 1024 / 1024) < 10) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove(file, fileList) { |
|
|
|
handleRemove (file, fileList) { |
|
|
|
this.uploadList = fileList; |
|
|
|
this.uploadList = fileList; |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSure() { |
|
|
|
uploadSure () { |
|
|
|
this.importVisible = false; |
|
|
|
this.importVisible = false; |
|
|
|
this.pageNo = 1; |
|
|
|
this.pageNo = 1; |
|
|
|
this.staffGradeId = ""; |
|
|
|
this.staffGradeId = ""; |
|
|
|
this.keyword = ""; |
|
|
|
this.keyword = ""; |
|
|
|
this.getTeacher(); |
|
|
|
this.getTeacher(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
goback() { |
|
|
|
goback () { |
|
|
|
this.$router.push("course"); |
|
|
|
this.$router.push("course"); |
|
|
|
}, |
|
|
|
}, |
|
|
|
transferType(ext) { |
|
|
|
transferType (ext) { |
|
|
|
const suf = ext.toLowerCase() |
|
|
|
const suf = ext.toLowerCase() |
|
|
|
if ("jpg,jpeg,png,gif,svg,psd".includes(suf)) return "图片"; |
|
|
|
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 "视频"; |
|
|
|
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(suf)) return "视频"; |
|
|
|
return suf; |
|
|
|
return suf; |
|
|
|
}, |
|
|
|
}, |
|
|
|
addChapter() { |
|
|
|
addChapter () { |
|
|
|
this.chapterName = ""; |
|
|
|
this.chapterName = ""; |
|
|
|
this.chapterId = ""; |
|
|
|
this.chapterId = ""; |
|
|
|
this.chapterVisible = true; |
|
|
|
this.chapterVisible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
sort() { |
|
|
|
sort () { |
|
|
|
this.originChapters = JSON.parse(JSON.stringify(this.chapters)) |
|
|
|
this.originChapters = JSON.parse(JSON.stringify(this.chapters)) |
|
|
|
this.sorting = true; |
|
|
|
this.sorting = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量移动 |
|
|
|
// 批量移动 |
|
|
|
move() { |
|
|
|
move () { |
|
|
|
const list = this.chapters |
|
|
|
const list = this.chapters |
|
|
|
const checkList = [] |
|
|
|
const checkList = [] |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
@ -493,13 +634,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 目标章节选择回调 |
|
|
|
// 目标章节选择回调 |
|
|
|
chapterChange(id) { |
|
|
|
chapterChange (id) { |
|
|
|
const list = [] |
|
|
|
const list = [] |
|
|
|
// 获取多少个小节 |
|
|
|
// 获取多少个小节 |
|
|
|
this.chapters.find(e => e.id === id).subsectionList.map((e, i) => { |
|
|
|
this.chapters.find(e => e.id === id).subsectionList.map((e, i) => { |
|
|
|
list.push({ |
|
|
|
list.push({ |
|
|
|
id: i, |
|
|
|
id: i, |
|
|
|
name: i+1 |
|
|
|
name: i + 1 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 置末和置顶写死 |
|
|
|
// 置末和置顶写死 |
|
|
@ -516,7 +657,7 @@ export default { |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 资源移动校验 |
|
|
|
// 资源移动校验 |
|
|
|
moveConfirm() { |
|
|
|
moveConfirm () { |
|
|
|
let { id, sort } = this.moveForm |
|
|
|
let { id, sort } = this.moveForm |
|
|
|
if (!id) return this.$message.warning('请选择目标章节') |
|
|
|
if (!id) return this.$message.warning('请选择目标章节') |
|
|
|
if (sort === '') return this.$message.warning('请选择目标排序') |
|
|
|
if (sort === '') return this.$message.warning('请选择目标排序') |
|
|
@ -539,11 +680,11 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.moved = true |
|
|
|
this.moved = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancelSort() { |
|
|
|
cancelSort () { |
|
|
|
this.chapters = JSON.parse(JSON.stringify(this.originChapters)) |
|
|
|
this.chapters = JSON.parse(JSON.stringify(this.originChapters)) |
|
|
|
this.sorting = false; |
|
|
|
this.sorting = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
saveSort() { |
|
|
|
saveSort () { |
|
|
|
this.chapters.forEach((n, k) => { |
|
|
|
this.chapters.forEach((n, k) => { |
|
|
|
n.sort = k + 1; |
|
|
|
n.sort = k + 1; |
|
|
|
n.subsectionList.forEach((j, i) => { |
|
|
|
n.subsectionList.forEach((j, i) => { |
|
|
@ -559,12 +700,12 @@ export default { |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
editChapter(item) { |
|
|
|
editChapter (item) { |
|
|
|
this.chapterId = item.id; |
|
|
|
this.chapterId = item.id; |
|
|
|
this.chapterName = item.name; |
|
|
|
this.chapterName = item.name; |
|
|
|
this.chapterVisible = true; |
|
|
|
this.chapterVisible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
delChapter(id) { |
|
|
|
delChapter (id) { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
@ -578,10 +719,10 @@ export default { |
|
|
|
.catch(() => { |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeSection() { |
|
|
|
closeSection () { |
|
|
|
this.isAddSection = false; |
|
|
|
this.isAddSection = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
addSection(id) { |
|
|
|
addSection (id) { |
|
|
|
this.chapterId = id; |
|
|
|
this.chapterId = id; |
|
|
|
this.sectionName = ""; |
|
|
|
this.sectionName = ""; |
|
|
|
this.fileUrl = ""; |
|
|
|
this.fileUrl = ""; |
|
|
@ -590,7 +731,7 @@ export default { |
|
|
|
this.isAddSection = true; |
|
|
|
this.isAddSection = true; |
|
|
|
this.sectionVisible = true; |
|
|
|
this.sectionVisible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
chapterSubmit() { |
|
|
|
chapterSubmit () { |
|
|
|
if (!this.chapterName) return util.warningMsg("请填写章节名称"); |
|
|
|
if (!this.chapterName) return util.warningMsg("请填写章节名称"); |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
courseId: this.id, |
|
|
|
courseId: this.id, |
|
|
@ -615,7 +756,7 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
sectionSubmit() { |
|
|
|
sectionSubmit () { |
|
|
|
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
|
|
|
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
|
|
|
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
|
|
|
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
|
|
|
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
|
|
|
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
|
|
@ -638,14 +779,14 @@ export default { |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeSwitch() { |
|
|
|
closeSwitch () { |
|
|
|
this.fileId = ""; |
|
|
|
this.fileId = ""; |
|
|
|
this.fileName = ""; |
|
|
|
this.fileName = ""; |
|
|
|
this.fileType = ""; |
|
|
|
this.fileType = ""; |
|
|
|
this.fileUrl = ""; |
|
|
|
this.fileUrl = ""; |
|
|
|
this.sectionId = ""; |
|
|
|
this.sectionId = ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
preview(row) { |
|
|
|
preview (row) { |
|
|
|
if (this.transferType(row.fileType) == "视频") { |
|
|
|
if (this.transferType(row.fileType) == "视频") { |
|
|
|
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
|
|
|
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
|
|
|
this.playAuth = res.data.playAuth; |
|
|
|
this.playAuth = res.data.playAuth; |
|
|
@ -699,13 +840,13 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
editSectionName(row, chapterId) { |
|
|
|
editSectionName (row, chapterId) { |
|
|
|
this.chapterId = chapterId; |
|
|
|
this.chapterId = chapterId; |
|
|
|
this.sectionId = row.id; |
|
|
|
this.sectionId = row.id; |
|
|
|
this.sectionName = row.name; |
|
|
|
this.sectionName = row.name; |
|
|
|
this.sectionNameVisible = true; |
|
|
|
this.sectionNameVisible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchFile(row, chapterId, sectionId) { |
|
|
|
switchFile (row, chapterId, sectionId) { |
|
|
|
this.uploadList = []; |
|
|
|
this.uploadList = []; |
|
|
|
this.curFile = { |
|
|
|
this.curFile = { |
|
|
|
fileId: row.fileId, |
|
|
|
fileId: row.fileId, |
|
|
@ -719,7 +860,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
this.switchVisible = true; |
|
|
|
this.switchVisible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchSubmitFile() { |
|
|
|
switchSubmitFile () { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
id: this.sectionId, |
|
|
|
id: this.sectionId, |
|
|
|
courseId: this.id, |
|
|
|
courseId: this.id, |
|
|
@ -739,7 +880,7 @@ export default { |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchSubmit() { |
|
|
|
switchSubmit () { |
|
|
|
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
|
|
|
if (this.uploading) return util.warningMsg("资源正在上传中,请稍候"); |
|
|
|
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
|
|
|
if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源"); |
|
|
|
if (this.transferType(this.curFile.fileType) == "视频") { |
|
|
|
if (this.transferType(this.curFile.fileType) == "视频") { |
|
|
@ -757,7 +898,7 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
delSection(row) { |
|
|
|
delSection (row) { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
@ -771,7 +912,7 @@ export default { |
|
|
|
.catch(() => { |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
sortChapter(row, type, disabled, index) { |
|
|
|
sortChapter (row, type, disabled, index) { |
|
|
|
if (!disabled) { |
|
|
|
if (!disabled) { |
|
|
|
if (type == "up") { |
|
|
|
if (type == "up") { |
|
|
|
let tempItem = this.chapters.splice(index - 1, 1)[0]; |
|
|
|
let tempItem = this.chapters.splice(index - 1, 1)[0]; |
|
|
@ -782,7 +923,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
sortSection(chapterIndex, type, disabled, index) { |
|
|
|
sortSection (chapterIndex, type, disabled, index) { |
|
|
|
if (!disabled) { |
|
|
|
if (!disabled) { |
|
|
|
this.moved = true |
|
|
|
this.moved = true |
|
|
|
let list = this.chapters[chapterIndex].subsectionList; |
|
|
|
let list = this.chapters[chapterIndex].subsectionList; |
|
|
@ -797,7 +938,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
sectionNameSubmit() { |
|
|
|
sectionNameSubmit () { |
|
|
|
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
|
|
|
if (!this.sectionName) return util.warningMsg("请填写小节名称"); |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
id: this.sectionId, |
|
|
|
id: this.sectionId, |
|
|
@ -813,11 +954,11 @@ export default { |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closePlayer() { |
|
|
|
closePlayer () { |
|
|
|
this.playAuth = ""; |
|
|
|
this.playAuth = ""; |
|
|
|
this.player.pause(); |
|
|
|
this.player.pause(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeIframe() { |
|
|
|
closeIframe () { |
|
|
|
this.iframeSrc = ""; |
|
|
|
this.iframeSrc = ""; |
|
|
|
this.showMask = false; |
|
|
|
this.showMask = false; |
|
|
|
this.showMask1 = false; |
|
|
|
this.showMask1 = false; |
|
|
@ -855,16 +996,16 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
&.disabled { |
|
|
|
&.disabled { |
|
|
|
color: #ccc; |
|
|
|
color: #ccc; |
|
|
|
cursor: not-allowed |
|
|
|
cursor: not-allowed; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-image-viewer__wrapper { |
|
|
|
.el-image-viewer__wrapper { |
|
|
|
transform: translateY(-10px); |
|
|
|
transform: translateY(-10px); |
|
|
|
transition: transform .5s; |
|
|
|
transition: transform 0.5s; |
|
|
|
|
|
|
|
|
|
|
|
&.active { |
|
|
|
&.active { |
|
|
|
transform: translateY(0) |
|
|
|
transform: translateY(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|