diff --git a/src/views/utility/index.vue b/src/views/utility/index.vue index 61f914c..e16aece 100644 --- a/src/views/utility/index.vue +++ b/src/views/utility/index.vue @@ -51,7 +51,13 @@ @@ -68,25 +74,15 @@ - + @@ -251,7 +237,6 @@ export default { getStatusText(type, row) { const isSuccess = row.is_success; const isUploading = row.is_uploading; - if (type === 3) { // 知识库上传类型 if (isUploading && !isSuccess) return "上传中"; @@ -267,7 +252,6 @@ export default { getStatusType(type, row) { const isSuccess = row.is_success; const isUploading = row.is_uploading; - if (isUploading && !isSuccess) return "warning"; if (!isSuccess) return "danger"; return "success"; @@ -284,10 +268,12 @@ export default { // 打开文件位置 handleOpenLocation(item) { if (item.file_url) { - this.$modal.msg("浏览器安全限制:请下载后在下载列表打开文件夹"); + this.$modal.msg("浏览器安全限制:请下载文件后在下载列表中打开文件夹"); + // 先触发下载 const a = document.createElement("a"); a.href = item.file_url; a.download = item.file_name; + a.target = "_blank"; document.body.appendChild(a); a.click(); document.body.removeChild(a); @@ -340,6 +326,16 @@ export default { const record = this.transferRecords.find((r) => r.id === id); if (record) { record.is_success = isSuccess; + record.is_uploading = false; + this.saveTransferRecords(); + } + }, + // 更新上传进度(供外部调用) + updateUploadProgress(id, percent) { + const record = this.transferRecords.find((r) => r.id === id); + if (record) { + record.upload_percent = percent; + record.is_uploading = percent < 100; this.saveTransferRecords(); } },