Commit a224ea9d by 焦子成

1

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