From 6faf65a6a7e72b7ecff52355f798fd00a516ba77 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 30 四月 2026 17:37:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro
---
src/components/Dialog/FileList.vue | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/components/Dialog/FileList.vue b/src/components/Dialog/FileList.vue
index 136ff8b..6e0ca23 100644
--- a/src/components/Dialog/FileList.vue
+++ b/src/components/Dialog/FileList.vue
@@ -5,7 +5,8 @@
@close="handleClose"
class="attachment-dialog">
<!-- 宸ュ叿鏍� -->
- <div class="toolbar">
+ <div v-if="editable"
+ class="toolbar">
<el-button type="primary"
size="small"
@click="handleUpload">
@@ -16,10 +17,11 @@
<el-dialog v-model="uploadDialogVisible"
title="涓婁紶闄勪欢"
width="50%"
- @close="handleUploadClose">
+ @close="closeUpload">
<AttachmentUpload v-model:file-list="newFileList" />
<template #footer>
- <el-button @click="handleUploadClose">鍏抽棴</el-button>
+ <el-button @click="saveUpload">淇濆瓨</el-button>
+ <el-button @click="closeUpload">鍏抽棴</el-button>
</template>
</el-dialog>
<!-- 鏂囦欢鍒楄〃琛ㄦ牸 -->
@@ -40,11 +42,12 @@
<el-button link
type="primary"
size="small"
- :href="scope.row.downloadURL"
- class="download-link">
+ class="download-link"
+ @click="downloadFile(scope.row.downloadURL)">
涓嬭浇
</el-button>
- <el-button link
+ <el-button v-if="editable"
+ link
type="danger"
size="small"
@click="handleDelete(scope.row)">
@@ -93,6 +96,10 @@
type: Boolean,
default: true,
},
+ editable: {
+ type: Boolean,
+ default: true,
+ },
});
const emit = defineEmits(["close", "download", "upload", "delete"]);
@@ -119,7 +126,7 @@
uploadDialogVisible.value = true;
};
- const handleUploadClose = async () => {
+ const saveUpload = async () => {
// 妫�鏌ユ槸鍚︽湁鏂颁笂浼犵殑鏂囦欢
if (newFileList.value.length > 0) {
try {
@@ -136,6 +143,11 @@
proxy?.$modal?.msgError("涓婁紶澶辫触");
}
}
+ uploadDialogVisible.value = false;
+ };
+
+ const closeUpload = () => {
+ newFileList.value = [];
uploadDialogVisible.value = false;
};
@@ -160,6 +172,9 @@
});
};
+ const downloadFile = url => {
+ window.open(url, "_blank");
+ };
onMounted(() => {
setList();
});
--
Gitblit v1.9.3