|
|
|
@ -1,94 +1,167 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="mgb20"> |
|
|
|
|
<div class="flex-between"> |
|
|
|
|
<el-page-header @back="goBack" :content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header> |
|
|
|
|
<el-page-header @back="goBack" |
|
|
|
|
:content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<!--内容设置--> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="mgb20"> |
|
|
|
|
<div class="page"> |
|
|
|
|
<div class="relative"> |
|
|
|
|
<div class="p-title">内容设置</div> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<template v-if="!sorting"> |
|
|
|
|
<el-button type="primary" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button> |
|
|
|
|
<el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="addChapter" |
|
|
|
|
v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="sort" |
|
|
|
|
v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-button type="primary" round @click="move">批量移动</el-button> |
|
|
|
|
<el-button type="primary" round @click="cancelSort">取消</el-button> |
|
|
|
|
<el-button type="primary" round @click="saveSort">保存</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="move">批量移动</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="cancelSort">取消</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="saveSort">保存</el-button> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-divider></el-divider> |
|
|
|
|
<div class="page-content"> |
|
|
|
|
<div class="mgb20" v-for="(chapter,index) in chapters" :key="chapter.id"> |
|
|
|
|
<div class="mgb20" |
|
|
|
|
v-for="(chapter,index) in chapters" |
|
|
|
|
:key="chapter.id"> |
|
|
|
|
<div class="flex-between mgb10"> |
|
|
|
|
<div>{{ chapter.name }}</div> |
|
|
|
|
<div> |
|
|
|
|
<template v-if="!sorting"> |
|
|
|
|
<el-button class="action-btn" plain @click="editChapter(chapter)" v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button> |
|
|
|
|
<el-button class="action-btn" plain @click="addSection(chapter.id)" v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button> |
|
|
|
|
<el-button class="action-btn" plain @click="delChapter(chapter.id)" v-auth="'/curriculum:内容设置:删除章节'">删除</el-button> |
|
|
|
|
<el-button class="action-btn" |
|
|
|
|
plain |
|
|
|
|
@click="editChapter(chapter)" |
|
|
|
|
v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button> |
|
|
|
|
<el-button class="action-btn" |
|
|
|
|
plain |
|
|
|
|
@click="addSection(chapter.id)" |
|
|
|
|
v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button> |
|
|
|
|
<el-button class="action-btn" |
|
|
|
|
plain |
|
|
|
|
@click="delChapter(chapter.id)" |
|
|
|
|
v-auth="'/curriculum:内容设置:删除章节'">删除</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> |
|
|
|
|
<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" row-key="id"> |
|
|
|
|
<el-table-column v-if="sorting" width="55" align="center"> |
|
|
|
|
<el-table :data="chapter.subsectionList" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
row-key="id"> |
|
|
|
|
<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 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"> |
|
|
|
|
<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"> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="300"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<template v-if="!sorting"> |
|
|
|
|
<el-button type="text" @click="download(scope.row)" v-auth="'/curriculum:内容设置:下载'">下载</el-button> |
|
|
|
|
<el-button type="text" @click="preview(scope.row)" v-auth="'/curriculum:内容设置:查看'">查看</el-button> |
|
|
|
|
<el-button type="text" @click="delSection(scope.row)" v-auth="'/curriculum:内容设置:删除小节'">删除</el-button> |
|
|
|
|
<el-button type="text" @click="editSectionName(scope.row,chapter.id)" v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button> |
|
|
|
|
<el-button type="text" @click="switchFile(scope.row,chapter.id)" v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="download(scope.row)" |
|
|
|
|
v-auth="'/curriculum:内容设置:下载'">下载</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="preview(scope.row)" |
|
|
|
|
v-auth="'/curriculum:内容设置:查看'">查看</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="delSection(scope.row)" |
|
|
|
|
v-auth="'/curriculum:内容设置:删除小节'">删除</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="editSectionName(scope.row,chapter.id)" |
|
|
|
|
v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="switchFile(scope.row,chapter.id)" |
|
|
|
|
v-auth="'/curriculum:内容设置:更换文件'">更换文件</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> |
|
|
|
|
<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="540px" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" |
|
|
|
|
:visible.sync="chapterVisible" |
|
|
|
|
width="540px" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form> |
|
|
|
|
<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> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="chapterVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="chapterSubmit">确定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="chapterSubmit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" :close-on-click-modal="false"> |
|
|
|
|
<el-form label-width="80px"> |
|
|
|
|
<el-dialog title="添加小节1" |
|
|
|
|
:visible.sync="sectionVisible" |
|
|
|
|
width="540px" |
|
|
|
|
@close="closeSection" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form ref="form" |
|
|
|
|
:model="sectionForm" |
|
|
|
|
label-width="80px" |
|
|
|
|
@submit.native.prevent> |
|
|
|
|
<el-form-item label="资源添加"> |
|
|
|
|
<el-upload |
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
<el-upload :before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
@ -98,27 +171,38 @@ |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
:http-request="handleRequest" |
|
|
|
|
name="file" |
|
|
|
|
> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
|
|
|
|
<div slot="tip" class="el-upload__tip">视频请上传MP4格式,大小不超过30M;office文件大小不要超过10M</div> |
|
|
|
|
name="file"> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip">视频请上传MP4格式,大小不超过30M;office文件大小不要超过10M</div> |
|
|
|
|
</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 label="小节名称"> |
|
|
|
|
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
|
|
|
|
<el-input placeholder="请输入小节名称" |
|
|
|
|
v-model.trim="sectionForm.sectionName" |
|
|
|
|
maxlength="50" |
|
|
|
|
@keyup.enter.native="sectionSubmit()"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="sectionVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="sectionSubmit">确定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="sectionSubmit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</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"> |
|
|
|
|
<el-upload |
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
<el-upload :before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
@ -128,84 +212,142 @@ |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
:http-request="handleRequest" |
|
|
|
|
name="file" |
|
|
|
|
> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> |
|
|
|
|
name="file"> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
|
</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> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="switchVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="switchSubmit">确定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="switchSubmit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false"> |
|
|
|
|
<el-form> |
|
|
|
|
<el-dialog title="修改小节名称" |
|
|
|
|
:visible.sync="sectionNameVisible" |
|
|
|
|
width="540px" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form @submit.native.prevent> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> |
|
|
|
|
<el-input placeholder="请输入小节名称" |
|
|
|
|
v-model="sectionForm.sectionName" |
|
|
|
|
maxlength="50" |
|
|
|
|
@keyup.enter.native="sectionNameSubmit()"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="sectionNameVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="sectionNameSubmit">确定</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 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> |
|
|
|
|
<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%;"> |
|
|
|
|
<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 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> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
<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 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> |
|
|
|
|
<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> |
|
|
|
|
<pdf :visible.sync="pdfVisible" |
|
|
|
|
:src.sync="pdfSrc"></pdf> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<div class="player-download" id="playerDownload"></div> |
|
|
|
|
<div class="player-download" |
|
|
|
|
id="playerDownload"></div> |
|
|
|
|
|
|
|
|
|
<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-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 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 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"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="moveVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="moveConfirm">确定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="moveConfirm">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -238,6 +380,15 @@ export default { |
|
|
|
|
sectionId: "", |
|
|
|
|
switchVisible: false, |
|
|
|
|
sectionNameVisible: false, |
|
|
|
|
|
|
|
|
|
rules: { |
|
|
|
|
sectionName: [ |
|
|
|
|
{ required: true, message: "请输入小节名称", trigger: "blur" } |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
sectionForm: { |
|
|
|
|
sectionName: '' |
|
|
|
|
}, |
|
|
|
|
fileId: "", |
|
|
|
|
fileName: "", |
|
|
|
|
fileUrl: "", |
|
|
|
@ -377,7 +528,7 @@ export default { |
|
|
|
|
// } |
|
|
|
|
this.uploading = true; |
|
|
|
|
this.originalFileName = file.name; |
|
|
|
|
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); |
|
|
|
|
if (this.isAddSection) this.sectionForm.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); |
|
|
|
|
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); |
|
|
|
|
this.showProgress = true |
|
|
|
|
}, |
|
|
|
@ -571,7 +722,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
addSection (id) { |
|
|
|
|
this.chapterId = id; |
|
|
|
|
this.sectionName = ""; |
|
|
|
|
this.sectionForm.sectionName = ""; |
|
|
|
|
this.fileUrl = ""; |
|
|
|
|
this.uploadList = []; |
|
|
|
|
this.sectionId = ""; |
|
|
|
@ -603,15 +754,15 @@ export default { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
sectionSubmit() { |
|
|
|
|
if (!this.sectionName) return this.$message.warning("请填写小节名称"); |
|
|
|
|
sectionSubmit (e) { |
|
|
|
|
if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称"); |
|
|
|
|
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); |
|
|
|
|
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); |
|
|
|
|
let data = { |
|
|
|
|
id: this.sectionId, |
|
|
|
|
cid: this.id, |
|
|
|
|
chapterId: this.chapterId, |
|
|
|
|
name: this.sectionName, |
|
|
|
|
name: this.sectionForm.sectionName, |
|
|
|
|
fileId: this.fileId, |
|
|
|
|
fileUrl: this.fileUrl, |
|
|
|
|
fileName: this.fileName, |
|
|
|
@ -624,7 +775,7 @@ export default { |
|
|
|
|
this.getData(); |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
closeSwitch () { |
|
|
|
|
this.fileId = ""; |
|
|
|
@ -715,7 +866,7 @@ export default { |
|
|
|
|
editSectionName (row, chapterId) { |
|
|
|
|
this.chapterId = chapterId; |
|
|
|
|
this.sectionId = row.id; |
|
|
|
|
this.sectionName = row.name; |
|
|
|
|
this.sectionForm.sectionName = row.name; |
|
|
|
|
this.sectionNameVisible = true; |
|
|
|
|
}, |
|
|
|
|
switchFile (row, chapterId, sectionId) { |
|
|
|
@ -728,7 +879,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
this.chapterId = chapterId; |
|
|
|
|
this.sectionId = row.id; |
|
|
|
|
this.sectionName = row.sectionName; |
|
|
|
|
this.sectionForm.sectionName = row.sectionName; |
|
|
|
|
|
|
|
|
|
this.switchVisible = true; |
|
|
|
|
}, |
|
|
|
@ -737,7 +888,7 @@ export default { |
|
|
|
|
id: this.sectionId, |
|
|
|
|
cid: this.id, |
|
|
|
|
chapterId: this.chapterId, |
|
|
|
|
name: this.sectionName, |
|
|
|
|
name: this.sectionForm.sectionName, |
|
|
|
|
fileId: this.fileId, |
|
|
|
|
fileName: this.fileName, |
|
|
|
|
fileType: this.fileType, |
|
|
|
@ -810,12 +961,12 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
sectionNameSubmit () { |
|
|
|
|
if (!this.sectionName) return this.$message.warning("请填写小节名称"); |
|
|
|
|
if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称"); |
|
|
|
|
let data = { |
|
|
|
|
id: this.sectionId, |
|
|
|
|
cid: this.id, |
|
|
|
|
chapterId: this.chapterId, |
|
|
|
|
name: this.sectionName |
|
|
|
|
name: this.sectionForm.sectionName |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.editSubsection, data).then(res => { |
|
|
|
|
this.$message.success("修改成功"); |
|
|
|
@ -846,9 +997,9 @@ export default { |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
.action-btn { |
|
|
|
|
color: #9076FF; |
|
|
|
|
color: #9076ff; |
|
|
|
|
font-size: 14px; |
|
|
|
|
border: #9076FF 1px solid; |
|
|
|
|
border: #9076ff 1px solid; |
|
|
|
|
background-color: #fff; |
|
|
|
|
border-radius: 4px; |
|
|
|
|
} |
|
|
|
@ -869,7 +1020,7 @@ export default { |
|
|
|
|
|
|
|
|
|
&.disabled { |
|
|
|
|
color: #ccc; |
|
|
|
|
cursor: not-allowed |
|
|
|
|
cursor: not-allowed; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.el-progress-bar { |
|
|
|
@ -885,10 +1036,10 @@ export default { |
|
|
|
|
} |
|
|
|
|
.el-image-viewer__wrapper { |
|
|
|
|
transform: translateY(-10px); |
|
|
|
|
transition: transform .5s; |
|
|
|
|
transition: transform 0.5s; |
|
|
|
|
|
|
|
|
|
&.active { |
|
|
|
|
transform: translateY(0) |
|
|
|
|
transform: translateY(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -991,7 +1142,7 @@ export default { |
|
|
|
|
margin-right: 6px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
line-height: 14px; |
|
|
|
|
color: rgba(0, 0, 0, .65); |
|
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
|
white-space: nowrap; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|