quanyawei
2023-11-24 e753bbdd0c0513f0d29d0f6845b1ecab519f422a
src/views/toCarryOutLegislativeReforms/reform/index.vue
@@ -332,15 +332,20 @@
      this.$confirm('立即下载或者后台下载?', '提示', {
        confirmButtonText: '立即下载',
        cancelButtonText: '后台下载',
        distinguishCancelAndClose: true,
        type: 'warning'
      })
        .then(() => {
          this.loading = true
          this.exportData()
        })
        .catch(() => {
          this.loading = false
          this.exportData()
        .catch(action => {
          if (action === 'cancel') {
            this.loading = false
            this.exportData()
          } else {
            this.loading = false
          }
        })
    },
    exportData() {
@@ -371,6 +376,7 @@
          cancel = c
        }),
        onDownloadProgress(progress) {
          console.log('onDownloadProgress', progress)
          const loaded = progress.loaded
          // progress对象中的loaded表示已经下载的数量,total表示总数量,这里计算出百分比
          let downProgress = Math.round((loaded / totalSize) * 100)
@@ -427,7 +433,12 @@
        link.click()
        // 下载完成进行释放
        url.revokeObjectURL(link.href)
        this.$message.success('下载完成!')
        this.$message({
          showClose: true,
          duration: 0,
          message: '下载完成!',
          type: 'success'
        })
        this.loading = false
      }
    },