Преглед на файлове

fix(dm): 移除上传页整体进度,只保留单文件进度

删除总进度条、overallProgress 状态及平均进度计算;
文件行内的上传百分比和状态保持不变。
cc преди 3 седмици
родител
ревизия
ab9434eab0
променени са 1 файла, в които са добавени 1 реда и са изтрити 60 реда
  1. 1 60
      ai-electron/frontend/src/case/views/data/upload.vue

+ 1 - 60
ai-electron/frontend/src/case/views/data/upload.vue

@@ -135,13 +135,6 @@
                 </button>
               </div>
             </div>
-            <!-- 整体进度 -->
-            <div v-if="isUploading" class="upload-overall-progress">
-              <div class="upload-overall-progress__bar">
-                <div class="upload-overall-progress__fill" :style="{ width: overallProgress + '%' }"></div>
-              </div>
-              <span class="upload-overall-progress__text">总进度 {{ overallProgress }}%</span>
-            </div>
           </div>
           <div v-else class="upload-file-list upload-file-list--empty">
             <div class="upload-empty">暂无待上传文件,选择文件后将自动上传解析</div>
@@ -225,7 +218,6 @@
   const uploadProgressMap = ref<Map<File, number>>(new Map());
   const uploadStatuses = ref<Map<File, 'pending' | 'uploading' | 'done' | 'error'>>(new Map());
   const isUploading = ref(false);
-  const overallProgress = ref(0);
   const dragOver = ref(false);
 
   // 解析结果(右侧 treetable 数据源,实时追加)
@@ -421,7 +413,6 @@
     selectedFiles.value = [];
     uploadProgressMap.value = new Map();
     uploadStatuses.value = new Map();
-    overallProgress.value = 0;
   };
 
   /** 移除单个待上传文件(上传解析中不允许移除) */
@@ -436,9 +427,6 @@
     selectedFiles.value.splice(index, 1);
     uploadProgressMap.value.delete(target);
     uploadStatuses.value.delete(target);
-    if (!selectedFiles.value.length) {
-      overallProgress.value = 0;
-    }
   };
 
   const persistFileInfos = (infos: Recordable[]) => {
@@ -526,16 +514,6 @@
 
         const onProgress = (percent: number) => {
           uploadProgressMap.value.set(file, percent);
-          // 总进度:全量待处理文件按(pending=0 / uploading=进度 / error=100)取平均
-          const list = selectedFiles.value;
-          const total = list.length || 1;
-          const sum = list.reduce((acc, f) => {
-            const st = uploadStatuses.value.get(f);
-            if (st === 'uploading') return acc + (uploadProgressMap.value.get(f) || 0);
-            if (st === 'error') return acc + 100;
-            return acc;
-          }, 0);
-          overallProgress.value = Math.round(sum / total);
         };
 
         try {
@@ -578,7 +556,6 @@
         }
       }
 
-      overallProgress.value = 100;
       // 只有解析出工作表(children)的才算真正解析成功;「未解析」的节点也占一个 resultTrees 名额,
       // 若直接按长度提示「成功解析 N 个文件」,对用户就是假消息。
       const parsedCount = resultTrees.value.filter((root) => (root.children || []).length > 0).length;
@@ -1465,37 +1442,6 @@
       }
     }
 
-    .upload-overall-progress {
-      flex-shrink: 0;
-      display: flex;
-      align-items: center;
-      gap: 10px;
-      padding: 8px 12px;
-      border-top: 1px solid #e2e8f0;
-
-      &__bar {
-        flex: 1;
-        height: 5px;
-        border-radius: 3px;
-        background: #e2e8f0;
-        overflow: hidden;
-      }
-
-      &__fill {
-        height: 100%;
-        border-radius: 3px;
-        background: #2563eb;
-        transition: width 0.3s ease;
-      }
-
-      &__text {
-        font-size: 12px;
-        color: #475569;
-        font-weight: 500;
-        white-space: nowrap;
-      }
-    }
-
     @media (max-width: 1080px) {
       .upload-layout {
         flex-direction: column;
@@ -1561,8 +1507,7 @@
       }
 
       .panel-header,
-      .upload-file-list__header,
-      .upload-overall-progress {
+      .upload-file-list__header {
         border-color: #1f2937;
       }
 
@@ -1589,10 +1534,6 @@
         color: #94a3b8;
       }
 
-      .upload-overall-progress__bar {
-        background: #1f2937;
-      }
-
       .status-tag.is-other {
         background: #1e293b;
         color: #94a3b8;