Browse Source

统计分析:用户登录数、企业用户登录数

Xiao_123 5 tháng trước cách đây
mục cha
commit
50e4b70aa8

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

@@ -96,5 +96,15 @@ export const statisticAnalysisApi = {
   // 获取注册但未填写简历的用户
   getUserUnResumeCount: async (params: any) => {
     return await request.get({ url: `/menduner/system/analysis/get/user/un-resume`, params })
+  },
+
+  // 获取用户登录记录
+  getLoginUserCount: async (params: any) => {
+    return await request.get({ url: `/menduner/system/analysis/get/login-user/page`, params })
+  },
+
+  // 获取企业用户登录记录
+  getLoginEnterpriseUserCount: async (params: any) => {
+    return await request.get({ url: `/menduner/system/analysis/get/login-enterprise-user/page`, params })
   }
 }

+ 1 - 10
src/views/Home/Index.vue

@@ -41,18 +41,9 @@
   <!-- 统计 -->
   <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="3" :sm="12" :xs="24" :loading="loading">
-        <ComparisonCard
-          :title="item.title"
-          :value="statistic[item.name]"
-          style="cursor: pointer;"
-        />
+        <ComparisonCard :title="item.title" :value="statistic[item.name]" />
       </el-col>
     </el-row>
   </div>

+ 42 - 1
src/views/menduner/system/analysis/statisticAnalysis/index.vue

@@ -117,7 +117,7 @@
           </el-button>
         </div>
         <el-row :gutter="16" class="row m-t-10px">
-          <el-col v-for="item in statisticList" :key="item.name" :md="3" :sm="12" :xs="24" :loading="loading">
+          <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]"
@@ -250,6 +250,9 @@ const apiArr = reactive({
   resumeViewed: statisticAnalysisApi.getAnalysisJobCvLookPage, // 钻取
   invitedInterviews: statisticAnalysisApi.getAnalysisInterviewWaitPage, // 钻取
   invitedCompleted: statisticAnalysisApi.getAnalysisInterviewCompletePage, // 钻取
+  userLoginNum: statisticAnalysisApi.getLoginUserCount, // 钻取
+  enterpriseUserLoginNum: statisticAnalysisApi.getLoginEnterpriseUserCount, // 钻取
+
   // 分布
   sexDistributionData: statisticAnalysisApi.getAnalysisJobCvSexCount,
   ageDistributionData: statisticAnalysisApi.getAnalysisJobCvAgeCount,
@@ -259,6 +262,8 @@ const apiArr = reactive({
 
 // 统计
 const statisticList = [
+  { title: '用户登录数', name: 'userLoginNum' },
+  { title: '企业用户登录数', name: 'enterpriseUserLoginNum' },
   { title: '所有职位数量', name: 'pushTotalNum' },
   { title: '发布中职位数量', name: 'pushNum' },
   { title: '职位浏览量', name: 'pageViews' },
@@ -276,6 +281,8 @@ const statistic = reactive({
   resumeViewed: 0,
   invitedInterviews: 0,
   invitedCompleted: 0,
+  userLoginNum: 0,
+  enterpriseUserLoginNum: 0
 })
 
 // 分布
@@ -442,6 +449,22 @@ const tableHeaders = {
     { name: '面试地点', prop: 'addressName' },
     { name: '反馈评价', prop: 'evaluate' },
   ],
+  // 用户登录数
+  userLoginNum: [
+    { name: '用户名', prop: 'username' },
+    { name: '联系电话', prop: 'phone' },
+    { name: '联系邮箱', prop: 'person.email' },
+    { name: '登录IP', prop: 'user.loginIp' },
+    { name: '登录时间', prop: 'loginTime' }
+  ],
+  // 企业用户登录数
+  enterpriseUserLoginNum: [
+    { name: '企业名称', prop: 'enterpriseName' },
+    { name: '企业用户', prop: 'username' },
+    { name: '企业用户联系电话', prop: 'userBind.phone' },
+    { name: '登录IP', prop: 'loginLog.userIp' },
+    { name: '登录时间', prop: 'loginTime' }
+  ]
 }
 
 const dealTableData = async () => {
@@ -531,6 +554,24 @@ const dealTableData = async () => {
       return item
     })
   }
+  // 用户登录数
+  if (currentItem.value.name === 'userLoginNum') {
+    tableData.value = tableData.value.map(item => {
+      item.username = item.person.name || item.user.phone
+      item.phone = item.person.phone || item.user.phone
+      item.loginTime = timesTampChange(item.user.loginDate)
+      return item
+    })
+  }
+  // 企业用户登录数
+  if (currentItem.value.name === 'enterpriseUserLoginNum') {
+    tableData.value = tableData.value.map(item => {
+      item.enterpriseName = item.enterprise.name || item.enterprise.anotherName
+      item.username = item.userBind.name || item.userBind.phone
+      item.loginTime = timesTampChange(item.loginLog.createTime)
+      return item
+    })
+  }
 }