From 45bfb77d4b4d1b1d3204475caba9b9c0e3e04ef9 Mon Sep 17 00:00:00 2001 From: 石广澎 <shiguangpeng@163.com> Date: 星期二, 12 十二月 2023 16:58:29 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- admin-web/src/utils/base.js | 32 ++++---------------------------- 1 files changed, 4 insertions(+), 28 deletions(-) diff --git a/admin-web/src/utils/base.js b/admin-web/src/utils/base.js index b2f7f05..76b7d74 100644 --- a/admin-web/src/utils/base.js +++ b/admin-web/src/utils/base.js @@ -23,24 +23,6 @@ return getBaseUrl() + '/pc/fin/file/uploadMore' } -// 棰勮鏂囦欢 -export function previewDoc(obj) { - const routeUrl = this.$router.resolve({url: '/webOffice/preview'}) - let url = obj.url - const wordLIst = ['doc', 'docm', 'docx', 'docxf', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'fb2', 'htm', 'html', 'mht', 'odt', 'oform', 'ott', 'oxps', 'pdf', 'rtf', 'txt', 'djvu', 'xml', 'xps', 'csv', 'fods', 'ods', 'ots', 'xls', 'xlsb', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx'] - const arr = url.split('.') - if (arr.length === 2) { - if (wordLIst.includes(arr[arr.length - 1])) { - if (obj.url.indexOf('http') !== 0) { - url = SettingIplatform.ftpUrl + url - } - const newWindow = window.open(routeUrl.href + '?url=' + encodeURIComponent(url) + '&docName=' + encodeURIComponent(encodeURIComponent(obj.fileName)), '_blank') - if (newWindow) newWindow.opener = null - } else { - Message.warning('鏂囦欢鏍煎紡涓嶆敮鎸侀瑙堬紒') - } - } -} // 涓嬭浇鏂囦欢 export function downLoad(obj) { @@ -49,18 +31,12 @@ url = SettingIplatform.ftpUrl + obj.url } window.open(decodeURI(url)) - /* var doc = document.createElement('a') + var doc = document.createElement('a') doc.href = url - doc.download = filename doc.target = '_blank' - doc.click()*/ - /* const loading = Loading.service({ - lock: true, - text: '姝e湪涓嬭浇...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - download(obj.url, obj.name, null, loading)*/ + doc.rel = "noreferrer noopener" + doc.click() + document.body.removeChild(doc); } // 涓婁紶鏂囦欢 -- Gitblit v1.9.1