feat:完成员工档案导出

This commit is contained in:
xiongchengqiang 2020-05-21 18:39:00 +08:00
parent 814b3084de
commit 0f03b3db5f

View File

@ -191,15 +191,15 @@ export default {
//
async handleExport () {
let result = await apiExportFile()
console.log('result: ', result)
const blob = new Blob([result], { type: 'application/json' })
// const blob = new Blob([data], {type: 'audio/wav'})
const a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = '员工档案.xls' //
a.click()
URL.revokeObjectURL(a.href)
a.remove()
if ('msSaveOrOpenBlob' in navigator) {
window.navigator.msSaveOrOpenBlob(result, 'results.txt')
} else {
var url = window.URL.createObjectURL(result)
var link = document.createElement('a')
link.href = url
link.setAttribute('download', '员工档案.xls')
link.click()
}
},
//
async handleUpLoad (file) {