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 {
......
<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