|
@@ -1,47 +1,48 @@
|
|
|
<template>
|
|
|
- <!-- <v-container>
|
|
|
- <v-row>
|
|
|
- <v-col class="bgc" v-for="(val, i) in list" :key="i" :md="val.col">
|
|
|
- <Echarts :height="400" :option="val.option"></Echarts>
|
|
|
- </v-col>
|
|
|
- </v-row>
|
|
|
- </v-container> -->
|
|
|
<div class="chart-box">
|
|
|
<div class="chart-item" v-for="(val, i) in list" :key="i">
|
|
|
<Echarts :height="400" :option="val.option"></Echarts>
|
|
|
</div>
|
|
|
- <div class="fullChart">
|
|
|
+ <!-- <div class="fullChart">
|
|
|
<Echarts :height="400" :option="option"></Echarts>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'resume-analysis'})
|
|
|
-import { list } from './data.js'
|
|
|
+import { ref, onMounted, watch, nextTick } from 'vue'
|
|
|
+import cloneDeep from 'lodash/cloneDeep'
|
|
|
+import { getJobCvAgeCount, getJobCvEduCount, getJobCvSexCount, getJobCvExpCount } from '@/api/recruit/enterprise/statistics'
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ query: Object
|
|
|
+})
|
|
|
|
|
|
-const option = {
|
|
|
+// 柱状图公共option
|
|
|
+const barCommonOption = {
|
|
|
title: {
|
|
|
- text: '期望月薪'
|
|
|
+ text: ''
|
|
|
},
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
name: '范围',
|
|
|
- data: ['3-5k', '5-8k', '8-12k', '12-15k', '15-20k', '20-30k', '面议']
|
|
|
+ data: []
|
|
|
},
|
|
|
yAxis: {
|
|
|
- type: 'value'
|
|
|
+ type: 'value',
|
|
|
+ name: '数量(人)'
|
|
|
},
|
|
|
grid: {
|
|
|
- left: '0',
|
|
|
- top: '60',
|
|
|
+ left: '20',
|
|
|
+ top: '70',
|
|
|
right: '50',
|
|
|
bottom: '10',
|
|
|
containLabel: true
|
|
|
},
|
|
|
series: [
|
|
|
{
|
|
|
- data: [120, 200, 150, 80, 70, 110, 130],
|
|
|
+ data: [],
|
|
|
type: 'bar',
|
|
|
barWidth: 40,
|
|
|
label: {
|
|
@@ -51,6 +52,121 @@ const option = {
|
|
|
]
|
|
|
}
|
|
|
|
|
|
+// 期望月薪柱状图
|
|
|
+// const option = {
|
|
|
+// title: {
|
|
|
+// text: '期望月薪'
|
|
|
+// },
|
|
|
+// xAxis: {
|
|
|
+// type: 'category',
|
|
|
+// name: '范围',
|
|
|
+// data: ['3-5k', '5-8k', '8-12k', '12-15k', '15-20k', '20-30k', '面议']
|
|
|
+// },
|
|
|
+// yAxis: {
|
|
|
+// type: 'value'
|
|
|
+// },
|
|
|
+// grid: {
|
|
|
+// left: '0',
|
|
|
+// top: '60',
|
|
|
+// right: '50',
|
|
|
+// bottom: '10',
|
|
|
+// containLabel: true
|
|
|
+// },
|
|
|
+// series: [
|
|
|
+// {
|
|
|
+// data: [120, 200, 150, 80, 70, 110, 130],
|
|
|
+// type: 'bar',
|
|
|
+// barWidth: 40,
|
|
|
+// label: {
|
|
|
+// show: true
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ]
|
|
|
+// }
|
|
|
+
|
|
|
+const list = ref([
|
|
|
+ {
|
|
|
+ api: getJobCvSexCount,
|
|
|
+ isPie: true,
|
|
|
+ option: {
|
|
|
+ title: {
|
|
|
+ text: '性别分布'
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ top: '5%',
|
|
|
+ left: 'center'
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '性别分布',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['40%', '70%'],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ itemStyle: {
|
|
|
+ borderRadius: 10,
|
|
|
+ borderColor: '#fff',
|
|
|
+ borderWidth: 2
|
|
|
+ },
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ formatter: e => {
|
|
|
+ return e.data.key + ': ' + e.value + '人'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ show: true
|
|
|
+ },
|
|
|
+ data: []
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ api: getJobCvAgeCount,
|
|
|
+ title: '年龄分布',
|
|
|
+ option: cloneDeep(barCommonOption)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ api: getJobCvExpCount,
|
|
|
+ title: '工作年限分布',
|
|
|
+ option: cloneDeep(barCommonOption)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ api: getJobCvEduCount,
|
|
|
+ title: '学历分布',
|
|
|
+ option: cloneDeep(barCommonOption)
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
+const getStatistics = () => {
|
|
|
+ list.value.forEach(async (e) => {
|
|
|
+ const data = await e.api(props.query)
|
|
|
+ if (e.isPie) {
|
|
|
+ e.option.series[0].data = data
|
|
|
+ } else {
|
|
|
+ e.option.title.text = e.title
|
|
|
+ e.option.xAxis.data = data.x
|
|
|
+ e.option.series[0].data = data.y
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ getStatistics()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.query,
|
|
|
+ (val) => {
|
|
|
+ if (val) getStatistics()
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|