Fix download submissions
This commit is contained in:
parent
c6238d8880
commit
695153eac9
|
@ -60,9 +60,9 @@
|
||||||
href="javascript:void(0);" class="text-gray-500" @click="showColumnsModal=true"
|
href="javascript:void(0);" class="text-gray-500" @click="showColumnsModal=true"
|
||||||
>Display columns</a>
|
>Display columns</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="text-right text-xs uppercase">
|
<p class="text-right cursor-pointer text-xs uppercase">
|
||||||
<a
|
<a
|
||||||
:href="exportUrl" target="_blank"
|
@click.prevent="downloadAsCsv" href="#"
|
||||||
>Export as CSV</a>
|
>Export as CSV</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -248,6 +248,15 @@ export default {
|
||||||
this.fullyLoaded = false
|
this.fullyLoaded = false
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.getSubmissionsData()
|
this.getSubmissionsData()
|
||||||
|
},
|
||||||
|
downloadAsCsv() {
|
||||||
|
opnFetch(this.exportUrl, { responseType: "blob" })
|
||||||
|
.then( blob => {
|
||||||
|
var file = window.URL.createObjectURL(blob);
|
||||||
|
window.location.assign(file);
|
||||||
|
}).catch((error)=>{
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue