|
@@ -80,7 +80,7 @@
|
|
<!--视频预览-->
|
|
<!--视频预览-->
|
|
<lookVideoDialog ref="lookVideoDialog"></lookVideoDialog>
|
|
<lookVideoDialog ref="lookVideoDialog"></lookVideoDialog>
|
|
<!--文件预览-->
|
|
<!--文件预览-->
|
|
- <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
|
|
|
|
|
|
+ <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -88,13 +88,14 @@
|
|
import { getFileList,getFileCategory } from "@/api/systemManagement/index";
|
|
import { getFileList,getFileCategory } from "@/api/systemManagement/index";
|
|
import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
|
|
import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
|
|
import lookVideoDialog from '@/components/lookVideoDialog/lookVideoDialog.vue'
|
|
import lookVideoDialog from '@/components/lookVideoDialog/lookVideoDialog.vue'
|
|
- import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
|
|
|
|
|
|
+ import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'filePreview',
|
|
name: 'filePreview',
|
|
components: {
|
|
components: {
|
|
fullScreenView,
|
|
fullScreenView,
|
|
lookVideoDialog,
|
|
lookVideoDialog,
|
|
- lookDocumentDialog
|
|
|
|
|
|
+ fullScreenFileLook
|
|
},
|
|
},
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
@@ -156,25 +157,35 @@
|
|
},
|
|
},
|
|
//预览
|
|
//预览
|
|
tableButton(item){
|
|
tableButton(item){
|
|
- if(item.fileType){
|
|
|
|
- if(item.fileType.indexOf("image") !== -1){
|
|
|
|
- //图片预览
|
|
|
|
- this.$set(this,'fullScreenViewProps',[item.fileUrl]);
|
|
|
|
- this.$refs['fullScreenView'].initialize();
|
|
|
|
|
|
+ //判断类型
|
|
|
|
+ if(item.fileName&&item.fileUrl){
|
|
|
|
+ let type = '';
|
|
|
|
+ if(item.fileName.split('.')[1] == 'doc' || item.fileName.split('.')[1] == 'docx'){
|
|
|
|
+ type = 'docx'
|
|
|
|
+ }else if(item.fileName.split('.')[1] == 'xls' || item.fileName.split('.')[1] == 'xlsx'){
|
|
|
|
+ type = 'excel'
|
|
|
|
+ }else if(item.fileName.split('.')[1] == 'pdf'){
|
|
|
|
+ type = 'pdf'
|
|
|
|
+ }else if(item.fileName.split('.')[1] == 'png' || item.fileName.split('.')[1] == 'jpg' || item.fileName.split('.')[1] == 'gif'){
|
|
|
|
+ type = 'img'
|
|
}else if(item.fileType.indexOf("video") !== -1){
|
|
}else if(item.fileType.indexOf("video") !== -1){
|
|
- //视频预览
|
|
|
|
- this.$refs.lookVideoDialog.lookVideoDialogOpen(1,item.url,'预览');
|
|
|
|
- }else if( item.fileType.indexOf("application/vnd.ms-excel") !== -1 ||
|
|
|
|
- item.fileType.indexOf("application/vnd.ms-powerpoint") !== -1 ||
|
|
|
|
- item.fileType.indexOf("application/vnd.ms-word") !== -1 ||
|
|
|
|
- item.fileType.indexOf("application/pdf") !== -1 ){
|
|
|
|
- //文档预览
|
|
|
|
- this.lookDocumentButton(1,item.fileUrl)
|
|
|
|
|
|
+ type = 'mp4'
|
|
|
|
+ }
|
|
|
|
+ //整合地址
|
|
|
|
+ let url = window.location.href.split('://')[0]+'://'+localStorage.getItem('fileBrowseEnvironment')+item.fileUrl;
|
|
|
|
+ // 判断图片还是文件
|
|
|
|
+ if(type == 'img'){
|
|
|
|
+ this.$set(this,'fullScreenViewProps',[url]);
|
|
|
|
+ this.$refs['fullScreenView'].initialize();
|
|
|
|
+ }else if(type == 'docx' || type == 'excel' || type == 'pdf'){
|
|
|
|
+ this.$refs['fullScreenFileLook'].initialize(item.fileName,url,type);
|
|
|
|
+ }else if(type == 'mp4'){
|
|
|
|
+ this.$refs.lookVideoDialog.lookVideoDialogOpen(1,url,'预览');
|
|
}else{
|
|
}else{
|
|
this.msgError('该类型文件暂无法预览')
|
|
this.msgError('该类型文件暂无法预览')
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.msgError('该类型文件暂无法预览')
|
|
|
|
|
|
+ this.msgError('数据异常无法预览')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
lookDocumentButton(type,url){
|
|
lookDocumentButton(type,url){
|