old-detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div id="jobDetail" ref="jobDetail" style="padding:24px 8%;background-color:#f7f7f7;" v-loading="loading">
  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/vocation/index'}">职业库</el-breadcrumb-item>
  7. <el-breadcrumb-item>职业详情</el-breadcrumb-item>
  8. </el-breadcrumb>
  9. </el-card>
  10. <div style="background-color: #F0F3FC;margin-top:10px;" class="header">
  11. <div class="left" :style="{'backgroundColor':theme,'text-align':'center'}">
  12. <div>
  13. <h1 style="margin: 0;font-size: 40px;color:#525252;">{{jobDetails.name}}</h1>
  14. </div>
  15. </div>
  16. <div class="right" style="padding:30px;">
  17. <div v-html="jobDetails.zysm" class="headerText"></div>
  18. </div>
  19. </div>
  20. <div style="margin-top: 20px;background-color: #ffffff" v-for="(item,index) in contentArr">
  21. <div style="display: flex;justify-content: space-between;padding:30px 10px 0 10px;">
  22. <span :style="{'color':theme}" style="background-color:#F0F3FC;font-size:16px;font-weight:bold;padding:12px 100px 10px 50px;display:inline-block;clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);">{{getDeatailCon(index,'title')}}</span>
  23. <span :style="{'color':theme}" style="font-size:36px;color:#FCE1B0;">{{getDeatailCon(index,'title02')}}</span>
  24. </div>
  25. <div style="padding:30px" v-html="getDeatailCon(index,item)"></div>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import {mapState} from 'vuex';
  31. import {getJobDetail} from '@/api/webApi/vocation'
  32. export default {
  33. name: "Detail",
  34. data(){
  35. return {
  36. loading:false,
  37. jobId:'',
  38. jobDetails:{},
  39. contentArr:['zydy','rwzz','zsbj','zyjn','cyzg','cygj','fzqj'],
  40. title1:['职业定义','任务职责','知识背景','职业技能','从业资格','常用工具','发展前景'],
  41. title2:['PROFESSIONAL DETAILS','COLLEGES AND UNIVERSITIES','CHARACTERISTICS','CHARACTERISTICS','CHARACTERISTICS','CHARACTERISTICS']
  42. }
  43. },
  44. computed:{
  45. ...mapState({theme: state => state.settings.theme}),
  46. getDeatailCon(){
  47. return function (id,type){
  48. if(type==='title'){
  49. return this.title1[id]
  50. }
  51. if(type==='title02'){
  52. return this.title2[id]
  53. }
  54. const flag=this.contentArr.some(item=>{
  55. return item===type
  56. })
  57. if(flag){
  58. return this.jobDetails[type]
  59. }
  60. }
  61. }
  62. },
  63. watch:{
  64. theme:{
  65. immediate:true,
  66. handler(val){
  67. this.$nextTick(()=>{
  68. this.$refs.jobDetail.style.setProperty('--themeColor', val)
  69. })
  70. }
  71. },
  72. '$route':{
  73. immediate:true,
  74. handler(val){
  75. this.jobId=val.query.id;
  76. if(val.query.id){
  77. this.getJobDetail();
  78. }
  79. }
  80. }
  81. },
  82. methods:{
  83. getJobDetail(){
  84. this.loading=true
  85. const params={
  86. jobId:this.jobId
  87. };
  88. getJobDetail(params).then(res=>{
  89. this.jobDetails=res.data
  90. this.loading=false;
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. #jobDetail{
  98. font-family: PingFangSC-Semibold, PingFang SC;
  99. .header{
  100. .headerText{
  101. p{
  102. background-color: #1ab394 !important;
  103. }
  104. }
  105. }
  106. }
  107. </style>
  108. <style lang="scss">
  109. #jobDetail {
  110. .header {
  111. .left{
  112. display: table-cell;
  113. width:25%;
  114. vertical-align: middle;
  115. }
  116. .right{
  117. display: table-cell;
  118. }
  119. .headerText {
  120. p {
  121. span{
  122. background-color: transparent !important;
  123. }
  124. background-color: transparent !important;
  125. }
  126. }
  127. }
  128. }
  129. </style>