feat:完成员工档案导出
This commit is contained in:
parent
814b3084de
commit
0f03b3db5f
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user