hotPromoted.vue 7.2 KB

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