hotPromoted.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="hot-box">
  3. <div class="sub-li" v-for="(item, index) in list" :key="index">
  4. <div v-if="item">
  5. <!-- 公司信息 -->
  6. <div class="company-info-top align-center" :class="{'elevation-5': item.active}" @click.stop="jumpToEnterpriseDetail(item.enterprise.id, false)" @mouseenter="item.active = true" @mouseleave="item.active = false">
  7. <div class="float-left">
  8. <v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" alt="" width="77" height="77" style="border-radius: 4px;"/>
  9. </div>
  10. <div class="company-info cursor-pointer">
  11. <h3 v-ellipse-tooltip>{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
  12. <p>
  13. {{ item?.enterprise.scaleName }}
  14. <span class="septal-line" v-if="item.enterprise.industryName"></span>
  15. {{ item?.enterprise.industryName }}
  16. </p>
  17. </div>
  18. </div>
  19. <div class="mx-4 py-2" style="height: 35px;" :style="{'border-bottom': item?.enterprise?.welfareTagStr ? '1px solid #EBEBEB' : 'none'}">
  20. <div v-ellipse-tooltip class="welfareTag ellipsis-tag">{{ item.enterprise.welfareTagStr }}</div>
  21. </div>
  22. <!-- 职位列表 -->
  23. <ul class="company-job-list pt-3">
  24. <li v-for="(k, i) in item.jobList" :key="i" @mouseenter="k.active = true" @mouseleave="k.active = false" @click="handleClickPosition(k)">
  25. <v-card :elevation="k.active ? 5 : 0" class="company-job-item cursor-pointer mb-3">
  26. <div class="mb-2 d-flex">
  27. <span v-ellipse-tooltip :class="['name', 'cursor-pointer', {'default-active': k.active }]" :style="{'max-width': !k.payFrom && !k.payTo ? '290px' : '200px'}">{{ formatName(k.name) }}</span>
  28. <span v-if="!k.payFrom && !k.payTo" class="salary">面议</span>
  29. <span v-else class="salary">{{ k.payFrom ? k.payFrom + '-' : '' }}{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
  30. </div>
  31. <div class="d-flex font-size-13" style="height: 24px; overflow: hidden; color: #808080; line-height: 24px;">
  32. <div class="text-truncate mr-3" style="flex: 1">
  33. <span v-for="(j, index) in desc" :key="index">
  34. <span v-if="k[j] || j === 'areaName'" class="mr-1">
  35. {{ j === 'areaName' ? !k.areaId ? '全国' : k.area?.str : k[j] }}
  36. </span>
  37. <span v-if="index !== desc.length - 1 && (k[j] || j === 'areaName') && k[desc[index + 1]]" class="septal-line ml-1"></span>
  38. </span>
  39. </div>
  40. <div style="width: 73px;">{{ timesTampChange(k.updateTime, 'Y-M-D') }}</div>
  41. </div>
  42. </v-card>
  43. </li>
  44. </ul>
  45. <div class="moreBtn d-flex align-center justify-center" @click.stop="handleMoreEnterprise(item)">
  46. <span>{{ $t('position.moreBtn') }}</span>
  47. <v-icon>mdi-menu-right</v-icon>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup name="hotPromoted">
  54. import { ref, watch } from 'vue'
  55. import { timesTampChange } from '@/utils/date'
  56. import { formatName } from '@/utils/getText'
  57. import { jumpToEnterpriseDetail } from '@/utils/position'
  58. import { useRouter } from 'vue-router'
  59. const props = defineProps({
  60. items: {
  61. type: Array,
  62. default: () => []
  63. }
  64. })
  65. const router = useRouter()
  66. const list = ref([])
  67. watch(
  68. () => props.items,
  69. (newVal) => {
  70. list.value = newVal
  71. },
  72. { immediate: true },
  73. { deep: true }
  74. )
  75. const desc = ['areaName', 'eduName', 'expName']
  76. // 职位详情
  77. const handleClickPosition = (k) => {
  78. router.push(`/recruit/personal/position/details/${k.id}`)
  79. }
  80. // 查看更多职位
  81. const handleMoreEnterprise = (item) => {
  82. if (!item.enterprise.id) return
  83. const name = formatName(item.enterprise.anotherName || item.enterprise.name)
  84. window.open(`/recruit/personal/position?content=${name.includes('&') ? encodeURIComponent(name) : name}`)
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .hot-box {
  89. display: flex;
  90. flex-wrap: wrap;
  91. }
  92. .sub-li {
  93. position: relative;
  94. width: calc((100% - 24px) / 3);
  95. min-width: calc((100% - 24px) / 3);
  96. max-width: calc((100% - 24px) / 3);
  97. margin: 0 12px 12px 0;
  98. height: 373px;
  99. border-radius: 12px;
  100. padding: 0;
  101. overflow: hidden;
  102. transition: all .2s linear;
  103. background-color: #fff;
  104. box-shadow: 0 2px 20px 0 rgba(37, 39, 48, .2);
  105. &:nth-child(3n) {
  106. margin-right: 0;
  107. }
  108. }
  109. .ellipsis-tag {
  110. white-space: nowrap;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. color: #cec149 !important;
  114. }
  115. .company-info {
  116. float: left;
  117. margin-left: 16px;
  118. width: 262px;
  119. }
  120. .company-info-top {
  121. display: flex;
  122. height: 90px;
  123. margin: 12px 12px 0 12px;
  124. padding: 0 12px;
  125. overflow: hidden;
  126. border-bottom: 1px solid #EBEBEB;
  127. border-radius: 8px;
  128. }
  129. .welfareTag {
  130. color: #CEC149;
  131. font-size: 13px;
  132. }
  133. .company-info h3 {
  134. height: 22px;
  135. font-size: 18px;
  136. font-weight: 700;
  137. color: #404040;
  138. line-height: 22px;
  139. margin: 0 0 4px 0;
  140. padding: 0;
  141. max-width: 100%;
  142. overflow: hidden;
  143. white-space: nowrap;
  144. text-overflow: ellipsis;
  145. &:hover {
  146. color: var(--v-primary-base);
  147. }
  148. }
  149. .company-info p {
  150. height: 18px;
  151. font-size: 13px;
  152. font-weight: 400;
  153. color: var(--color-999);
  154. line-height: 18px;
  155. }
  156. .company-job-list {
  157. padding: 4px 10px 12px;
  158. }
  159. ul li {
  160. list-style: none
  161. }
  162. .company-job-item {
  163. display: block;
  164. height: auto;
  165. padding: 12px 10px;
  166. margin: 0;
  167. border-radius: 8px;
  168. }
  169. .salary {
  170. font-size: 16px;
  171. float: right;
  172. font-weight: 700;
  173. color: #CEC149;
  174. line-height: 22px;
  175. max-width: none;
  176. text-align: right;
  177. flex: 1;
  178. }
  179. .name {
  180. position: relative;
  181. line-height: 22px;
  182. font-weight: 700;
  183. color: #404040;
  184. margin-right: 8px;
  185. overflow: hidden;
  186. text-overflow: ellipsis;
  187. white-space: nowrap;
  188. transition: all linear .2s;
  189. }
  190. .moreBtn {
  191. position: absolute;
  192. width: 100%;
  193. bottom: 0;
  194. height: 47px;
  195. color: #fff;
  196. cursor: pointer;
  197. font-size: 14px;
  198. background: linear-gradient(to right, #12ebb0, #427daa);
  199. &:hover {
  200. font-size: 16px;
  201. span {
  202. font-weight: 700;
  203. }
  204. }
  205. }
  206. </style>