licp
2024-11-15 aef2a5e2daaef5e567d5ba0910581f188f201180
修改文件预览
已修改1个文件
14 ■■■■ 文件已修改
src/components/tool/file-preview.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/file-preview.vue
@@ -11,7 +11,7 @@
    <div v-if="isDoc">
      <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p>
      <a :href="fileUrl" v-if="!isDocShow">下载文件</a>
      <vue-office-docx
      <vue-office-docx v-else
          :src="fileUrl"
          style="height: 100vh;"
          @rendered="renderedHandler"
@@ -21,7 +21,7 @@
    <div v-if="isXls">
      <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p>
      <a :href="fileUrl" v-if="!isDocShow">下载文件</a>
      <vue-office-excel
      <vue-office-excel v-else
        :src="fileUrl"
        :options="options"
        style="height: 100vh;"
@@ -108,7 +108,15 @@
      return /\.(doc|docx)$/i.test(this.fileUrl);
    },
    isXls(){
      return /\.(xls|xlsx)$/i.test(this.fileUrl);
      let state = /\.(xls|xlsx)$/i.test(this.fileUrl)
      if(state){
        if(/\.(xlsx)$/i.test(this.fileUrl)){
          this.options.xls = false
        }else{
          this.options.xls = true
        }
      }
      return state;
    },
    isZipOrRar() {
      return /\.(zip|rar)$/i.test(this.fileUrl);