|
@@ -89,15 +89,17 @@ export const demoDownloadPDF = function (url) {
|
|
|
// 导出下载excel
|
|
|
export const downloadExcel = function (data, fileName) {
|
|
|
if (!data) { return }
|
|
|
+ const a = moment().format('YYYYMMDDHHmmss')
|
|
|
+ const fname = fileName + a
|
|
|
const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
|
- navigator.msSaveBlob(blob, fileName + '.xlsx')
|
|
|
+ navigator.msSaveBlob(blob, fname + '.xlsx')
|
|
|
} else {
|
|
|
const link = document.createElement('a')
|
|
|
link.style.display = 'none'
|
|
|
var href = URL.createObjectURL(blob)
|
|
|
link.href = href
|
|
|
- link.setAttribute('download', fileName + '.xlsx')
|
|
|
+ link.setAttribute('download', fname + '.xlsx')
|
|
|
document.body.appendChild(link)
|
|
|
link.click()
|
|
|
document.body.removeChild(link)
|