major-introduce-job.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div>
  3. <div v-if="prospects">
  4. <div v-if="prospects.jobDirection" class="desc-item">
  5. <p class="format-tit">就业方向</p>
  6. <div class="f-666 f14" v-html="prospects.jobDirection" />
  7. </div>
  8. <div v-if="reverseSalary.length" class="desc-item">
  9. <p class="format-tit">平均薪酬(毕业年限) <span
  10. class="f-333 f14 ml20"
  11. >{{
  12. `平均薪资:${reverseSalary.length ? reverseSalary[0].value || '-' : '-'}`
  13. }}</span>
  14. </p>
  15. <div class="f-666 f14">
  16. <el-row :gutter="10">
  17. <el-col :span="12">
  18. <mx-chart :options="chartSalary" height="240px" />
  19. </el-col>
  20. <el-col style="height: 100%" :span="12">
  21. <el-row :gutter="40" type="flex" style="flex-wrap: wrap">
  22. <el-col v-for="(item,index) in reverseSalary" :key="index" :span="12" class="f16">
  23. <el-row class="format-job-wrap">
  24. <el-col :span="3" class="f18 text-center f-666">{{ index + 1 }}</el-col>
  25. <el-col :span="15" class="f-333">{{ item.name }}</el-col>
  26. <el-col :span="6" class="f-666 text-right f14">{{ item.value || '-' }}</el-col>
  27. </el-row>
  28. </el-col>
  29. </el-row>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. </div>
  34. <el-row :gutter="10" type="flex">
  35. <el-col v-if="prospects.vocationalDistribution.length" :span="8">
  36. <div class="desc-item">
  37. <p class="format-tit">主要职业分布</p>
  38. <div class="f-666 f14">
  39. <mx-chart :options="occupation" height="200px" />
  40. <el-collapse accordion>
  41. <el-collapse-item v-for="desc in prospects.vocationalDistribution" :key="desc.name">
  42. <template slot="title">
  43. <div style="display: flex;justify-content: space-between;width: 100%;">
  44. <span class="f-active">{{ desc.name }}</span>
  45. <span class="f-red">{{ desc.value }}%</span>
  46. </div>
  47. </template>
  48. <div>{{ desc.expands }}</div>
  49. </el-collapse-item>
  50. </el-collapse>
  51. </div>
  52. </div>
  53. </el-col>
  54. <el-col v-if="prospects.industryDistribution.length" :span="8">
  55. <div class="desc-item">
  56. <p class="format-tit">主要行业分布</p>
  57. <div class="f-666 f14">
  58. <mx-chart :options="industry" height="200px" />
  59. <el-row>
  60. <el-col v-for="(item,index) in prospects.industryDistribution" :key="index" :span="24" class="f16">
  61. <el-row class="format-job-wrap">
  62. <el-col :span="3" class="f18 text-center f-666">{{ index + 1 }}</el-col>
  63. <el-col :title="item.name" :span="18" class="f-333 text-ellipsis">{{ item.name }}
  64. </el-col>
  65. <el-col :span="3" class="f-red text-right f14">{{ item.value }}%</el-col>
  66. </el-row>
  67. </el-col>
  68. </el-row>
  69. </div>
  70. </div>
  71. </el-col>
  72. <el-col v-if="prospects.jobRegionDistribution.length" :span="8">
  73. <div class="desc-item">
  74. <p class="format-tit">主要就业地区分布</p>
  75. <div class="f-666 f14">
  76. <mx-chart :options="jobAddress" height="200px" />
  77. <el-row>
  78. <el-col v-for="(item,index) in prospects.jobRegionDistribution" :key="index" :span="24" class="f16">
  79. <el-row class="format-job-wrap">
  80. <el-col :span="3" class="f18 text-center f-666">{{ index + 1 }}</el-col>
  81. <el-col :span="18" class="f-333 text-ellipsis">{{ item.name }}</el-col>
  82. <el-col :span="3" class="f-red text-right f14">{{ item.value }}%</el-col>
  83. </el-row>
  84. </el-col>
  85. </el-row>
  86. </div>
  87. </div>
  88. </el-col>
  89. </el-row>
  90. <el-row v-if="prospects.description.length" :gutter="10" class="f-12 f-666">
  91. <p><i class="el-icon mr5 f-16 el-icon-warning f-active" />数据说明</p>
  92. <p v-for="(desc,index) in prospects.description" :key="index">
  93. {{ index + 1 }}、 {{ desc }}
  94. </p>
  95. </el-row>
  96. </div>
  97. <div v-if="isEmpty">
  98. 暂无数据
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import config from '@/common/MxConfig'
  104. import MxChart from '@/components/MxChart/index'
  105. export default {
  106. name: 'MajorIntroduceJob',
  107. components: { MxChart },
  108. props: ['prospects'],
  109. computed: {
  110. isEmpty() {
  111. return !this.prospects.jobDirection &&
  112. !this.reverseSalary.length &&
  113. !this.prospects.description.length &&
  114. !this.prospects.vocationalDistribution.length &&
  115. !this.prospects.industryDistribution.length &&
  116. !this.prospects.jobRegionDistribution.length
  117. },
  118. // 平均薪资趋势
  119. reverseSalary() {
  120. if (!this.prospects['averageSalary']) return []
  121. const averageSalary = this.deepClone(this.prospects.averageSalary)
  122. return averageSalary.reverse().splice(0, 10)
  123. },
  124. // 主要职业分布
  125. occupation() {
  126. if (!this.prospects.vocationalDistribution) return null
  127. const pieData = this.prospects.vocationalDistribution
  128. const options = {
  129. toolbox: {
  130. show: true
  131. },
  132. series: [
  133. {
  134. type: 'pie',
  135. radius: [40, 60],
  136. label: {
  137. formatter: '{b}'
  138. },
  139. labelLine: {
  140. length2: 6,
  141. length: 5
  142. },
  143. data: pieData
  144. }
  145. ]
  146. }
  147. return options
  148. },
  149. // 主要行业分布
  150. industry() {
  151. if (!this.prospects.industryDistribution) return null
  152. const pieData = this.prospects.industryDistribution
  153. const options = {
  154. toolbox: {
  155. show: true
  156. },
  157. series: [
  158. {
  159. type: 'pie',
  160. radius: [40, 60],
  161. label: {
  162. formatter: '{b}'
  163. },
  164. labelLine: {
  165. length2: 6,
  166. length: 5
  167. },
  168. data: pieData
  169. }
  170. ]
  171. }
  172. return options
  173. },
  174. // 主要就业地区分布
  175. jobAddress() {
  176. if (!this.prospects.jobRegionDistribution) return
  177. const pieData = this.prospects.jobRegionDistribution
  178. const options = {
  179. toolbox: {
  180. show: true
  181. },
  182. series: [
  183. {
  184. type: 'pie',
  185. radius: [40, 60],
  186. label: {
  187. formatter: '{b}'
  188. },
  189. labelLine: {
  190. length2: 6,
  191. length: 5
  192. },
  193. data: pieData
  194. }
  195. ]
  196. }
  197. return options
  198. },
  199. chartSalary() {
  200. if (!this.prospects.averageSalary) return null
  201. const col = this.prospects.averageSalary.map(item => item.name + '年')
  202. const row = this.prospects.averageSalary.map(item => item.value)
  203. const options = {
  204. grid: {
  205. left: '2%',
  206. right: '2%',
  207. bottom: '3%',
  208. top: '14%',
  209. containLabel: true
  210. },
  211. tooltip: {
  212. trigger: 'axis'
  213. },
  214. xAxis: {
  215. data: col,
  216. axisLine: {
  217. lineStyle: {
  218. type: 'dashed'
  219. }
  220. },
  221. axisTick: {
  222. alignWithLabel: true
  223. }
  224. },
  225. yAxis: {
  226. type: 'value'
  227. },
  228. series: [
  229. {
  230. type: 'line',
  231. color: config.color.primary,
  232. stack: 'Total',
  233. label: {
  234. show: true,
  235. position: 'top'
  236. },
  237. smooth: false,
  238. data: row
  239. }
  240. ]
  241. }
  242. return options
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="scss">
  248. @import "./major-detail-style.scss";
  249. </style>