fix: 修复上传进度显示和重试逻辑问题

- 在FileMessage.vue中,仅当上传进度大于0时显示进度圆环,避免初始状态显示
- 在PanelContent.vue中,为retry函数添加参数传递,确保重试操作针对特定项目
- 在uploads.ts中,添加暂停状态检查并处理上传失败时的进度回调
This commit is contained in:
Phoenix 2025-05-26 16:58:12 +08:00
parent e2e0a3ea3a
commit 19a6c89b76
3 changed files with 5 additions and 4 deletions

View File

@ -122,7 +122,7 @@ const handleDownload = () => {
<img class="file-icon" :src="fileInfo.icon" alt="文件图标">
<!-- 上传进度圆环 - 上传状态 -->
<div v-if="extra.is_uploading" class="progress-overlay">
<div v-if="extra.is_uploading&&extra.percentage>0" class="progress-overlay">
<div class="circle-progress-container" @click.stop="togglePlay">
<svg class="circle-progress" width="20" height="20" viewBox="0 0 20 20">
<!-- 底色圆环 -->

View File

@ -178,7 +178,7 @@ export const useUploadsStore = defineStore('uploads', {
// 获取最新的项目状态,确保仍然存在且没有被暂停
const updatedItem:any = this.findItem(uploadId)
if(updatedItem.is_paused) return
if (res.code == 200) {
// 当前分片上传成功,增加索引
updatedItem.uploadIndex++
@ -205,6 +205,7 @@ export const useUploadsStore = defineStore('uploads', {
this.triggerUpload(uploadId, clientUploadId)
}
} else {
updatedItem.onProgress(-1)
// 上传失败处理
console.error(`分片上传失败,错误码: ${res.code},错误信息: ${res.message || '未知错误'}`);
updatedItem.status = 3

View File

@ -315,7 +315,7 @@ watch(
// onMounted(() => {
// onLoad({ ...props, limit: 30 })
// })
const retry=()=>{
const retry=(item:any)=>{
confirmBox({
content:'确定重发吗'
}).then(()=>{
@ -422,7 +422,7 @@ const retry=()=>{
"
class="mr-10px"
>
<n-button text style="font-size: 20px;" @click="retry">
<n-button text style="font-size: 20px;" @click="retry(item)">
<n-icon color="#CF3050">
<ExclamationCircleFilled />
</n-icon>