美文网首页
vue的excel文件流

vue的excel文件流

作者: 小溪流jun | 来源:发表于2021-08-24 16:42 被阅读0次
    //report报告数据导出
    export function outReport(params) {
        return request({
            url: `${report}/report/download?keyWord=${params.keyword}&page=${params.page}&pageSize=${params.pageSize}&endTime=${params.endTime}&regionId=${params.regionId}&shopId=${params.shopId}&startTime=${params.startTime}&testType=${params.testType}&timeType=${params.timeType}&vinEnabled=${params.vinEnabled}`,
            method: 'GET',
            responseType: 'blob', //excel
        })
    }
    
    // export 导出设备
        exportDevice() {
          let params = {
            keyWord: this.keyWord,
            regionId: this.regionId,
            reportTimeType: this.reportTimeType,
            versionEnabled: this.versionEnabled,
            workShopId: this.workShopId,
          }
          downLoad(params).then((res) => {
            console.log('导出数据', res)
            let url = window.URL.createObjectURL(res)
            let a = document.createElement('a')
            document.body.appendChild(a)
            a.href = url
            a.download = 'autel-device-template-download'
            a.click()
            window.URL.revokeObjectURL(url)
          })
        },
    

    相关文章

      网友评论

          本文标题:vue的excel文件流

          本文链接:https://www.haomeiwen.com/subject/wrgdiltx.html