|
|
@@ -32,7 +32,7 @@
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- fileType: 1,
|
|
|
+
|
|
|
fileUrl: '',
|
|
|
visible: false
|
|
|
};
|
|
|
@@ -43,76 +43,12 @@
|
|
|
setFileUrl(row) {
|
|
|
console.log(row);
|
|
|
let file = row.storagePath[0];
|
|
|
- let url = sessionStorage.filePath + file.storePath;
|
|
|
- const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
|
|
|
- this.fileType = this.getFileType().includes(fileExt) ? 2 : 1;
|
|
|
- if (this.fileType == 2) {
|
|
|
- this.fileUrl =
|
|
|
- '/fm/' +
|
|
|
- (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
|
|
|
- '/view.html?url=' +
|
|
|
- sessionStorage.filePath +
|
|
|
- '/' +
|
|
|
- row.outputNdsFiles;
|
|
|
- } else {
|
|
|
- if (process.env.NODE_ENV === 'development') {
|
|
|
- this.fileUrl =
|
|
|
- 'http://192.168.1.251:51001/kkfile/onlinePreview?url=' +
|
|
|
- btoa(url);
|
|
|
- } else {
|
|
|
- this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
|
|
|
- }
|
|
|
- }
|
|
|
+ let fileNames=file.storePath.split('/')
|
|
|
+ let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
|
|
|
+ this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
|
|
|
this.visible = true;
|
|
|
},
|
|
|
|
|
|
- getFileType() {
|
|
|
- return [
|
|
|
- 'par',
|
|
|
- 'asm',
|
|
|
- 'psm',
|
|
|
- 'dft',
|
|
|
- 'sldprt',
|
|
|
- 'sldasm',
|
|
|
- 'ipt',
|
|
|
- ' iam',
|
|
|
- 'prt',
|
|
|
- '3dxml',
|
|
|
- 'CATPart',
|
|
|
- 'CATProduct',
|
|
|
- 'cgr',
|
|
|
- 'model',
|
|
|
- 'exp',
|
|
|
- 'session',
|
|
|
- 'x_t',
|
|
|
- 'xmt_txt',
|
|
|
- 'x_b',
|
|
|
- 'xmp_bin',
|
|
|
- 'xmp_txt',
|
|
|
- 'sat',
|
|
|
- '.sab',
|
|
|
- '.igs',
|
|
|
- 'iges',
|
|
|
- 'stp',
|
|
|
- 'step',
|
|
|
- 'jt',
|
|
|
- 'xcgm',
|
|
|
- '3dm',
|
|
|
- 'stl',
|
|
|
- 'obj',
|
|
|
- '3mf',
|
|
|
- 'fbx',
|
|
|
- 'vda',
|
|
|
- 'dxf',
|
|
|
- 'dwg',
|
|
|
- 'pdf',
|
|
|
- 'idf',
|
|
|
- 'idb',
|
|
|
- 'emn',
|
|
|
- 'brd'
|
|
|
- ];
|
|
|
- },
|
|
|
-
|
|
|
handleClose() {
|
|
|
this.visible = false;
|
|
|
}
|