Commit a224ea9d by 焦子成

1

parent 01ebec5a
...@@ -533,6 +533,11 @@ export const useDownloadStore = defineStore('download', () => { ...@@ -533,6 +533,11 @@ export const useDownloadStore = defineStore('download', () => {
download.status = 'paused' download.status = 'paused'
activeDownloadCount.value-- activeDownloadCount.value--
saveToStorage() saveToStorage()
http.post(config.downLoadStatus,{
detailId: download.id,
fileStatus: 2, //下载状态 0:等待中 1:下载中 2:已暂停 3:已完成 4:失败
}).then(res=>{
})
// 只有在非批量下载且非单个下载模式下才自动启动下一个等待中的下载 // 只有在非批量下载且非单个下载模式下才自动启动下一个等待中的下载
if (!isBatchDownloading.value && !isSingleDownloading.value) { if (!isBatchDownloading.value && !isSingleDownloading.value) {
startNextPendingDownload() startNextPendingDownload()
......
...@@ -130,15 +130,13 @@ ...@@ -130,15 +130,13 @@
<el-table-column prop="fileSize" label="文件大小" width="120"> <el-table-column prop="fileSize" label="文件大小" width="120">
<template #default="scope"> <template #default="scope">
<!-- {{ formatFileSize(scope.row.fileSize) }} --> {{ scope.row.status=='completed' ? scope.row.fileSize : '-' }}
{{ scope.row.fileSize }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="downloadedBytes" label="已下载" width="120"> <el-table-column prop="downloadedBytes" label="已下载" width="120">
<template #default="scope"> <template #default="scope">
<!-- {{ formatFileSize(scope.row.downloadedBytes) }} --> {{ scope.row.status=='completed' ? scope.row.fileSize : '-' }}
{{ scope.row.fileSize }}
</template> </template>
</el-table-column> </el-table-column>
...@@ -436,7 +434,6 @@ const getStatusText = (status) => { ...@@ -436,7 +434,6 @@ const getStatusText = (status) => {
// 查看详情 // 查看详情
const viewDetails = (record) => { const viewDetails = (record) => {
// selectedRecord.value = record
http.post(config.detailInfo,{detailId: record.id}).then(res=>{ http.post(config.detailInfo,{detailId: record.id}).then(res=>{
if (res.code === 200){ if (res.code === 200){
selectedRecord.value = { selectedRecord.value = {
...@@ -448,7 +445,7 @@ const viewDetails = (record) => { ...@@ -448,7 +445,7 @@ const viewDetails = (record) => {
"status": statusMap[res.data.fileStatus], "status": statusMap[res.data.fileStatus],
"progress": res.data.fileStatus == 3 ? 100: 0, "progress": res.data.fileStatus == 3 ? 100: 0,
"fileSize": res.data.fileLength, "fileSize": res.data.fileLength,
"downloadedBytes": res.data.fileStatus == 3 ? res.data.fileLength: '0 KB', "downloadedBytes": res.data.fileStatus == 3 ? res.data.fileLength: '-',
"startTime": res.data.createTime, "startTime": res.data.createTime,
"endTime": '', "endTime": '',
"error": res.data.errorMsg "error": res.data.errorMsg
...@@ -492,16 +489,15 @@ const clearAllHistory = async () => { ...@@ -492,16 +489,15 @@ const clearAllHistory = async () => {
type: 'warning' type: 'warning'
} }
) )
authStore.clearDownloadHistory() authStore.clearDownloadHistory()
// loadHistory()
// ElMessage.success('历史记录已清空')
http.post(config.uploadDetailDeleteAll, { http.post(config.uploadDetailDeleteAll, {
type: 1 type: 1
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
loadHistory()
ElMessage.success('历史记录已清空') ElMessage.success('历史记录已清空')
loadHistory()
loadUploadDetailTotalNum()
} else { } else {
ElMessage.error(res.message) ElMessage.error(res.message)
} }
...@@ -515,14 +511,11 @@ const clearAllHistory = async () => { ...@@ -515,14 +511,11 @@ const clearAllHistory = async () => {
const handleSizeChange = (size) => { const handleSizeChange = (size) => {
pageSize.value = size pageSize.value = size
currentPage.value = 1 currentPage.value = 1
// deQuery.value.pageSize = size
// deQuery.value.current = 1
loadHistory() loadHistory()
} }
const handleCurrentChange = (page) => { const handleCurrentChange = (page) => {
currentPage.value = page currentPage.value = page
// deQuery.value.current = page
loadHistory() loadHistory()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment