Przeglądaj źródła

fix: 待条件下载

Eureka 9 miesięcy temu
rodzic
commit
8dce104ad2
2 zmienionych plików z 4 dodań i 3 usunięć
  1. 1 1
      src/hooks/useDownload.ts
  2. 3 2
      src/views/demo/data/index.vue

+ 1 - 1
src/hooks/useDownload.ts

@@ -19,7 +19,7 @@ export const useDownload = async (
   tempName: string,
   params: any = {},
   isNotify: boolean = true,
-  fileType: string = '.xlsx',
+  fileType: string = '.zip',
   fileName?: string
 ) => {
   if (isNotify) {

+ 3 - 2
src/views/demo/data/index.vue

@@ -9,7 +9,7 @@
       <template #tableHeader="scope">
         <el-button type="primary" v-auth="['demo:data:add']" :icon="CirclePlus" @click="openDialog(1, '数据新增')"> 新增 </el-button>
         <el-button type="primary" v-auth="['demo:data:import']" :icon="Upload" plain @click="batchAdd"> 导入数据集 </el-button>
-        <el-button type="primary" v-auth="['demo:data:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button type="primary" v-auth="['demo:data:export']" :icon="Download" plain @click="downloadFile(scope.selectedListIds)"> 导出 </el-button>
         <el-button
           type="danger"
           v-auth="['demo:data:remove']"
@@ -330,7 +330,8 @@ const batchDelete = async (ids: string[]) => {
 }
 
 // 导出数据管理列表
-const downloadFile = async () => {
+const downloadFile = async (ids: string[]) => {
+  proTable.value.searchParam['selectedIds'] = ids
   ElMessageBox.confirm('确认导出数据管理数据?', '温馨提示', { type: 'warning' }).then(() =>
     useDownload(exportDataApi, '数据管理列表', proTable.value?.searchParam)
   )