瀏覽代碼

批量下载接口

duy 1 年之前
父節點
當前提交
c62d7d207e
共有 2 個文件被更改,包括 33 次插入9 次删除
  1. 17 8
      src/api/modules/using/query.js
  2. 16 1
      src/views/using/query.vue

+ 17 - 8
src/api/modules/using/query.js

@@ -1,4 +1,4 @@
-import {httpApi} from "../../request/httpApi";
+import { httpApi } from '../../request/httpApi'
 
 export default {
   //分页
@@ -8,7 +8,7 @@ async getarchiveQueryPage(form, msg = true) {
         method: 'get',
         params: form,
 
-    }, msg);
+    }, msg)
   },
   //获取目录树 /blade-manager/archiveTreeContract/getArchiveTreeByNodeType
   async getArchiveTreeByNodeType(form, msg = true) {
@@ -17,7 +17,7 @@ async getarchiveQueryPage(form, msg = true) {
         method: 'get',
         params: form,
 
-    }, msg);
+    }, msg)
   },
 //获取目录树子节点 GET/blade-manager/archiveTreeContract/getChildrenNodeByNodeId
   async getChildrenNodeByNodeId(form, msg = true) {
@@ -26,7 +26,7 @@ async getarchiveQueryPage(form, msg = true) {
         method: 'get',
         params: form,
 
-    }, msg);
+    }, msg)
   },
   //获取档案查询类别/blade-archive/archivesauto/getCarrierTypeByDict
   async getCarrierTypeByDict(form, msg = true) {
@@ -35,7 +35,7 @@ async getarchiveQueryPage(form, msg = true) {
         method: 'get',
         params: form,
 
-    }, msg);
+    }, msg)
   },
     //档案柜切换档案查看权限
     async getArchivesAuthByUser(form, msg = true) {
@@ -43,7 +43,7 @@ async getarchiveQueryPage(form, msg = true) {
             url: '/api/blade-archive/archivesauto/getArchivesAuthByUser',
             method: 'get',
             params: form,
-        }, msg);
+        }, msg)
     },
     //语音搜索接口
     async micSearchInfo(form, msg = true) {
@@ -51,7 +51,7 @@ async getarchiveQueryPage(form, msg = true) {
             url: '/api/blade-archive/archivesauto/search-info',
             method: 'post',
             data: form,
-        }, msg);
+        }, msg)
     },
     //查询案卷里的文件
     async getArchiveFileList(form, msg = true) {
@@ -59,6 +59,15 @@ async getarchiveQueryPage(form, msg = true) {
           url: '/api/blade-archive/archivesauto/getArchiveFileList',
           method: 'get',
           params: form,
-      }, msg);
+      }, msg)
+  },
+    //批量下载档案
+    async batchDownloadFileToZip(form, msg = true) {
+      return httpApi({
+          url: '/api/blade-archive/archivesauto/batchDownloadFileToZip',
+          method: 'get',
+          params: form,
+      }, msg)
   },
 }
+

+ 16 - 1
src/views/using/query.vue

@@ -120,7 +120,7 @@
                     <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" />
                 </div>
                 <div class="extra">
-                    <el-button v-if="tabKey === 'tab1'">
+                    <el-button v-if="tabKey === 'tab1'" :loading="batchLoading" :disabled="tableKeys.length === 0" @click="batchClick">
                         <HcIcon name="download" />
                         <span>下载</span>
                     </el-button>
@@ -1582,6 +1582,21 @@ const mediaMicChange = (data) => {
     })
     getTableData()
 }
+//批量下载档案
+const batchLoading = ref(false)
+const batchClick = async ()=>{
+    const ids = arrToId(tableKeys.value)
+    console.log(ids, 'ids')
+    batchLoading.value = true
+    const { error, code, data, msg } = await archiveQueryApi.batchDownloadFileToZip({
+        ids:ids,
+    })
+    batchLoading.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+    } 
+
+}
 </script>
 
 <style lang="scss">