browse.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <!-- <web-view
  3. :src="fileUrl"
  4. width="100%"
  5. v-if="showEditFlag"
  6. style="height: calc(100vh - 100px)"
  7. frameborder="0"
  8. allowfullscreen="true"
  9. ></web-view> -->
  10. </template>
  11. <script>
  12. import { getFileType } from './util.js';
  13. export default {
  14. data() {
  15. return {
  16. fileUrl: '',
  17. showEditFlag: false
  18. };
  19. },
  20. methods: {
  21. open(row){
  22. this.showEditFlag=true
  23. this.setFileUrl(row)
  24. },
  25. setFileUrl(row) {
  26. let file = row.storagePath[0];
  27. let fileNames=file.storePath.split('/')
  28. let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
  29. this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
  30. // const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
  31. // this.fileType = getFileType().includes(fileExt) ? 2 : 1;
  32. // if (this.fileType == 2) {
  33. // this.fileUrl =
  34. // '/fm/' +
  35. // (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
  36. // '/view.html?url=' +
  37. // sessionStorage.filePath +
  38. // '/' +
  39. // row.outputNdsFiles;
  40. // } else {
  41. // this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
  42. // // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
  43. // }
  44. }
  45. }
  46. };
  47. </script>
  48. <style scoped lang="scss">
  49. </style>