优化打包流程

This commit is contained in:
aixianling
2022-04-01 17:28:15 +08:00
parent 3dad000a72
commit b6b3266a3e

View File

@@ -16,7 +16,7 @@
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="process" label="打包进度">
<template slot-scope="{row}">
<span v-if="row.count==0" v-text="row.download?`最近打包时间:${row.download}`:`暂无打包`"/>
<span v-if="row.count==0" v-text="getProcessMsg(row)"/>
<el-progress v-else :percentage="row.count"/>
</template>
</el-table-column>
@@ -130,10 +130,15 @@ export default {
clearInterval(timer)
this.$message.error("打包失败!")
} else this.handleConfirmZip(row).then(v => {
if (v) {
if (v.error) {
clearInterval(timer)
row.count = 100
row.download = true
this.$message.error("打包失败!")
row.error = v.error
row.count = 0
} else if (v.download) {
clearInterval(timer)
row.download = v.download
row.count = 0
} else row.count++
})
}, 3000)
@@ -185,8 +190,10 @@ export default {
params: {id}
}).then(res => {
if (res?.code == 0) return res.data
else return false
})
},
getProcessMsg(row) {
return row.error || (row.download ? `最近打包时间:${row.download}` : `暂无打包`)
}
},
created() {