文件下载功能的前台页面的展示

首先在.vue文件里将样式给写好vue

<a style="margin-left: 55px; cursor: pointer;" @click="popExcel" > <i class="glyphicon glyphicon-download-alt" title="下载"></i> 导出获奖列表信息 </a>web

下载的功能后台已经都已经写好的,因此只要展示一下就能够了,api

直接写个方法就好了,测试

`this

excel(date){//导出某天获奖列表到excelspa

            api.getExportAwardExcel(this.date, this.kId)excel

            .then(res => {get

                this.$refs.dialog3.close()it

                if (this.kId === null) {//测试环境io

                    window.location.href = 'https://lab.yoosh.tv/mgmt/export/exportAwardExcel?date=' + this.date

                }else{

                    window.location.href = 'https://lab.yoosh.tv/mgmt/export/exportAwardExcel?date=' + this.date + '&kId=' + this.kId

                }

                if (res.data.ok) {

                    console.log(res.data)

                }

            }).catch(err => {

                alert(err)

            })

        },

` 不少时候实际上是一个很简单的功能,因此就不须要搞得太复杂化,简单点。

相关文章
相关标签/搜索