Browse Source

批量下载按钮接口

duy 1 year ago
parent
commit
bff6ae7aff
1 changed files with 16 additions and 1 deletions
  1. 16 1
      src/views/using/query.vue

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

@@ -89,7 +89,7 @@
                 <hc-body padding="0px">
                     <hc-tab-card :tabs="tabData" :tab-key="tabKey" @change="tabChange">
                         <template #extra>
-                            <el-button v-if="tabKey === 'tab1'">下载</el-button>
+                            <el-button v-if="tabKey === 'tab1'" :loading="batchLoading" @click="batchClick">下载</el-button>
                             <HcNewSwitch v-if="tabKey === 'tab2'" size="default" :datas="tabGuiData" :keys="tabGuiKey" @change="tabGuiChange" />
                         </template>
                         <div v-if="tabKey === 'tab1'" class="hc-gather-card-table" :class="tableAllShow ? 'file-table' : ''">
@@ -1545,6 +1545,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">