Browse Source

一键下载完善

ljb 5 months ago
parent
commit
b0327c0824
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/App.vue

+ 5 - 1
src/App.vue

@@ -22,6 +22,7 @@
           <el-result v-if="showError" icon="error" title="文件下载失败">
           <el-result v-if="showError" icon="error" title="文件下载失败">
             <template slot="extra">
             <template slot="extra">
               <el-button type="primary" size="medium" @click="handleAgainDown">重新下载</el-button>
               <el-button type="primary" size="medium" @click="handleAgainDown">重新下载</el-button>
+              <el-button type="primary" size="medium" @click="handleClose">关闭窗口</el-button>
             </template>
             </template>
           </el-result>
           </el-result>
 
 
@@ -97,6 +98,7 @@ export default {
     handleAgainDown() {
     handleAgainDown() {
       const { type, yearAndMonth } = this.downloadTaskObj;
       const { type, yearAndMonth } = this.downloadTaskObj;
       this.showError = false;
       this.showError = false;
+      this.showDownLoading = true;
       this.checkTaskId(yearAndMonth, type);
       this.checkTaskId(yearAndMonth, type);
     },
     },
     handleClose() {
     handleClose() {
@@ -104,6 +106,7 @@ export default {
       this.showSucc = false;
       this.showSucc = false;
       this.showDownLoading = false;
       this.showDownLoading = false;
       this.isOpenDownPanel = false;
       this.isOpenDownPanel = false;
+      this.$store.commit("SET_TASK_OPEND_STATUS", false);
     },
     },
     /**
     /**
      * 检查下载任务进程
      * 检查下载任务进程
@@ -126,7 +129,8 @@ export default {
           if (status == 2) {
           if (status == 2) {
             this.showDownLoading = false;
             this.showDownLoading = false;
             this.downloadZip(yearAndMonth, taskId, fileType, fileSize);
             this.downloadZip(yearAndMonth, taskId, fileType, fileSize);
-          } else if (status == 3) {
+          } else if (status == 4) {
+            // 任务过期或者不存在
             removeStore({ name: this.taskStoreName });
             removeStore({ name: this.taskStoreName });
             this._checkTimeout = setTimeout(() => {
             this._checkTimeout = setTimeout(() => {
               this.checkTaskId(yearAndMonth, fileType);
               this.checkTaskId(yearAndMonth, fileType);