rightRecommend.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <v-card class="position-box">
  3. <h4 class="h4 mb-3">{{ $t('position.recommend') }}</h4>
  4. <div v-if="items.length">
  5. <div v-for="(item, index) in items" :key="index" class="mb-2 cursor-pointer" @click="handlePosition(item)">
  6. <p class="recruit-name">{{ item.name }}</p>
  7. <span v-if="!item.payFrom && !item.payTo" class="recruit-salary">面议</span>
  8. <span v-else class="recruit-salary">{{ item.payFrom ? item.payFrom + '-' : '' }}{{ item.payTo }}{{ item.payName ? '/' + item.payName : '' }}</span>
  9. <div :class="['enterprise', {'border-bottom-dashed': index !== items.length - 1}]" @click="handleEnterprise(item)">
  10. <v-img class="float-left" :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" :width="30" :height="30"></v-img>
  11. <span class="float-left enterprise-name">{{ item.anotherName }}</span>
  12. <span class="float-right enterprise-address">{{ item.areaName }}</span>
  13. </div>
  14. </div>
  15. </div>
  16. <Empty v-else :elevation="false" message="暂无推荐职位"></Empty>
  17. </v-card>
  18. </template>
  19. <script setup>
  20. defineOptions({name: 'retrieval-components-recommendedPositions'})
  21. import { ref } from 'vue'
  22. import { getPromotedPosition } from '@/api/position'
  23. import { dealDictArrayData } from '@/utils/position'
  24. const items = ref([])
  25. const getList = async () => {
  26. const { list } = await getPromotedPosition({ pageSize: 10, pageNo: 1 })
  27. if (!list.length) return items.value = []
  28. items.value = dealDictArrayData([], list)
  29. }
  30. getList()
  31. const handlePosition = (item) => {
  32. if (!item.id) return
  33. window.open(`/recruit/personal/position/details/${item.id}`)
  34. }
  35. const handleEnterprise = (item) => {
  36. if (!item.enterpriseId) return
  37. window.open(`/recruit/personal/company/details/${item.enterpriseId}?key=briefIntroduction`)
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .position-box {
  42. position: relative;
  43. width: 320px;
  44. height: 100%;
  45. border-radius: 8px;
  46. padding: 20px 15px;
  47. }
  48. .recruit-name {
  49. width: 125px;
  50. font-weight: 500;
  51. display: inline-block;
  52. max-width: 125px;
  53. vertical-align: middle;
  54. white-space: nowrap;
  55. text-overflow: ellipsis;
  56. overflow: hidden;
  57. &:hover {
  58. color: var(--v-primary-base);
  59. }
  60. }
  61. .recruit-salary {
  62. float: right;
  63. color: var(--v-error-base);
  64. font-weight: 500;
  65. height: auto;
  66. vertical-align: sub;
  67. }
  68. .enterprise {
  69. height: 40px;
  70. line-height: 30px;
  71. margin-top: 8px;
  72. }
  73. .enterprise-name {
  74. width: 120px;
  75. display: inline-block;
  76. max-width: 120px;
  77. vertical-align: middle;
  78. white-space: nowrap;
  79. text-overflow: ellipsis;
  80. overflow: hidden;
  81. color: var(--color-666);
  82. font-size: 13px;
  83. margin-left: 5px;
  84. &:hover {
  85. color: var(--v-primary-base);
  86. }
  87. }
  88. .enterprise-address {
  89. color: #555;
  90. font-size: 13px;
  91. }
  92. </style>