overview.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="overview my-5">
  3. <div class="overview-item pa-5 color-666" v-for="(val, i) in overview" :key="i">
  4. <div class="d-flex">
  5. <div>{{ val.title }}</div>
  6. <v-tooltip :text="val.desc" location="top">
  7. <template v-slot:activator="{ props }">
  8. <span v-bind="props" class="mdi mdi-information-outline ml-1"></span>
  9. </template>
  10. </v-tooltip>
  11. </div>
  12. <div class="overview-item-value my-3">{{ val.value }}</div>
  13. <div class="font-size-14">
  14. 环比
  15. <span class="color-error">0% ↑</span>
  16. </div>
  17. </div>
  18. </div>
  19. <div id="myChart" style="width: 100%; height: 500px;background-color: #f7f8fa;border-radius: 8px;" class="pa-3"></div>
  20. </template>
  21. <script setup>
  22. defineOptions({ name: 'overview-page'})
  23. import { ref, onMounted } from 'vue'
  24. import * as echarts from 'echarts'
  25. // 数据概况
  26. const overview = ref([
  27. { title: '职位浏览量', value: 86, desc: '指全部职位被候选人查看的人数总和' },
  28. { title: '收到简历量', value: 12, desc: '指全部职位收到简历的总数' },
  29. { title: '查看收到简历', value: 0, desc: '指查看候选人主动发送的简历数量' },
  30. { title: '已处理简历', value: 4, desc: '指招聘方标记"通过筛选"与"不合适"的简历数' },
  31. { title: '主动联系我的人', value: 0, desc: '指候选人主动发起沟通的人数' },
  32. { title: '我主动联系的人', value: 5, desc: '指候选人主动发起沟通的人数' },
  33. { title: '面试数量', value: 0, desc: '面试人数的总数' }
  34. ])
  35. onMounted(() => {
  36. var chartDom = document.getElementById('myChart')
  37. var myChart = echarts.init(chartDom)
  38. var option
  39. option = {
  40. title: {
  41. text: '历史数据走势图'
  42. },
  43. tooltip: {
  44. trigger: 'axis',
  45. axisPointer: {
  46. type: 'cross',
  47. label: {
  48. backgroundColor: '#6a7985'
  49. }
  50. }
  51. },
  52. legend: {
  53. data: ['职位数', '刷新次数', '职位浏览', '简历投递数', '简历处理']
  54. },
  55. toolbox: {
  56. feature: {
  57. saveAsImage: {}
  58. }
  59. },
  60. grid: {
  61. left: '3%',
  62. right: '4%',
  63. bottom: '3%',
  64. containLabel: true
  65. },
  66. xAxis: [
  67. {
  68. type: 'category',
  69. boundaryGap: false,
  70. data: ['2024-07-10', '2024-07-11', '2024-07-12']
  71. }
  72. ],
  73. yAxis: [
  74. {
  75. type: 'value'
  76. }
  77. ],
  78. series: [
  79. {
  80. name: '职位数',
  81. type: 'line',
  82. emphasis: {
  83. focus: 'series'
  84. },
  85. data: [120, 132, 101, 134, 90, 230, 210]
  86. },
  87. {
  88. name: '刷新次数',
  89. type: 'line',
  90. emphasis: {
  91. focus: 'series'
  92. },
  93. data: [220, 182, 191, 234, 290, 330, 310]
  94. },
  95. {
  96. name: '职位浏览',
  97. type: 'line',
  98. emphasis: {
  99. focus: 'series'
  100. },
  101. data: [150, 232, 201, 154, 190, 330, 410]
  102. },
  103. {
  104. name: '简历投递数',
  105. type: 'line',
  106. emphasis: {
  107. focus: 'series'
  108. },
  109. data: [320, 332, 301, 334, 390, 330, 320]
  110. },
  111. {
  112. name: '简历处理',
  113. type: 'line',
  114. label: {
  115. show: true,
  116. position: 'top'
  117. },
  118. emphasis: {
  119. focus: 'series'
  120. },
  121. data: [820, 932, 901, 934, 1290, 1330, 1320]
  122. }
  123. ]
  124. }
  125. option && myChart.setOption(option)
  126. })
  127. </script>
  128. <style scoped lang="scss">
  129. .overview {
  130. display: flex;
  131. width: 100%;
  132. flex-wrap: wrap; // 换行
  133. }
  134. .overview-item {
  135. // width: calc((100% - 84px) / 8);
  136. // min-width: calc((100% - 84px) / 8);
  137. // max-width: calc((100% - 84px) / 8);
  138. min-width: 200px;
  139. margin: 0 12px 12px 0;
  140. height: 175px;
  141. border-radius: 12px;
  142. overflow: hidden;
  143. transition: all .2s linear;
  144. background-color: #f7f8fa;
  145. div {
  146. white-space: nowrap; /* 防止子级文本换行 */
  147. flex-grow: 1; /* 允许子级根据内容撑开,但保持最小宽度限制 */
  148. }
  149. &:last-child {
  150. margin-right: 0;
  151. }
  152. }
  153. .overview-item-value {
  154. color: var(--v-primary-base);
  155. font-weight: 700;
  156. font-size: 44px;
  157. }
  158. </style>