UniversityIcons.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="f14 f-666 text-center fx-row fx-bet-cen">
  3. <div v-for="(item, index) in iconList" :key="index" class="fx-1">
  4. <div v-if="item.tooltips">
  5. <img width="50px" :src="item.img" :alt="item.desc">
  6. <el-popover placement="bottom" trigger="hover">
  7. <div v-html="item.tooltips" />
  8. <p slot="reference" class="mt10">
  9. {{ item.value }}
  10. <i class="el-icon-question" />
  11. </p>
  12. </el-popover>
  13. </div>
  14. <div v-else>
  15. <img width="50px" :src="item.img" :alt="item.desc">
  16. <p class="mt10">{{ item.value }}</p>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'UniversityIcons',
  24. props: {
  25. baseInfo: {
  26. type: Object,
  27. default: () => ({})
  28. }
  29. },
  30. computed: {
  31. iconList() {
  32. const baseInfo = this.baseInfo || {}
  33. // fixed elements
  34. const results = [
  35. {
  36. value: baseInfo.natureTypeCN,
  37. desc: '办学类型',
  38. img: require('@/assets/images/career/xingzhi.png')
  39. },
  40. {
  41. value: `${baseInfo.location} ${baseInfo.cityName}`,
  42. desc: '所处地',
  43. img: require('@/assets/images/career/location.png')
  44. },
  45. {
  46. value: baseInfo.managerType,
  47. desc: '所属部门',
  48. img: require('@/assets/images/career/bumen.png')
  49. },
  50. {
  51. value: baseInfo.level,
  52. desc: '学历层次',
  53. img: require('@/assets/images/career/xueli.png')
  54. },
  55. {
  56. value: baseInfo.type,
  57. desc: '院校类型',
  58. img: require('@/assets/images/career/type.png')
  59. }
  60. ]
  61. //
  62. if (baseInfo.pointsOfShuo?.length) {
  63. results.push({
  64. value: baseInfo.pointsOfShuo.map(p => p.number).join(' / '),
  65. desc: 'shuoshi',
  66. img: require('@/assets/images/career/shuoshi.png'),
  67. tooltips: baseInfo.pointsOfShuo.map(p => `<p>${p.type} <span class="bold">${p.number}个</span></p>`).join('')
  68. })
  69. }
  70. if (baseInfo.pointsOfBo?.length) {
  71. results.push({
  72. value: baseInfo.pointsOfBo.map(p => p.number).join(' / '),
  73. desc: 'boshi',
  74. img: require('@/assets/images/career/boshi.png'),
  75. tooltips: baseInfo.pointsOfBo.map(p => `<p>${p.type} <span class="bold">${p.number}个</span></p>`).join('')
  76. })
  77. }
  78. if (baseInfo.rateOfBaoYanView && baseInfo.rateOfBaoYanView != '-') {
  79. results.push({
  80. value: '保研率:' + baseInfo.rateOfBaoYanView,
  81. desc: 'baoyanlv',
  82. img: require('@/assets/images/career/baoyanlv.png'),
  83. tooltips: `<div class="bold mb5">保研率说明</div>` + baseInfo.remarkOfBaoYan
  84. })
  85. }
  86. if (results.length < 8) {
  87. results.splice(0, 0, {
  88. value: `${baseInfo.createdYear}年`,
  89. desc: '创办时间',
  90. img: require('@/assets/images/career/year.png')
  91. })
  92. }
  93. return results.filter(r => r.value)
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped>
  99. </style>