浏览代码

下载文件提示

Q-ABAB 2 年之前
父节点
当前提交
0897c0eac8
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 3 1
      src/components/tool/downloadFile.js
  2. 4 3
      src/views/activityManage/makerActvityDetails.vue

+ 3 - 1
src/components/tool/downloadFile.js

@@ -1,4 +1,5 @@
-export default function downloadFile(url,fileName){
+export default function downloadFile(url,fileName,changeState){
+    changeState(true);
     let _url = "";
     if (url.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1)_url = url.split("https://view.officeapps.live.com/op/view.aspx?src=")[1];
     else _url = url;
@@ -17,4 +18,5 @@ export default function downloadFile(url,fileName){
         document.body.removeChild(link);
     }
     x.send()
+    changeState(false);
 }

+ 4 - 3
src/views/activityManage/makerActvityDetails.vue

@@ -84,8 +84,8 @@
             <div class="tabTit">
                 <div><p>活动完结报告</p></div>
             </div>
-            <div style="width: 85%" v-loading="loading" element-loading-text="文件正在上传中">
-              <div style="display: flex;width: 100%;flex-direction: column;">
+            <div style="width: 85%" v-loading="downloadNow" element-loading-text="文件正在下载中">
+              <div style="display: flex;width: 100%;flex-direction: column;" >
                   <div class="download" v-for="item in tableData.reportFile">
                       <span>{{ item.fileName }}</span>
                       <div class="downloadBtn">
@@ -293,6 +293,7 @@ export default {
   },
   data() {
     return {
+      downloadNow:false,
       accept:"*",
       loading:false,
       DelFileDialog:false,
@@ -340,7 +341,7 @@ export default {
   },
   methods:{
     download(item){
-      downloadFile(item['url'],item['fileName'])
+      downloadFile(item['url'],item['fileName'],(_b)=>this.downloadNow = _b);
     },
     DelFileYes(){
       let newFile = this.tableData.reportFile.filter(item=>item.fid!=this.DelFileData.fid);