浏览代码

Merge branch 'cloudDisk_download_check'

hbchen 1 年之前
父节点
当前提交
b41e610102
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/views/report_manage/cloudDisk.vue

+ 12 - 2
src/views/report_manage/cloudDisk.vue

@@ -458,7 +458,7 @@ import 'streamsaver/examples/zip-stream'
       },
       // 下载文件
       downloadFile(row){
-        if(row.Size === 0) return this.$message.warning('文件夹为空')
+        if(row.Size === 0) return this.$message.warning('文件夹为空,暂不支持下载')
         let downloadHint = this.$message({
           type:"info",
           message:row.ItemName+'开始下载,请勿重复下载',
@@ -495,15 +495,25 @@ import 'streamsaver/examples/zip-stream'
           this.$message.warning('请至少选择一个文件/文件夹')
           return
         }
+        let emptyFolders=this.tableSelection.filter(it => it.Size==0)
         let downloadHint = this.$message({
           type:"info",
           message:this.$t('ReportManage.CloudPage.download_info_msg'),
           duration:0,
           iconClass:'el-icon-loading'
         })
+        setTimeout(()=>{
+          if(emptyFolders.length==0) return 
+          if(emptyFolders.length == this.tableSelection.length){
+            downloadHint.close()
+            this.$refs.tableRef.clearSelection()
+          }
+          this.$message.warning(`【${emptyFolders.map(it => it.ItemName).join('、')}】文件夹为空,暂不支持下载`)
+        },0)
         let downNumber = 0
-        let selectLength = this.tableSelection.length
+        let selectLength = this.tableSelection.length-emptyFolders.length
         this.tableSelection.map(item=>{
+          if(item.Size == 0) return 
           if(item.ItemType==1){
             // 下载压缩包
             cloudDiskInterface.getFilesByMenuId({MenuId:item.ItemId}).then(res=>{