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) {