Sfoglia il codice sorgente

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner-admin into dev

Xiao_123 8 mesi fa
parent
commit
e0764bd446

+ 5 - 0
src/api/menduner/system/jobFair/white/index.ts

@@ -15,5 +15,10 @@ export const JobFairWhiteApi = {
   // 移除企业白名单
   removeJobFairWhiteList: async (enterpriseName: string) => {
     return await request.put({ url: `/menduner/system/job-fair/remove-white-list2?enterpriseName=${enterpriseName}` })
+  },
+
+  // 导出参加双选会职位 Excel
+  exportJobFairWhiteList: async () => {
+    return await request.download({ url: `/menduner/system/job-fair/detail/export-excel` })
   }
 }

+ 19 - 0
src/views/menduner/system/jobFair/white/index.vue

@@ -22,6 +22,7 @@
         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
         <el-button type="primary" plain @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" /> 新增</el-button>
+        <el-button v-if="showExport" type="primary" plain @click="handleExport"><Icon icon="ep:download" class="mr-5px" /> 导出参加招聘会职位列表</el-button>
       </el-form-item>
     </el-form>
   </ContentWrap>
@@ -62,6 +63,7 @@
 <script setup lang="ts">
 import { JobFairWhiteApi } from '@/api/menduner/system/jobFair/white'
 import JobFairForm from './jobFairForm.vue'
+import download from '@/utils/download'
 
 /** 招聘会 列表 */
 defineOptions({ name: 'JobFair' })
@@ -116,6 +118,23 @@ const handleRemoveWhiteList = async (enterpriseName: string) => {
   } catch (err) {}
 }
 
+const showExport = ref(true) // 导出参加招聘会职位列表
+const exportLoading = ref(false) // 导出的加载中
+/** 导出按钮操作 */
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    const data = await JobFairWhiteApi.exportJobFairWhiteList()
+    download.excel(data, '招聘会职位列表.xls')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
 /** 初始化 **/
 onMounted(() => {
   getList()