mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 02:16:43 +08:00
pdf提示
This commit is contained in:
@@ -86,6 +86,8 @@
|
||||
<el-image :src="fileBaseUrl+content.content" fit="fill"></el-image>
|
||||
</div>
|
||||
<div v-if="content.contentType==40">
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus < 2">文档未转化完成 </div>
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus == 3">您上传的文档转化失败,请联系管理员</div>
|
||||
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
||||
</div>
|
||||
</div>
|
||||
@@ -353,7 +355,7 @@
|
||||
// inject: [ "informationDetails" ],
|
||||
data(){
|
||||
return {
|
||||
converStatus:0,
|
||||
converStatus:4,
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
curPdfPath:'',
|
||||
comTypes:[
|
||||
@@ -489,21 +491,18 @@
|
||||
},
|
||||
loadPdfFile(){
|
||||
//检查当前是否是pdf,如果是pdf那么就不需要再查询一次了
|
||||
|
||||
let fname=this.content.content;
|
||||
|
||||
if(fname && fname.indexOf('.pdf')>-1){
|
||||
this.curPdfPath=this.content.content;
|
||||
}else{
|
||||
apiCourseFile.detail(this.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.converStatus = rs.result.converStatus;
|
||||
this.converStatus = rs.result.converStatus;
|
||||
if(rs.result.previewFilePath){
|
||||
this.curPdfPath=rs.result.previewFilePath;
|
||||
}else{
|
||||
this.curPdfPath=rs.result.filePath;
|
||||
}
|
||||
//console.log(this.curPdfPath,'this.curPdfPath');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@
|
||||
<el-button @click="loadPdfFile();" type="primary">保存</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div style="padding: 10px;color: #767676; ">如果pdf无法显示,请稍后再试,文档转化是异步处理,有可能是文档还未转化完成 </div>
|
||||
<pdfPreview v-if="cware.content.contentType == 40" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus < 2">文档未转化完成 </div>
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus == 3">您上传的文档转化失败,请联系管理员</div>
|
||||
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -553,6 +553,7 @@
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
converStatus:4,
|
||||
courseFileShow:false,
|
||||
curContent:{id:'',contentType:0,contenRefId:''},
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
@@ -724,8 +725,10 @@
|
||||
}else{
|
||||
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.converStatus = rs.result.converStatus;
|
||||
this.courseFileShow = false;
|
||||
this.cware.content.pdfPath=rs.result.previewFilePath;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1032,7 +1035,7 @@
|
||||
}else if(ctype==30){
|
||||
return ["jpg","png","gif"]
|
||||
}else if(ctype==40){
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx"]
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx","pdf"]
|
||||
}else{
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx","jpg","png","gif","mp3","mp4"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user