new-profess-detail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div id="professDetail" style="padding:24px 12%">
  3. <el-card style="color: #5E5E5E;" ref="navBar">
  4. <el-breadcrumb separator-class="el-icon-arrow-right">
  5. <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
  6. <el-breadcrumb-item :to="{ path: '/career/plan/ProfessLib'}">专业库</el-breadcrumb-item>
  7. <el-breadcrumb-item>专业详情</el-breadcrumb-item>
  8. </el-breadcrumb>
  9. </el-card>
  10. <div class="mt20 header-content pd20">
  11. <p class="f28 f-333 mb20">{{ majorDetail.name || '' }}</p>
  12. <p class="f14 f-666">{{ `国标代码${majorDetail.code}(不可用于填报)` }}</p>
  13. </div>
  14. <div class="tabs-wrap">
  15. <span class="tabs-item" @click="tabActive = 0" :class="{'bg-primary':tabActive == 0}">专业概况</span>
  16. <span class="tabs-item" @click="tabActive = 1" :class="{'bg-primary':tabActive == 1}">就业前景</span>
  17. <span class="tabs-item" @click="tabActive = 2" :class="{'bg-primary':tabActive == 2}">开设院校</span>
  18. </div>
  19. <p class="line"></p>
  20. <div
  21. v-show="loading"
  22. class="loading-div"
  23. v-loading="loading"
  24. :style="{height:windowHeight + 'px'}"
  25. >
  26. </div>
  27. <div class="content-wrap mt20">
  28. <!-- 专业概况 -->
  29. <div v-if="tabActive == 0">
  30. <div class="info-wrap">
  31. <div class="info-item"></div>
  32. </div>
  33. <div class="desc-item" v-for="(item,index) in contentProps">
  34. <p class="format-tit">{{getDetailContent(index,'title')}}</p>
  35. <div class="f-666 f14" v-html="getDetailContent(index,item)"></div>
  36. </div>
  37. </div>
  38. <!-- 就业岗位-->
  39. <div v-if="tabActive == 1">
  40. <div class="desc-item" >
  41. <p class="format-tit">就业方向</p>
  42. <div class="f-666 f14" v-html="prospects.jobDirection"></div>
  43. </div>
  44. <div class="desc-item" >
  45. <p class="format-tit">平均薪酬(毕业年限) <span class="f-333 f14 ml20">{{`平均薪资:${reverseSalary[0].value}`}}</span></p>
  46. <div class="f-666 f14" >
  47. <el-row :gutter="10">
  48. <el-col :span="12">
  49. <mx-chart :options="chartSalary" height="240px"></mx-chart>
  50. </el-col>
  51. <el-col style="height: 100%" :span="12">
  52. <el-row :gutter="40" type="flex" style="flex-wrap: wrap">
  53. <el-col :span="12" class="f16" v-for="(item,index) in reverseSalary">
  54. <el-row class="format-job-wrap">
  55. <el-col :span="3" class="f18 text-center f-666">{{index + 1}}</el-col>
  56. <el-col :span="15" class="f-333">{{item.name}}</el-col>
  57. <el-col :span="6" class="f-666 text-right f14">{{item.value}}</el-col>
  58. </el-row>
  59. </el-col>
  60. </el-row>
  61. </el-col>
  62. </el-row>
  63. </div>
  64. </div>
  65. <el-row :gutter="10" type="flex">
  66. <el-col :span="8">
  67. <div class="desc-item" >
  68. <p class="format-tit">主要职业分布</p>
  69. <div class="f-666 f14" ></div>
  70. </div>
  71. </el-col>
  72. <el-col :span="8">
  73. <div class="desc-item" >
  74. <p class="format-tit">主要行业分布</p>
  75. <div class="f-666 f14"></div>
  76. </div>
  77. </el-col>
  78. <el-col :span="8">
  79. <div class="desc-item" >
  80. <p class="format-tit">主要就业地区分布</p>
  81. <div class="f-666 f14"></div>
  82. </div>
  83. </el-col>
  84. </el-row>
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import MxChart from '@/components/MxChart/index'
  91. import { careerProspects, majorOverview } from '@/api/webApi/professlib'
  92. export default {
  93. name: 'ProfessLibDetails',
  94. components: {
  95. MxChart
  96. },
  97. data() {
  98. return {
  99. loading: false,
  100. code: '',
  101. tabActive: 0,
  102. majorDetail: {}, // 概况
  103. prospects: {}, // 前景
  104. contentPropsByBen: ['introduction', 'eduObjective', 'eduRequirement', 'subjectRequirement', 'loreAndAbility', 'studyDirection', 'mainCourse', 'famousScholar'], // 本科概况列
  105. contentTotalByBen: ['专业介绍', '培养目标', '培养要求', '学科要求', '知识能力', '考研方向', '主要课程', '社会名人'], // 本
  106. contentPropsByZhuan: ['eduObjective', 'internshipDesc', 'jobDirection', 'loreAndAbility', 'zhuanToBenOrient', 'mainCourse'], // 本科概况列
  107. contentTotalByZhuan: ['培养目标', '实习实训', '职业资格证书举例', '知识能力', '专升本方向', '主要课程'], // 专
  108. windowHeight: document.documentElement.clientHeight
  109. }
  110. },
  111. computed: {
  112. // 平均薪资趋势
  113. reverseSalary() {
  114. if (!this.prospects.averageSalary) return null
  115. const averageSalary = this.deepClone(this.prospects.averageSalary)
  116. return averageSalary.reverse()
  117. },
  118. chartSalary() {
  119. if (!this.prospects.averageSalary) return null
  120. const col = this.prospects.averageSalary.map(item => item.name + '年')
  121. const row = this.prospects.averageSalary.map(item => item.value)
  122. const options = {
  123. grid:{
  124. left: '2%',
  125. right: '2%',
  126. bottom: '3%',
  127. top: '14%',
  128. containLabel: true
  129. },
  130. tooltip: {
  131. trigger: 'axis'
  132. },
  133. xAxis: {
  134. data: col,
  135. axisLine: {
  136. lineStyle: {
  137. type: 'dashed'
  138. }
  139. },
  140. axisTick: {
  141. alignWithLabel: true
  142. },
  143. },
  144. yAxis: {
  145. type: 'value',
  146. },
  147. series: [
  148. {
  149. type: 'line',
  150. color: '#47C6A2',
  151. stack: 'Total',
  152. label: {
  153. show: true,
  154. position: 'top',
  155. },
  156. smooth: false,
  157. data: row
  158. },
  159. ]
  160. }
  161. return options
  162. },
  163. contentProps() {
  164. if(this.majorDetail.eduLevel == 'ben') return this.contentPropsByBen
  165. if(this.majorDetail.eduLevel == 'zhuan') return this.contentPropsByZhuan
  166. },
  167. contentTotal() {
  168. if(this.majorDetail.eduLevel == 'ben') return this.contentTotalByBen
  169. if(this.majorDetail.eduLevel == 'zhuan') return this.contentTotalByZhuan
  170. },
  171. getDetailContent() {
  172. return function(id, type) {
  173. if(type==='title'){
  174. return this.contentTotal[id]
  175. }
  176. const flag = this.contentProps.some(item=>{
  177. return item===type
  178. })
  179. if(flag){
  180. return this.majorDetail[type]
  181. }
  182. }
  183. }
  184. },
  185. watch: {
  186. tabActive: {
  187. handler(newVal) {
  188. // 2 院校 1 前景 0 概览
  189. if (newVal == 0) this.getOverView()
  190. if (newVal == 1) this.getCareerProspects()
  191. }
  192. },
  193. '$route': {
  194. immediate: true,
  195. handler(val) {
  196. this.code = val.query.code
  197. if (val.query.code) {
  198. this.getOverView()
  199. }
  200. }
  201. }
  202. },
  203. methods: {
  204. getCareerProspects() {
  205. this.loading = true
  206. careerProspects({
  207. code: this.code
  208. }).then(res => {
  209. this.prospects = res.data
  210. console.log(res)
  211. }).finally(_ => {
  212. this.loading = false
  213. })
  214. },
  215. getOverView() {
  216. this.loading = true
  217. majorOverview({
  218. code: this.code
  219. }).then(res => {
  220. console.log(res)
  221. this.majorDetail = res.data
  222. }).finally(_ => {
  223. this.loading = false
  224. })
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. #professDetail {
  231. .header-content {
  232. top: 0;
  233. left: 0;
  234. width: 100%;
  235. height: 100%;
  236. background: rgba(66, 185, 131, 0.1);
  237. }
  238. .tabs-wrap {
  239. margin-top: 20px;
  240. height: 40px;
  241. .tabs-item {
  242. cursor: pointer;
  243. padding: 0 33px;
  244. border-radius: 4px 4px 0 0;
  245. display: inline-block;
  246. line-height: 40px;
  247. &:hover {
  248. color: #47C6A2;
  249. }
  250. &.bg-primary {
  251. background: #47C6A2;
  252. color: white;
  253. }
  254. }
  255. }
  256. .bg-primary {
  257. background: #47C6A2 !important;
  258. color: white;
  259. }
  260. .format-tit{
  261. border-left: 4px solid #47C6A2;
  262. padding-left: 10px;
  263. margin-bottom: 20px;
  264. font-size: 20px;
  265. }
  266. .desc-item{
  267. margin-bottom: 40px;
  268. }
  269. .format-job-wrap {
  270. display: flex;
  271. height: 44px;
  272. line-height: 44px;
  273. border-bottom: 1px solid #f2f2f2;
  274. }
  275. .line {
  276. background: #47C6A2;
  277. height: 1px;
  278. }
  279. }
  280. </style>