fei
12 小时以前 e81f448084ab4f340860598498f035df23a9d014
src/views/archiveDoublePdf/index.vue
@@ -21,12 +21,12 @@
          <div class="el-upload__tip" slot="tip">支持单个或批量上传,请选择PDF文件</div>
        </el-upload>
      </div>
      <!-- 下载按钮区域 - 上传前禁用,上传后可用 -->
      <div class="download-container" style="white-space: nowrap;">
        <el-button
          type="primary"
          icon="el-icon-download"
        <el-button
          type="primary"
          icon="el-icon-download"
          @click="downloadFile"
          :disabled="!canDownload"
        >
@@ -43,9 +43,9 @@
            </a>
          </div>
          <div>
            <el-button
              type="text"
              icon="el-icon-copy-document"
            <el-button
              type="text"
              icon="el-icon-copy-document"
              @click="copyLink"
              size="small"
            >
@@ -62,7 +62,7 @@
import { getToken } from '@/utils/auth'
import { getPdfFile } from '@/api/system/dpdf'
export default {
  name: "DoublePdf",
  name: "Pdf",
  data() {
    return {
      fid: '',
@@ -123,22 +123,22 @@
    getList() {
      this.loading = true
    },
    /** 上传前检查 */
    beforeUpload(file) {
      const isPdf = file.type === 'application/pdf'
      const isLt50M = file.size / 1024 / 1024 < 50
      if (!isPdf) {
        this.$message.error('上传文件只能是 PDF 格式!')
      }
      if (!isLt50M) {
        this.$message.error('上传文件大小不能超过 50MB!')
      }
      return isPdf && isLt50M
    },
    /** 上传成功处理 */
    handleUploadSuccess(response) {
      console.log(response)
@@ -157,7 +157,7 @@
        this.$message.error(response.msg || '上传失败')
      }
    },
    /** 获取下载链接 */
    downloadFile() {
      // 发起ajax请求获取下载链接
@@ -183,7 +183,7 @@
        this.$message.error('获取下载链接失败,请重试')
      })
    },
    /** 复制链接到剪贴板 */
    copyLink() {
      if (this.displayedDownloadLink) {
@@ -194,7 +194,7 @@
        textarea.style.opacity = '0'
        document.body.appendChild(textarea)
        textarea.select()
        try {
          document.execCommand('copy')
          this.$message.success('链接已复制到剪贴板')
@@ -206,7 +206,7 @@
        }
      }
    },
    /** 上传失败处理 */
    handleUploadError(err) {
      this.$message.error('上传失败,请重试')