mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
提交
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<el-breadcrumb-item>案例详情</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="xrow" style="display: flex;justify-content: space-between;">
|
||||
<div style="flex: 1;" class="xcol content-div">
|
||||
<div style="flex: 1;" class="xcol content-div" id="content-div">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-card :body-style="{ padding: '0px' }" class="detail">
|
||||
@@ -17,11 +17,13 @@
|
||||
<span>作者:{{ authorInfo.name }}</span>
|
||||
<span>工号:{{ authorInfo.code }}</span>
|
||||
<span>部门:{{ authorInfo.orgInfo }}</span>
|
||||
<!-- <span>案例编号:{{ caseDetail.id }}</span> -->
|
||||
<span style="text-align: right;" v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- <div class="label">
|
||||
<span style="margin-left:0px;" v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span>
|
||||
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true"></interactBar>
|
||||
</div> -->
|
||||
<!-- <div class="case-summary"><span>{{ caseDetail.summary }}</span></div> -->
|
||||
<div class="btn-div" >
|
||||
<span v-if="caseDetail.orgDomain" class="item">{{ caseDetail.orgDomain }}</span>
|
||||
<span v-if="caseDetail.majorType" class="item">{{ caseDetail.majorType }}</span>
|
||||
@@ -35,20 +37,31 @@
|
||||
<span v-if="caseDetail.caseType2" class="item">{{ caseDetail.caseType2 }}</span> -->
|
||||
</div>
|
||||
<div class="case-summary"><span>{{ caseDetail.summary }}</span></div>
|
||||
|
||||
<div>
|
||||
<div class="label">
|
||||
<!-- <span style="margin-left:0px;" v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span> -->
|
||||
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true"></interactBar>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card :body-style="{ padding: '0px' }" class="jianjie">
|
||||
<el-card :body-style="{ padding: '0px' }" class="jianjie" id="pdfPreview">
|
||||
<!-- <div class="content">
|
||||
{{ caseDetail.content }}
|
||||
</div> -->
|
||||
<pdfPreview v-if="pdfPath" :filePath="pdfPath" :data="caseDetail"></pdfPreview>
|
||||
</el-card>
|
||||
<div class="postfixt-bot">
|
||||
<div class="postfixt-bot-box" id="pdfTopBox">
|
||||
<div style="display:inline-block;">
|
||||
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="false"></interactBar>
|
||||
</div>
|
||||
<div style="display:inline-block;margin: 0 20px;">
|
||||
<el-button type="primary" @click="goTop()">返回顶部</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- :authorId="articleDetailData.sysCreateAid" -->
|
||||
<el-row><comments @success="success" v-if="resolveId != ''" :obj-type="3" :obj-id="resolveId" :authorId="caseDetail.authorId" :toUsers="toUsers"></comments></el-row>
|
||||
<div id="comments-box">
|
||||
<el-row><comments @success="success" v-if="resolveId != ''" :obj-type="3" :obj-id="resolveId" :authorId="caseDetail.authorId" :toUsers="toUsers"></comments></el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -159,6 +172,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isTopBoxShow:true,
|
||||
toUsers:[],
|
||||
ankingList:[],
|
||||
Popularity:[],
|
||||
@@ -177,23 +191,27 @@ export default {
|
||||
mounted() {
|
||||
//this.pdfPath=this.basePath+'/case/demo1.pdf';
|
||||
this.resolveId = this.$route.query.id;
|
||||
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
|
||||
if (this.resolveId) {
|
||||
this.getCaseData();
|
||||
}
|
||||
this.getAnkingData();
|
||||
this.getPopularity();
|
||||
this.getPositive();
|
||||
window.addEventListener(
|
||||
this.getPositive();
|
||||
window.addEventListener(
|
||||
"scroll",
|
||||
this.handleScroll
|
||||
);
|
||||
},
|
||||
methods: {
|
||||
jumpRouter(item) {
|
||||
jumpRouter(item) {
|
||||
// console.log(item)
|
||||
location.href =`${this.webBaseUrl}/case/detail?id=${item.id}`
|
||||
// this.$router.push(`/case/detail?id=${item.id}`);
|
||||
},
|
||||
goTop() {
|
||||
document.documentElement.scrollTop = 0;
|
||||
},
|
||||
createPlayUrl(u){
|
||||
let nowDate=new Date();
|
||||
let ctime=parseInt(nowDate.getTime()/1000);
|
||||
@@ -201,16 +219,17 @@ export default {
|
||||
let urlSign=encodeURIComponent(encrypt(beforeUrl));
|
||||
cookies.set('CASE_TIME', ctime);//写客户端的cookie保存
|
||||
//以下判断是为了区分本地环境和服务器环境
|
||||
//console.log(process.env,'process.env');
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
this.pdfPath=process.env.VUE_APP_FILE_BASE_URL+u;
|
||||
}else{
|
||||
this.pdfPath=process.env.VUE_APP_BASE_API+'/xboe/m/case/content/resource?sign='+urlSign;
|
||||
}
|
||||
//console.log(this.pdfPath,'this.blobUrl');
|
||||
},
|
||||
handleScroll() {
|
||||
let innerHeight = document.querySelector('#case-list-content').clientHeight
|
||||
let pdfTopBox = document.querySelector('#comments-box')
|
||||
let pdfPreview = document.querySelector('#pdfPreview') //pdf盒子距离顶部的高度
|
||||
let contentDiv = document.querySelector('#content-div').clientWidth;
|
||||
let outerHeight = document.documentElement.clientHeight
|
||||
let scrollTop = document.documentElement.scrollTop
|
||||
if ((outerHeight + scrollTop + 350) >= innerHeight) {
|
||||
@@ -218,7 +237,15 @@ export default {
|
||||
this.loadMore();
|
||||
}
|
||||
}
|
||||
// console.log(pdfPreview.getBoundingClientRect().top,'pdfPreview.getBoundingClientRect().top');
|
||||
if(pdfPreview.getBoundingClientRect().top < 0) {
|
||||
document.querySelector('#pdfTopBox').style.cssText = `position: fixed;bottom:0;width:${contentDiv-9}px`;
|
||||
}
|
||||
if(pdfTopBox.getBoundingClientRect().top < 1000) {
|
||||
document.querySelector('#pdfTopBox').style.cssText = "position:static";
|
||||
}
|
||||
if(scrollTop > 630) {
|
||||
this.isTopBoxShow = true;
|
||||
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -500px;width:245.5px";
|
||||
} else {
|
||||
document.querySelector('#fixd-box').style.cssText = "position: static";
|
||||
@@ -305,6 +332,18 @@ export default {
|
||||
margin-left:0px!important;
|
||||
margin-right:15px!important;
|
||||
}
|
||||
.postfixt-bot{
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
// background-color: #fff;
|
||||
// border: 1px solid #eee;
|
||||
// z-index: 999;
|
||||
.postfixt-bot-box{
|
||||
text-align: right;
|
||||
background-color: #fff;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
.el-card{
|
||||
border:none;
|
||||
}
|
||||
@@ -389,9 +428,8 @@ export default {
|
||||
border: 1px solid #9e9e9e;
|
||||
padding: 3px 10px;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
font-size: 14px;
|
||||
color: #9c9c9c;
|
||||
|
||||
}
|
||||
.item-right {
|
||||
float: right;
|
||||
|
||||
Reference in New Issue
Block a user