Commit 7f9a8a5b authored by fanlin@91isoft.com's avatar fanlin@91isoft.com

22172 新新建页面中,没有保存过的条件下,没有发布按钮,一旦保存成功,显示出【发布】【删除】按钮

parent 5254018d
......@@ -427,7 +427,7 @@ body {
}
// 侧边栏高度度
.ant-layout-sider.sider.light {
height: 770px;
height: 102%;
}
// 外置的样式控制
.user-dropdown-menu {
......
......@@ -81,7 +81,7 @@
<div style="margin-bottom:20px;margin-top: 45px">
<span class="addCourseContent"><span style="color: red">*</span>所属章:</span>
<div style="display: inline-block;width: 347px;height:40px;box-sizing:border-box;position:relative;">
<el-select v-model="cur_belongChapter" style="width: 347px;" id="editChpterBelong" @change="viewEditRulerTeaBelong">
<el-select v-model="cur_belongChapter" style="width: 347px;" id="editChpterBelong"@blur="viewEditRulerTeaBelong">
<el-option
v-for="item in getData"
:key="item.businessId"
......@@ -110,7 +110,7 @@
<div>
<span class="addCourseContent content-type"><span style="color: red">*</span>内容:</span>
<div style="display: inline-block;width: 320px;margin-left: -2px;text-align: left">
<el-radio-group v-model="curMethodBox">
<el-radio-group @change="viewRulersContent" v-model="curMethodBox">
<el-radio style="line-height: 1.8" label="0">视频</el-radio>
<el-radio style="line-height: 1.8" label="1">音频</el-radio>
<el-radio style="line-height: 1.8" label="2">PPT</el-radio>
......@@ -262,9 +262,9 @@
<el-button
style="width: 80px; height: 34px;padding: 10px 20px;margin: 0px 20px"
:loading="submitChapterWait"
:disabled="submitChapterWait"
v-show="editorCourseSteps == 2"
type="primary"
:disabled="submitChapterWait"
@click="closePPTDialog">确定</el-button>
<el-button style="width: 92px; height: 34px;padding: 10px 20px;margin: 0px 20px" v-show="editorCourseSteps == 1" type="primary" @click="confirmEditSect()">下一步</el-button>
<el-button style="width: 80px; height: 34px;padding: 10px 20px;margin-right: 20px" @click="cancleEditSect">取消</el-button>
......@@ -475,8 +475,8 @@
methods: {
// 取消上传
canceluploadFile(e) {
let that = this
this.$refs.upload.abort();
let that = this
that.uploadFileName = that.saveFileNameEditor
if (this.curMethodBox !== this.mediaType) {
this.videoShow = false
......@@ -567,6 +567,7 @@
},
// ”编辑章“对话框的取消事件方法
cancleEditChap() {
this.$refs.ChapDialog.showDialog = false
document.getElementById('editChapterTea').style.border = '1px solid #DCDFE6';
this.chapterNameLog = false;
this.formClear();
......@@ -796,14 +797,22 @@
if(this.cur_belongChapter ===''){
this.belongToChapterLog = true
document.getElementById('editChpterBelong').style.border = '1px solid #F56C6C';
}else{this.belongToChapterLog = false}
}else{
this.belongToChapterLog = false
document.getElementById('editChpterBelong').style.border = '1px solid #DCDFE6';
}
if(this.val_curSection === ''){
this.chapterNameLv2Log = true
document.getElementById('editChptercontentClass').style.border = '1px solid #F56C6C';
}else{this.chapterNameLv2Log = false}
}else{
this.chapterNameLv2Log = false
document.getElementById('editChptercontentClass').style.border = '1px solid #DCDFE6';
}
if(this.curMethodBox === ''){
this.chapterContentLog = true
}else{this.chapterContentLog = false}
}else{
this.chapterContentLog = false
}
return false
}else if (this.val_curSection !== '') {
if(this.curMethodBox !== this.mediaType){
......@@ -822,11 +831,6 @@
case '4':this.uploadName = 'word';break;
// case '4':this.uploadName = '资料包';break;
}
console.log(this.videoShow,this.uploadName,'zheshivideo')
console.log(this.audioShow,this.uploadName,'zheshivideo')
console.log(this.pptShow,this.uploadName,'zheshivideo')
console.log(this.pdfShow,this.uploadName,'zheshivideo')
console.log(this.wordShow,this.uploadName,'zheshivideo')
} else{
switch (parseInt(this.curMethodBox)) {
case 0:
......@@ -1000,6 +1004,13 @@
document.getElementById('editChptercontentClass').style.border = '1px solid #DCDFE6';
}
},
viewRulersContent (){
if(this.curMethodBox === ''){
this.chapterContentLog = true
}else{
this.chapterContentLog = false
}
},
// 清空
formClear () {
this.val_curChapter = ''
......@@ -1042,7 +1053,7 @@
_this.fullscreenLoading = false
if (res.code === 400) {
_this.$message({
message: '删除失败',
message: res.message,
type: 'warning',
duration: 0,
showClose: true
......@@ -1068,6 +1079,7 @@
this.wordShow = false
this.pdfShow = false
this.ifEditorCourseContent = true
this.saveFileNameEditor = ''
this.editorCourseSteps = 2;
this.$refs.SectDialog.showDialog = true;
this.postData.type = this.uploadData[type].typeCode
......@@ -1184,14 +1196,15 @@
},
closePPTDialog () {
if (!this.submitPrevent) {
this.$message({
showClose: true,
message: '文件未上传完成!',
duration:0,
type: 'error'
});
return false;
} else {
this.$message.error({
type:'error',
message:'尚有文件未上传',
duration:0,
showClose:true
})
return false
}
else {
this.submitChapterWait = true
let addform = {
businessId: this.postData.chapterId,//编辑节时需传
......@@ -1213,16 +1226,11 @@
}
console.log(this.postData)
this.eduUtil.ajaxPostUtil(this.interfaceName.addCourseUnit, addform, res => {
this.uploadLoading = true;
if (this.uploadProgress !== 100) {
return false;
} else {
this.uploadLoading = false
this.$message({
message: '保存成功',
duration:0,
type: 'success'
});
}
this.$refs.SectDialog.showDialog = false;
this.submitChapterWait = false
// this.$refs.UploadPPTDialog.showDialog = false
......@@ -1244,9 +1252,9 @@
this.uploadStatus = 0;
this.uploadProgress = 0;
let fileSuf = file.name.split('.').splice(-1)[0]
if (this.postData.type === '0' && fileSuf !== 'mp4' && fileSuf !== 'rmvb' && fileSuf !== 'avi') {
if (this.postData.type === '0' && fileSuf !== 'mp4') {
this.$message({
message: '文件格式不正确!应为.mp4/.avi/.rmvb',
message: '文件格式不正确!应为.mp4',
type: 'error',
duration: 0,
showClose: true
......@@ -1309,6 +1317,7 @@
})
return false
} else {
this.uploadProgress = 0
this.uploadFileName = ''
this.postData.file = file
this.uploadProPrvent = true
......@@ -1476,7 +1485,7 @@
let that = this
console.log(res,'上传成功结果')
// that.uploadLoading = true
that.showProgress = true;
that.showProgress = true
that.videoUrl = decodeURIComponent(res.data.url)
console.log(this.postData.type)
if (res.code=== 'M0000'){
......@@ -1484,16 +1493,17 @@
this.uploadFileName = res.data.originalName
that.uploadFileSize = res.data.fileSize;
// this.$refs.UploadPPTDialog.showDialog = true;
if (that.postData.type === '0' || that.postData.type === '1' ){
that.videoUrl = decodeURIComponent(res.data.url);
}
// if(res.data.type !=='4'){
if (that.postData.type !== '0'&& that.postData.type !== '1' ) {
let temp ={
videoUrl: decodeURIComponent(res.data.url),
videoUrl: decodeURIComponent(res.data.url),
type: that.postData.type,
lessonId: that.slId
};
}
that.getReadyUrl(temp).then(res => {
if (res.code === 200) {
that.urlCorss = res.data;
......@@ -1510,17 +1520,15 @@
that.submitPrevent = true
that.isNotUploading = true
},800)
}
}).catch(err =>{
that.isNotUploading = true
that.editoruplaodLoading = false
})
}
// that.videoUrl = decodeURIComponent(res.data.url);
// }
// that.uploadFileName = res.data.originalName;
// that.uploadFileSize = res.data.fileSize;
if(res.data.fileSize === 'undefind'){
that.uploadFileSize = ''
}
......@@ -1560,32 +1568,19 @@
that.wordShow = true;
break;
}
// this.resetUpload();
// this.postData = {
// type: '',
// // chapterId: '',
// // slId: '',
// file: ''
// }
$('#upload-btn').val('')
}else{
this.$message({
message:'上传失败',
type:'warning',
duration: 0,
showClose: true,
});
that.uploadStatus = 2;
that.isNotUploading = true
that.editoruplaodLoading = false
}
// }, err => {
// this.uploadLoading = false
// this.$notify({
// title: '失败',
// message: '网络错误',
// type: 'error'
// })
// })
},
// 回显函数
getChapterCatalogList(){
......@@ -1597,6 +1592,8 @@
if (res.code=== 200) {
$this.returnCatalogData = res.data.chapterList;
$this.$emit('refreshChapterList')
console.log($this.returnCatalogData)
console.log('88888888888888888888888')
$this.chapterLoading = false;
}
},function(err){
......@@ -1619,7 +1616,7 @@
console.log(event.percent,'上传进度调试')
let that = this
// console.log(parseInt(event.percent),'进度')
if(parseInt(event.percent) >= 99){
if(parseInt(event.percent) >= 99 ){
this.uploadProgress = 99;
}else{
this.uploadProgress = parseInt(event.percent)
......@@ -1741,13 +1738,18 @@
}
}
},
editorUploadType(){
switch (this.postData.type) {
case "0":return '.mp4';
case "1":return '.mp3';
case "2":return '.ppt/pptx';
case "3":return '.pdf';
case "4":return '.doc/docx';
editorUploadType() {
switch (this.curMethodBox === '' ? this.postData.type : this.curMethodBox) {
case "0":
return '.mp4';
case "1":
return '.mp3';
case "2":
return '.ppt/pptx';
case "3":
return '.pdf';
case "4":
return '.doc/docx';
// case "4":return '.rar/.zip';break;
}
},
......@@ -1782,7 +1784,7 @@
},
filters:{
// 处理文件名的长度,防止文件名过长而自动换行
//处理文件名的长度,防止文件名过长而自动换行
dealWithByFileNameLen(value,length){
if(typeof value !== 'string')
value += ''
......@@ -1800,7 +1802,6 @@
for (let i = 0 ,n = value.length; i < n; i++) {
let single = value.charCodeAt(i);
bytesCount += ((single >= 0x0001 && single <= 0x007e) || (0xff60<=single && single<=0xff9f)) ? 1:2;
debugger
}
if (bytesCount <= length*2) {
return value
......
<template>
<div v-loading.body="loading" id="chapterListTea" class="chapterListTea">
<div style="text-align: left">
<!-- <span class="chapterSwitchBtn">-->
<!-- <label>-->
<!-- <el-switch v-model="chapterAllSwtich" on-text="" off-text="" on-color="#13ce66" off-color="#707070" @change="switchAllChapter"></el-switch>-->
<!-- 打开全部-->
<!-- </label>-->
<!-- </span>-->
<a @click="addCourseChapter" class="tabs-addChapter" @mouseover="blueShow" @mouseout="blueHide">
<img :src= "isShow === true ? eleUrl.url : eleUrl.no_url" style="position: relative;top: -1px;">&nbsp;添加章</a>
<a @click="setSectionFlag" class="tabs-addSection" @mouseover="blueJShow" @mouseout="blueJHide">
<img :src= "isJShow === true ? eleUrl.url:eleUrl.no_url" style="position: relative;top: -1px;">&nbsp;添加节</a>
<span style="color:#999999;margin-left: 14px;margin-top: 10px"><img src="@/assets/image/icon-question.png" style="margin-right: 9px;width: 20px;height: 20px;margin-top: -4px;"/>一小节对应一个课时</span>
<!--<a @click="showExportDialog" v-show="isSelected==2" class="tabs-addSection"><img src="../../static/images/export.png" style="position: relative;top: -1px;">&nbsp;导出作业</a>-->
<!-- <edu-button btnType="main-btn" btnValue="导出作业" @clicked="showExportDialog" v-show="isSelected==2" class="export"></edu-button>-->
<!-- <edu-button btnType="main-btn" btnValue="刷新" @clicked="refreshScoreList" v-show="isSelected==2" style="width: 106px !important;" class="refurbish"></edu-button>-->
<!--<edu-button btnType="main-btn" btnValue="刷新" @click="" v-show="isSelected==2" style="width: 106px !important;" class="refurbish"></edu-button>-->
<!-- <a class="classContrast" style="cursor: default;color:#FF0000;">还差 {{needClassHours}} 学时与预设总学时一致</a>-->
<!-- <a class="classContrast" style="cursor: default;color: green;">当前课时已满足预设总学时</a>-->
</div>
<!-- 添加章节 弹出框-->
<div class="addCourseWrap">
......
<template>
<div class="pdf-container">
<div class="tool-bar">
<a class="resize" @click="changePage('after')">下一页</a>
<input @keyup.enter="toPage" @blur="toPage" onkeypress="return event.keyCode>=48&&event.keyCode<=57" ng-pattern="/[^a-zA-Z]/" v-model="page" >&nbsp;/&nbsp;{{numPages}}
<a class="resize" style="float:left" @click="changePage('before')">上一页</a>
<!-- <a class="aRotate" @click="rotate += 90">&#x27F3;</a>-->
<!-- <a class="aRotate" @click="rotate -= 90">&#x27F2;</a>-->
</div>
<div class="pdf">
<div class="pdfList">
<pdf
......@@ -18,96 +11,116 @@
></pdf>
</div>
</div>
<div class="tool-bar" v-show="isPdfShow">
<a class="resize" style="float:left" @click="changePage('before')">上一页</a>
<input @keyup.enter="toPage" @blur="toPage" onkeypress="return event.keyCode>=48&&event.keyCode<=57" ng-pattern="/[^a-zA-Z]/" v-model="page" >&nbsp;/&nbsp;{{numPages}}
<a class="resize" @click="changePage('after')">下一页</a>
</div>
</div>
</template>
<script>
import pdf from 'vue-pdf';
import $ from 'jquery';
import pdf from 'vue-pdf'
export default {
components: {
pdf: pdf
},
data() {
data () {
return {
src: '',
src: "",
numPages: undefined,
page: 1,
page:1,
rotate: 0,
pageArr: [1]
pageArr:[1],
isPdfShow:false
};
}
},
props: ['pdfSrc'],
props: ['pdfSrc','isShowTools'],
methods: {
// handleInput(e){
// this.page=parseInt(e.target.value.replace(/[^\d]/g,''));
// },
changePage(params) {
changePage (params) {
if (params === 'before') {
this.page = this.page - 1 > 0 ? (this.page - 1) : 1;
} else {
this.page = this.page + 1 > this.numPages ? this.numPages : (this.page + 1);
this.page = this.page -1>0?(this.page-1):1
}else{
this.page = this.page +1>this.numPages?this.numPages:(this.page+1)
}
},
toPage() {
const newPage = parseInt(this.page);
if (newPage < 1 || $.trim(this.page) == '') {
console.log('toPage-----------<1');
toPage(){
let newPage = parseInt(this.page);
if(newPage<1||$.trim(this.page)==""){
console.log("toPage-----------<1");
this.page = 1;
}
if (newPage > this.numPages) {
console.log('toPage----------->total');
if(newPage>this.numPages){
console.log("toPage----------->total");
this.page = this.numPages;
}
},
toLittle() {
const cW = $('.pdf-container').width();
const cH = $('.pdf-container').height();
toLittle(){
let cW = $('.pdf-container').width();
let cH = $('.pdf-container').height();
const pW = $('.pdfList').width();
const pH = $('.pdfList').height();
if (pW * 5 / 6 < cW * 0.01 || (pH * 5 / 6 / this.numPages) < cH * 0.01) {
let pW = $('.pdfList').width();
let pH = $('.pdfList').height();
if(pW*5/6<cW*0.01 || (pH*5/6/this.numPages)<cH*0.01){
return;
}
// let newW = pW*5/6<cW*0.3?cW*0.3:pW*5/6;
// let newH = (pH*5/6/this.numPages)<cH*0.3?cH*0.3*this.numPages:pH*5/6;
const newW = pW * 5 / 6;
const newH = pH * 5 / 6;
let newW = pW*5/6;
let newH = pH*5/6;
$('.pdfList').width(newW);
$('.pdfList').height(newH);
},
toBig() {
const cW = $('.pdf-container').width();
const cH = $('.pdf-container').height();
toBig(){
let cW = $('.pdf-container').width();
let cH = $('.pdf-container').height();
const pW = $('.pdfList').width();
const pH = $('.pdfList').height();
let newW, newH;
if (pW * 6 / 5 > cW && (pH * 6 / 5 / this.numPages) > cH) {
let pW = $('.pdfList').width();
let pH = $('.pdfList').height();
let newW,newH;
if(pW*6/5>cW && (pH*6/5/this.numPages)>cH){
return;
}
// newW = pW*6/5>cW?cW:pW*6/5;
// newH = (pH*6/5/this.numPages)>cH?cH*this.numPages:pH*6/5;
newW = pW * 6 / 5;
newH = pH * 6 / 5;
newW = pW*6/5;
newH = pH*6/5;
$('.pdfList').width(newW);
$('.pdfList').height(newH);
},
delHide () {
this.isPdfShow = false
},
delShow () {
this.isPdfShow = true
}
},
beforeMount() {
this.src = pdf.createLoadingTask(this.pdfSrc);
beforeMount(){
this.src = pdf.createLoadingTask(this.pdfSrc)
// this.src = 'https://cdn.mozilla.net/pdfjs/tracemonkey.pdf'
},
mounted() {
const that = this;
let that = this;
this.src.then(pdf => {
that.numPages = pdf.numPages;
// $('.pdf').onscroll(this.onScroll);
});
// $('.pdf').onscroll(this.onScroll);
})
},
watch:{
isShowTools(){
if(this.isShowTools){
this.delShow()
}else {
this.delHide()
}
}
}
};
}
</script>
<style scoped>
.pdf-container {
......@@ -119,11 +132,13 @@
overflow: hidden;
}
.tool-bar {
position: absolute;
bottom: 0;
width: 100%;
background: rgb(50, 54, 57);
height: 48px;
line-height: 48px;
box-shadow: 0 2px 6px 0 rgb(50, 54, 57);
background: rgba(43, 51, 63, 0.7);
height: 30px;
line-height: 30px;
/*box-shadow: 0 2px 6px 0 rgb(50, 54, 57);*/
color: rgb(241, 241, 241);
text-align: center;
font-size: 13px;
......@@ -150,14 +165,15 @@
.pdfList {
display: inline-block;
margin-top: 20px;
margin-top: 23px;
margin-bottom: 23px;
width: 60%;
}
.pdfList div {
background: #fff;
border-radius: 5px;
margin-top: 5px;
margin-bottom: 10px;
margin-top: 3px;
/*margin-bottom: 10px;*/
box-shadow: 1px 4px 10px 2px rgb(50, 54, 57);
}
.aRotate {
......@@ -168,7 +184,7 @@
.resize {
font-size: 25px;
float: right;
margin-right: 15px;
margin:0 15px;
font-size: 14px;
}
.pdf {
......
......@@ -5,7 +5,7 @@
<a-alert :message=successInfor v-if="showSuccess" type="success" showIcon />
<a-alert :message=failInfor v-if="showFail" type="error" showIcon closable />
</div>
<div style="height:666px">
<div style="height:88vh">
<div class="sortManageMenu">
<div style="display: inline-block">
<span class="allCategory">全部分类</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment