Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
download-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
downloader
download-web
Commits
a224ea9d
Commit
a224ea9d
authored
Sep 02, 2025
by
焦子成
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
01ebec5a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
src/stores/download.js
+5
-0
src/views/Downloader.vue
+0
-0
src/views/History.vue
+6
-13
No files found.
src/stores/download.js
View file @
a224ea9d
...
...
@@ -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()
...
...
src/views/Downloader.vue
View file @
a224ea9d
This diff is collapsed.
Click to expand it.
src/views/History.vue
View file @
a224ea9d
...
...
@@ -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
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment