this.loading = true;
this.$http({
baseURL: CLOUD_BASE_SERVER_URL,
          url: '/audit/auditRun/exportWord',
          method: 'get',
          responseType: 'blob',
          params: {
id: this.runId,
sumScoreRate: this.sumScoreRate
          }
        }).then(response => {
          this.loading = false
          var data = response.data;
  
          if (!data) {
            return
          }
  
          let url = window.URL.createObjectURL(new Blob([data]))
          let link = document.createElement('a');
          link.style.display = 'none';
          link.href = url;
          //设置新下载的文件名
          var downLoadFileName = '危险源登记.docx';
          link.setAttribute('download', downLoadFileName);
  
          document.body.appendChild(link);
          link.click();
        }).catch((error) => {
          console.log(error);
        });
posted on 2019-07-30 10:32  王者归来GO  阅读(277)  评论(0编辑  收藏  举报