zcy 3 anos atrás
pai
commit
261db87ee9
2 arquivos alterados com 21 adições e 6 exclusões
  1. 1 1
      src/utils/request.js
  2. 20 5
      src/views/security/stand/index.vue

+ 1 - 1
src/utils/request.js

@@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth'
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 60000 // request timeout
+  timeout: 600000 // request timeout
 })
 
 // request interceptor

+ 20 - 5
src/views/security/stand/index.vue

@@ -62,6 +62,10 @@
       <a-button ghost type="danger" @click="handleExportXls()">导出数据(含报废)</a-button>
 
       <a-dropdown type="danger">
+        <a-button style="margin-left: 8px">
+          批量导出二维码
+          <a-icon type="down" />
+        </a-button>
         <a-menu slot="overlay">
           <a-menu-item key="0" @click="handleExportCode()">
             导出选中
@@ -70,10 +74,6 @@
             导出全部
           </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px">
-          批量导出二维码
-          <a-icon type="down" />
-        </a-button>
       </a-dropdown>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -87,7 +87,7 @@
           <a-icon type="down" />
         </a-button>
       </a-dropdown>
-
+      <a-progress v-if="progressShow" style="width: 300px" :percent="jd" status="active" />
       <a-button style="float: right" type="link" @click="showBFList">报废安全工具</a-button>
     </div>
 
@@ -153,6 +153,8 @@ export default {
   mixins: [listMixin],
   data() {
     return {
+      progressShow: false,
+      jd: 0,
       // 查询条件
       previewVisible: false,
       previewImage: '',
@@ -213,11 +215,24 @@ export default {
     },
     handleExportCodeAll() {
       this.$message.warning('时间稍长,请耐心等待')
+      this.progressShow = true
+      var interval = setInterval(() => {
+        this.jd += 1
+        if (this.jd === 96) {
+          clearInterval(interval)
+        }
+      }, 300)
       downFile(this.url.qrcodeAll).then((data) => {
         if (data.code !== 200) {
           this.$message.warning('文件下载失败')
         } else {
+          clearInterval(interval)
           window.location.href = data.url
+          this.jd = 100
+          setTimeout(() => {
+            this.progressShow = false
+            this.jd = 0
+          }, 1000)
         }
       })
     }