pdf提示

This commit is contained in:
LAPTOP-S9RBPPM6\bjxask-2201
2022-06-01 16:28:39 +08:00
parent eee0946aca
commit 08d2a1aa22
2 changed files with 11 additions and 9 deletions

View File

@@ -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');
}
});
}

View File

@@ -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"]
}