cxmo 1 年之前
父節點
當前提交
8d1db28f3b
共有 1 個文件被更改,包括 21 次插入2 次删除
  1. 21 2
      src/views/toolBox_manage/FederalReserveWatch.vue

+ 21 - 2
src/views/toolBox_manage/FederalReserveWatch.vue

@@ -49,11 +49,30 @@ export default {
                 if(res.Ret!==200) return
                 this.sheetDetailInfo = res.Data||{};
                 this.$nextTick(()=>{
-                    this.initSheet()
+                    this.sheetDetailInfo.MeetingInfoId&&this.initSheet()
                 })
             })
         },
-        downloadSheet(){},
+        downloadSheet(){
+            const {FileUrl} = this.sheetDetailInfo
+            if(!FileUrl){
+                this.$message.warning("暂无下载文件")
+                return 
+            }
+            const fileType = FileUrl.split('.')[1]
+            const x = new XMLHttpRequest()
+            x.open('GET', FileUrl, true)
+            x.responseType = 'blob'
+            x.onload = () => {
+                const url = window.URL.createObjectURL(x.response)
+                let a = document.createElement('a') 
+                a.href = url
+                a.download=`联储观察${this.selectDate}.${fileType}`
+                a.click();
+                window.URL.revokeObjectURL(url)
+            }
+            x.send()
+        },
         initSheet(){
             const baseOption = this.sheetDetailInfo.Content ? JSON.parse(this.sheetDetailInfo.Content) : {}
             //luckysheet配置,能隐藏的都隐藏了,并且禁止编辑