|
|
@@ -848,6 +848,12 @@ const handleSelectionChange = (selection) => {
|
|
|
}
|
|
|
|
|
|
const handleDownload = async () => {
|
|
|
+ // 判空检查
|
|
|
+ if (!selectionProject.value || selectionProject.value.length === 0) {
|
|
|
+ ElMessage.warning('请先选择要下载的项目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
let data: any[] = []
|
|
|
console.log(selectionProject)
|
|
|
selectionProject.value.forEach(
|
|
|
@@ -863,6 +869,12 @@ const handleDownload = async () => {
|
|
|
}
|
|
|
)
|
|
|
|
|
|
+ let loadingInstance = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在下载...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ })
|
|
|
+
|
|
|
try {
|
|
|
// 调用 API 获取 ZIP blob
|
|
|
const zipBlob = await PipeInputApi.handleDownload(data)
|
|
|
@@ -889,10 +901,18 @@ const handleDownload = async () => {
|
|
|
} catch (error) {
|
|
|
console.error('下载失败:', error)
|
|
|
ElMessage.error('下载失败')
|
|
|
+ } finally {
|
|
|
+ loadingInstance.close()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const handlePrint = async () => {
|
|
|
+ // 判空检查
|
|
|
+ if (!selectionProject.value || selectionProject.value.length === 0) {
|
|
|
+ ElMessage.warning('请先选择要打印的项目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
let data: any[] = []
|
|
|
selectionProject.value.forEach(
|
|
|
(item) => {
|