From 1a8a9ff4fd90e28bf33bca809c5ea0372db3dd48 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 04 Sep 2025 17:13:34 +0800
Subject: [PATCH] feat:设置间距
---
src/page/index/useDownloadWs.js | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/page/index/useDownloadWs.js b/src/page/index/useDownloadWs.js
index d39324d..2113b6d 100644
--- a/src/page/index/useDownloadWs.js
+++ b/src/page/index/useDownloadWs.js
@@ -15,9 +15,16 @@
let currentWebSocket = null
function messageHandler(payload) {
const {type,status,progress,download_url} = payload
- const setProgress = status === 'CANCELLED'
- ? 100
- : (status !== 'COMPLETED' && progress === 100) ? 99 : progress
+ let setProgress = 0
+ if (status === 'PENDING'){
+ setProgress = 1
+ }else if(status === 'CANCELLED'){
+ setProgress = 100
+ }else if(status !== 'COMPLETED' && progress === 100){
+ setProgress = 99
+ }else{
+ setProgress = progress
+ }
store.commit('setDownloadProgress', {
...downloadProgress.value,
[type]: setProgress,
--
Gitblit v1.9.3