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

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

parent 5254018d
...@@ -427,7 +427,7 @@ body { ...@@ -427,7 +427,7 @@ body {
} }
// 侧边栏高度度 // 侧边栏高度度
.ant-layout-sider.sider.light { .ant-layout-sider.sider.light {
height: 770px; height: 102%;
} }
// 外置的样式控制 // 外置的样式控制
.user-dropdown-menu { .user-dropdown-menu {
......
<template> <template>
<div v-loading.body="loading" id="chapterListTea" class="chapterListTea"> <div v-loading.body="loading" id="chapterListTea" class="chapterListTea">
<div style="text-align: left"> <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"> <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> <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"> <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> <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> <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>
<!-- 添加章节 弹出框--> <!-- 添加章节 弹出框-->
<div class="addCourseWrap"> <div class="addCourseWrap">
......
<template> <template>
<div class="pdf-container"> <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="pdf">
<div class="pdfList"> <div class="pdfList">
<pdf <pdf
...@@ -18,96 +11,116 @@ ...@@ -18,96 +11,116 @@
></pdf> ></pdf>
</div> </div>
</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> </div>
</template> </template>
<script> <script>
import pdf from 'vue-pdf'; import pdf from 'vue-pdf'
import $ from 'jquery';
export default { export default {
components: { components: {
pdf: pdf pdf: pdf
}, },
data() { data () {
return { return {
src: '', src: "",
numPages: undefined, numPages: undefined,
page: 1, page:1,
rotate: 0, rotate: 0,
pageArr: [1] pageArr:[1],
isPdfShow:false
}; }
}, },
props: ['pdfSrc'], props: ['pdfSrc','isShowTools'],
methods: { methods: {
// handleInput(e){ // handleInput(e){
// this.page=parseInt(e.target.value.replace(/[^\d]/g,'')); // this.page=parseInt(e.target.value.replace(/[^\d]/g,''));
// }, // },
changePage(params) { changePage (params) {
if (params === 'before') { if (params === 'before') {
this.page = this.page - 1 > 0 ? (this.page - 1) : 1; this.page = this.page -1>0?(this.page-1):1
} else { }else{
this.page = this.page + 1 > this.numPages ? this.numPages : (this.page + 1); this.page = this.page +1>this.numPages?this.numPages:(this.page+1)
} }
}, },
toPage() { toPage(){
const newPage = parseInt(this.page); let newPage = parseInt(this.page);
if (newPage < 1 || $.trim(this.page) == '') { if(newPage<1||$.trim(this.page)==""){
console.log('toPage-----------<1'); console.log("toPage-----------<1");
this.page = 1; this.page = 1;
} }
if (newPage > this.numPages) { if(newPage>this.numPages){
console.log('toPage----------->total'); console.log("toPage----------->total");
this.page = this.numPages; this.page = this.numPages;
} }
}, },
toLittle() { toLittle(){
const cW = $('.pdf-container').width(); let cW = $('.pdf-container').width();
const cH = $('.pdf-container').height(); let cH = $('.pdf-container').height();
const pW = $('.pdfList').width(); let pW = $('.pdfList').width();
const pH = $('.pdfList').height(); let pH = $('.pdfList').height();
if (pW * 5 / 6 < cW * 0.01 || (pH * 5 / 6 / this.numPages) < cH * 0.01) { if(pW*5/6<cW*0.01 || (pH*5/6/this.numPages)<cH*0.01){
return; return;
} }
// let newW = pW*5/6<cW*0.3?cW*0.3:pW*5/6; // 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; // let newH = (pH*5/6/this.numPages)<cH*0.3?cH*0.3*this.numPages:pH*5/6;
const newW = pW * 5 / 6; let newW = pW*5/6;
const newH = pH * 5 / 6; let newH = pH*5/6;
$('.pdfList').width(newW); $('.pdfList').width(newW);
$('.pdfList').height(newH); $('.pdfList').height(newH);
}, },
toBig() { toBig(){
const cW = $('.pdf-container').width(); let cW = $('.pdf-container').width();
const cH = $('.pdf-container').height(); let cH = $('.pdf-container').height();
const pW = $('.pdfList').width(); let pW = $('.pdfList').width();
const pH = $('.pdfList').height(); let pH = $('.pdfList').height();
let newW, newH; let newW,newH;
if (pW * 6 / 5 > cW && (pH * 6 / 5 / this.numPages) > cH) { if(pW*6/5>cW && (pH*6/5/this.numPages)>cH){
return; return;
} }
// newW = pW*6/5>cW?cW:pW*6/5; // newW = pW*6/5>cW?cW:pW*6/5;
// newH = (pH*6/5/this.numPages)>cH?cH*this.numPages:pH*6/5; // newH = (pH*6/5/this.numPages)>cH?cH*this.numPages:pH*6/5;
newW = pW * 6 / 5; newW = pW*6/5;
newH = pH * 6 / 5; newH = pH*6/5;
$('.pdfList').width(newW); $('.pdfList').width(newW);
$('.pdfList').height(newH); $('.pdfList').height(newH);
},
delHide () {
this.isPdfShow = false
},
delShow () {
this.isPdfShow = true
} }
}, },
beforeMount() { beforeMount(){
this.src = pdf.createLoadingTask(this.pdfSrc); this.src = pdf.createLoadingTask(this.pdfSrc)
// this.src = 'https://cdn.mozilla.net/pdfjs/tracemonkey.pdf' // this.src = 'https://cdn.mozilla.net/pdfjs/tracemonkey.pdf'
}, },
mounted() { mounted() {
const that = this; let that = this;
this.src.then(pdf => { this.src.then(pdf => {
that.numPages = pdf.numPages; that.numPages = pdf.numPages;
// $('.pdf').onscroll(this.onScroll); // $('.pdf').onscroll(this.onScroll);
}); })
},
watch:{
isShowTools(){
if(this.isShowTools){
this.delShow()
}else {
this.delHide()
}
}
} }
}; }
</script> </script>
<style scoped> <style scoped>
.pdf-container { .pdf-container {
...@@ -119,11 +132,13 @@ ...@@ -119,11 +132,13 @@
overflow: hidden; overflow: hidden;
} }
.tool-bar { .tool-bar {
position: absolute;
bottom: 0;
width: 100%; width: 100%;
background: rgb(50, 54, 57); background: rgba(43, 51, 63, 0.7);
height: 48px; height: 30px;
line-height: 48px; line-height: 30px;
box-shadow: 0 2px 6px 0 rgb(50, 54, 57); /*box-shadow: 0 2px 6px 0 rgb(50, 54, 57);*/
color: rgb(241, 241, 241); color: rgb(241, 241, 241);
text-align: center; text-align: center;
font-size: 13px; font-size: 13px;
...@@ -150,14 +165,15 @@ ...@@ -150,14 +165,15 @@
.pdfList { .pdfList {
display: inline-block; display: inline-block;
margin-top: 20px; margin-top: 23px;
margin-bottom: 23px;
width: 60%; width: 60%;
} }
.pdfList div { .pdfList div {
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
margin-top: 5px; margin-top: 3px;
margin-bottom: 10px; /*margin-bottom: 10px;*/
box-shadow: 1px 4px 10px 2px rgb(50, 54, 57); box-shadow: 1px 4px 10px 2px rgb(50, 54, 57);
} }
.aRotate { .aRotate {
...@@ -168,7 +184,7 @@ ...@@ -168,7 +184,7 @@
.resize { .resize {
font-size: 25px; font-size: 25px;
float: right; float: right;
margin-right: 15px; margin:0 15px;
font-size: 14px; font-size: 14px;
} }
.pdf { .pdf {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<a-alert :message=successInfor v-if="showSuccess" type="success" showIcon /> <a-alert :message=successInfor v-if="showSuccess" type="success" showIcon />
<a-alert :message=failInfor v-if="showFail" type="error" showIcon closable /> <a-alert :message=failInfor v-if="showFail" type="error" showIcon closable />
</div> </div>
<div style="height:666px"> <div style="height:88vh">
<div class="sortManageMenu"> <div class="sortManageMenu">
<div style="display: inline-block"> <div style="display: inline-block">
<span class="allCategory">全部分类</span> <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