| | |
| | | |
| | | # xt接口地址 |
| | | VITE_APP_URL_XT=http://218.202.104.82:8200 |
| | | |
| | | # 预览地址 previewURL |
| | | VITE_APP_PREVIEW_URL=http://192.168.1.204:8012 |
| | |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import PreviewFiles from '@/components/PreviewFiles/PreviewFiles.vue' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { Base64 } from 'js-base64' |
| | | |
| | | const store = useStore() |
| | | const userInfo = computed(() => store.getters.userInfo) |
| | |
| | | editParams.value.link = row.link |
| | | } |
| | | |
| | | |
| | | // 'zip', 'rar', 'jar', 'tar', 'gzip', '7z', |
| | | const allSupportedExtensions = [ |
| | | 'doc', 'docx', 'xls', 'xlsx', 'xlsm', 'ppt', 'pptx', 'csv', 'tsv', 'dotm', 'xlt', 'xltm', 'dot', 'dotx', 'xlam', 'xla', |
| | | 'wps', 'dps', 'et', 'ett', 'wpt', |
| | | 'odt', 'ods', 'ots', 'odp', 'otp', 'six', 'ott', 'fodt', 'fods', |
| | | 'vsd', 'vsdx', 'wmf', 'emf', 'psd', |
| | | 'pdf', 'ofd', 'rtf', 'epub', |
| | | 'xmind', 'bpmn', 'eml', |
| | | 'obj', '3ds', 'stl', 'ply', 'gltf', 'glb', 'off', '3dm', 'fbx', 'dae', 'wrl', '3mf', 'ifc', 'brep', 'step', 'iges', 'fcstd', 'bim', |
| | | 'dwg', 'dxf', |
| | | 'txt', 'xml', 'md', 'java', 'php', 'py', 'js', 'css', |
| | | 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'jfif', 'webp', 'tif', 'tiff', 'tga', 'svg', |
| | | 'mp3', 'wav', 'mp4', 'flv', 'avi', 'mov', 'rm', 'webm', 'ts', 'mkv', 'mpeg', 'ogg', 'mpg', 'rmvb', 'wmv', '3gp', 'swf' |
| | | ]; |
| | | const { VITE_APP_PREVIEW_URL } = import.meta.env |
| | | |
| | | // 在线查看文档 |
| | | function seeOnlineWord(row) { |
| | | // 获取点之后的文件格式名 |
| | | const fileType = row?.link?.split('.').pop() || '' |
| | | if (!row.link) { |
| | | ElMessage.warning('文件链接不存在') |
| | | return |
| | | } else if ( |
| | | !row.link.includes('docx') && |
| | | !row.link.includes('pdf') && |
| | | !row.link.includes('png') && |
| | | !row.link.includes('jpg') |
| | | ) { |
| | | }else if (allSupportedExtensions.includes(fileType)){ |
| | | window.open(`${VITE_APP_PREVIEW_URL}/onlinePreview?url=`+encodeURIComponent(Base64.encode(row.link))); |
| | | }else { |
| | | ElMessage.warning(`${fileType}文件格式,可以下载再查看`) |
| | | return |
| | | } else if (row.link.includes('png') || row.link.includes('jpg')) { |
| | | previewVisibleImg.value = true |
| | | searchUrl.value = row.link |
| | | return |
| | | } else if (row.link.includes('docx') || row.link.includes('pdf')) { |
| | | previewVisible.value = true |
| | | searchUrl.value = row.link |
| | | return |
| | | } |
| | | } |
| | | |