Commit 462a737a by 张立顺

fix bug

1 parent 2e8f2263
......@@ -58,6 +58,18 @@ const version = new Version({
isSign: false
}
})
function normalizeAsyncExportUuid(result) {
if (result == null || result === '') return ''
if (typeof result === 'string') return result.trim()
if (typeof result === 'object') {
const v = result.uuid ?? result.fileUuid ?? result.data
if (typeof v === 'string' && v.trim()) return v.trim()
if (v != null && typeof v !== 'object') return String(v).trim()
}
return ''
}
export default {
components: {
privacyAgreementDialog
......@@ -197,6 +209,18 @@ export default {
...mapActions('d2admin/user', ['load', 'loadAcocunt', 'actionSetDownloadList']),
...mapActions('d2admin/account', ['logout']),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
markAsyncExportSubmitFailed(timeid) {
const list = this.dowloadList.map((item) => {
if (item.timeid == timeid) {
item.status = 'end'
item.labelText = '导出失败'
item.ifSuccess = true
delete item.uuid
}
return item
})
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
getUploadlistInfo(list) {
// if (this.dowloadTimer) {
const that = this
......@@ -225,20 +249,25 @@ export default {
const params = Object.assign(this.waitDownloadList[0])
// async const result = await
params && asyncExportExcel({ exportParam: params.exportParam }).then((result) => {
if (result) {
const uuid = normalizeAsyncExportUuid(result)
if (uuid) {
this.dowloadTimerNum = 0
const list = this.dowloadList.map((item) => {
if (item.timeid == params.timeid) {
item.status = 'polling'
item.uuid = result
item.uuid = uuid
}
return item
})
this.actionSetDownloadList({ list, type: 'dowloadList' })
!this.isWorking && this.getDownloadslistInfo()
} else {
this.markAsyncExportSubmitFailed(params.timeid)
this.notice.warningTips('导出失败')
}
}).catch((err) => {
console.log(err)
this.markAsyncExportSubmitFailed(params.timeid)
})
// console.log(result)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!