From 9a659a447541edf1502ad424563f066254923b60 Mon Sep 17 00:00:00 2001
From: ysn <2126564605@qq.com>
Date: Thu, 4 Jun 2026 17:05:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=85=B7-=E5=8A=9F=E8=83=BD=E8=81=94?=
=?UTF-8?q?=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/utility/index.vue | 52 +++++++++++++++++--------------------
1 file changed, 24 insertions(+), 28 deletions(-)
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 @@
- {{
- getStatusText(
- scope.row.transfer_type,
- scope.row
- )
- }}
+ {{ getStatusText(scope.row.transfer_type, scope.row) }}
-
+
打开位置
-
+
@@ -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();
}
},