Pārlūkot izejas kodu

统计分析-招聘进展明细导出

Xiao_123 8 mēneši atpakaļ
vecāks
revīzija
7bec246406

+ 5 - 0
src/api/menduner/system/analysis/statisticAnalysis.ts

@@ -72,4 +72,9 @@ export const statisticAnalysisApi = {
   getAnalysisJobAdvertisedList: async (params: any) => {
     return await request.get({ url: `/menduner/system/job-advertised/list`, params })
   },
+
+  // 招聘进展明细导出
+  analysisExport: async (params) => {
+    return await request.download({ url: `/menduner/system/analysis/export`, params })
+  }
 }

+ 57 - 34
src/views/menduner/system/analysis/statisticAnalysis/index.vue

@@ -97,46 +97,50 @@
         <el-form-item>
           <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="success"
-            plain
-            @click="null"
-            :loading="false"
-          >
-            <Icon icon="ep:download" class="mr-5px" /> 导出
-          </el-button> -->
         </el-form-item>
       </el-form>
     </ContentWrap>
+
     <div class="flex flex-col">
       <!-- 统计 -->
-      <el-row :gutter="16" class="row">
-        <el-col v-for="item in statisticList" :key="item.name" :md="4" :sm="12" :xs="24" :loading="loading">
-          <ComparisonCard
-            :title="item.title"
-            :value="statistic[item.name]"
-            style="cursor: pointer;"
-            @click="openDialog(item)"
-          />
-        </el-col>
-      </el-row>
+      <div>
+        <CardTitle title="招聘进展"  style="margin-left: 5px;"/>
+        <div style="text-align: end;">
+          <el-button type="success" plain @click="handleExport" :loading="exportLoading">
+            <Icon icon="ep:download" class="mr-5px" /> 明细导出
+          </el-button>
+        </div>
+        <el-row :gutter="16" class="row" style="margin-top: 10px;">
+          <el-col v-for="item in statisticList" :key="item.name" :md="4" :sm="12" :xs="24" :loading="loading">
+            <ComparisonCard
+              :title="item.title"
+              :value="statistic[item.name]"
+              style="cursor: pointer;"
+              @click="openDialog(item)"
+            />
+          </el-col>
+        </el-row>
+      </div>
       <!-- 图表 -->
-      <el-row :gutter="16" class="row">
-        <el-col :md="12">
-          <SexDistribution :data="distribution.sexDistributionData" title="性别分布" />
-        </el-col>
-        <el-col :md="12">
-          <ageDistribution :data="distribution.ageDistributionData" title="年龄分布" />
-        </el-col>
-      </el-row>
-      <el-row :gutter="16" class="row">
-        <el-col :md="12">
-          <workExperience :data="distribution.workExperienceData" title="工作年限分布" />
-        </el-col>
-        <el-col :md="12">
-          <education :data="distribution.educationData" title="学历分布" />
-        </el-col>
-      </el-row>
+      <div>
+        <CardTitle title="应聘简历分析"  style="margin-left: 5px;"/>
+        <el-row :gutter="16" class="row" style="margin-top: 20px;">
+          <el-col :md="12">
+            <SexDistribution :data="distribution.sexDistributionData" title="性别分布" />
+          </el-col>
+          <el-col :md="12">
+            <ageDistribution :data="distribution.ageDistributionData" title="年龄分布" />
+          </el-col>
+        </el-row>
+        <el-row :gutter="16" class="row">
+          <el-col :md="12">
+            <workExperience :data="distribution.workExperienceData" title="工作年限分布" />
+          </el-col>
+          <el-col :md="12">
+            <education :data="distribution.educationData" title="学历分布" />
+          </el-col>
+        </el-row>
+      </div>
     </div>
     <!-- 弹窗 -->
     <Dialog :title="currentItem.title+'详情'" v-model="showDialog" width="1200" @close="closeDialog">
@@ -171,6 +175,7 @@ import education from './components/Education.vue'
 import { statisticAnalysisApi } from '@/api/menduner/system/analysis/statisticAnalysis'
 // import { dealDictArrayData, dealDictObjData } from '@/utils/position'
 defineOptions({name: 'StatisticAnalysis'})
+import download from '@/utils/download'
 
 const loading = ref(true) // 加载中
 const dialogLoading = ref(false)
@@ -180,6 +185,8 @@ onMounted(async () => {
   loading.value = true
 })
 
+const message = useMessage() // 消息弹窗
+const exportLoading = ref(false)
 const page = reactive({ pageNo: 1, pageSize: 10 })
 const queryParams = reactive({
   type: '0',
@@ -190,6 +197,21 @@ const queryParams = reactive({
   time: [],
 })
 
+// 招聘进展明细导出
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    const data = await statisticAnalysisApi.analysisExport(queryParams)
+    download.excel(data, '招聘进展明细')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
 const queryFormRef = ref() // 搜索的表单
 /** 重置按钮操作 */
 const resetQuery = () => {
@@ -514,6 +536,7 @@ const userIdSelectChange = (val) => {
 }
 
 </script>
+
 <style lang="scss" scoped>
 .row {
   .el-col {