item.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!-- 搜索页面的职位详情-长条 -->
  2. <template>
  3. <div class="positionItem" v-for="(item, index) in list" :key="index" @mouseenter="item.active = true" @mouseleave="item.active = false">
  4. <div class="position-and-company">
  5. <!-- 职位 -->
  6. <div class="position" @mouseenter="item.positionActive = true" @mouseleave="item.positionActive = false" @click.stop="handlePosition(item)">
  7. <div class="d-flex">
  8. <div v-if="item?.job?.hire" class="mr-3">
  9. <svg-icon name="pin" size="45"></svg-icon>
  10. </div>
  11. <div>
  12. <div class="d-flex">
  13. <p v-ellipse-tooltip.top v-if="item.job.name.indexOf('style')" v-html="item.job.name" :class="['title1', {'default-active': item.positionActive }]"></p>
  14. <p v-else v-ellipse-tooltip.top :class="['title1', {'default-active': item.positionActive }]">{{ formatName(item.job.name) }}{{ item.job.pos ? ' [' + item.job.pos + '] ' : '' }}</p>
  15. <p v-if="!item.job.payFrom && !item.job.payTo" class="salary ml-1">面议</p>
  16. <p v-else class="salary ml-1">{{ item.job.payFrom ? item.job.payFrom + '-' : '' }}{{ item.job.payTo }}{{ item.job.payName ? '/' + item.job.payName : '' }}</p>
  17. <div v-if="item?.job?.hire">
  18. <v-chip v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0" class="ml-3" label color="primary" size="small">赏金:{{ commissionCalculation(item.job.hirePrice / 100, 1) }}元</v-chip>
  19. <v-chip v-if="item?.job?.hirePoint && item?.job?.hirePoint > 0" class="ml-3" label color="primary" size="small">积分:{{ commissionCalculation(item.job.hirePoint / 100, 1) }}点</v-chip>
  20. </div>
  21. </div>
  22. <div class="mt-2">
  23. <span v-for="(j, i) in desc" :key="i">
  24. <v-chip
  25. v-if="item.job[j.value] || j.value === 'areaName'"
  26. size="small"
  27. label
  28. class="mr-1"
  29. color="var(--color-666)"
  30. :prepend-icon="j.mdi"
  31. >
  32. <!-- {{ item.job.areaId }} -->
  33. <!-- {{ (j.value === 'areaName' && !item.job.areaId) ? '全国' : item.job[j.value] }} -->
  34. {{ j.value === 'areaName' ? !item.job.areaId ? '全国' : item.job.area?.str : item.job[j.value] }}
  35. </v-chip>
  36. </span>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <!-- 公司 -->
  42. <div class="company" @click.stop="jumpToEnterpriseDetail(item.enterprise.id, true)">
  43. <div class="float-left">
  44. <v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" :alt="item.enterprise.anotherName" :width="40" style="height: 40px;border-radius: 4px;"/>
  45. </div>
  46. <div class="company-info">
  47. <v-hover>
  48. <template v-slot:default="{ isHovering, props }">
  49. <h3 v-bind="props" v-ellipse-tooltip.top :class="{'default-active': isHovering }" class="title1">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
  50. </template>
  51. </v-hover>
  52. <p v-ellipse-tooltip.top class="mt-2" style="max-width: 420px;">
  53. {{ item.enterprise.scaleName }}
  54. <span class="mx-2" v-if="item.enterprise.scaleName && item.enterprise.industryName">|</span>
  55. {{ item.enterprise.industryName }}
  56. </p>
  57. </div>
  58. </div>
  59. </div>
  60. <!-- 底部 -->
  61. <div class="footer">
  62. <div class="footer-left">
  63. <template v-for="(jobTag, jobTagsIndex) in item.job.tagList" :key="jobTagsIndex">
  64. <span class="textColor666 mx-1" v-if="jobTagsIndex">|</span>
  65. <span class="textColor666 dis">{{ jobTag }}</span>
  66. </template>
  67. </div>
  68. <div class="footer-right" v-if="item.contact">
  69. <v-avatar size="x-small" :image="getUserAvatar(item.contact?.avatar, item.contact?.sex)"></v-avatar>
  70. <span class="mx-2 textColor666">
  71. {{ item.contact?.name }}
  72. <span v-if="item?.contact?.postNameCn">|</span>
  73. {{ item.contact?.postNameCn }}
  74. </span>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script setup>
  80. import { commissionCalculation } from '@/utils/position'
  81. defineOptions({ name: 'long-strip-position-card-item' })
  82. import { ref, watch } from 'vue'
  83. import { getUserAvatar } from '@/utils/avatar'
  84. import { formatName } from '@/utils/getText'
  85. import { jumpToEnterpriseDetail } from '@/utils/position'
  86. const props = defineProps({
  87. items: {
  88. type: Object,
  89. default: () => ({ data: [], total: 0 })
  90. }
  91. })
  92. const list = ref([])
  93. watch(
  94. () => props.items,
  95. (newVal) => {
  96. list.value = newVal
  97. },
  98. { immediate: true },
  99. { deep: true }
  100. )
  101. const desc = [
  102. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  103. { mdi: 'mdi-school-outline', value: 'eduName' },
  104. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  105. ]
  106. const handlePosition = (item) => {
  107. const id = item.job.id
  108. if (!id) return
  109. window.open(`/recruit/personal/position/details/${id}`)
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .title1 {
  114. position: relative;
  115. max-width: 420px;
  116. margin-right: 8px;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. white-space: nowrap;
  120. font-size: 16px;
  121. font-weight: 600;
  122. &:hover {
  123. color: var(--v-primary-base);
  124. }
  125. }
  126. .company {
  127. flex: 1;
  128. display: flex;
  129. justify-content: start;
  130. }
  131. .company-info {
  132. float: left;
  133. margin-left: 16px;
  134. // width: 282px;
  135. }
  136. .company-info p {
  137. height: 18px;
  138. font-size: 13px;
  139. font-weight: 400;
  140. color: var(--color-999);
  141. }
  142. .textColor666 { color: var(--color-666); }
  143. .positionItem {
  144. // width: 850px;
  145. width: 100%;
  146. margin-bottom: 12px;
  147. border-radius: 12px;
  148. padding: 0;
  149. overflow: hidden;
  150. cursor: pointer;
  151. transition: all .2s linear;
  152. background-color: #fff;
  153. &:hover {
  154. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  155. }
  156. .position-and-company {
  157. display: flex;
  158. padding: 16px 20px;
  159. width: 100%;
  160. .position {
  161. width: 500px;
  162. padding-right: 30px;
  163. }
  164. }
  165. .footer {
  166. height: 48px;
  167. line-height: 48px;
  168. padding: 0px 20px;
  169. font-size: 14px;
  170. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  171. display: flex;
  172. .footer-left {
  173. width: 440px;
  174. padding-right: 12px;
  175. }
  176. .footer-right {
  177. flex: 1;
  178. text-align: right;
  179. }
  180. div {
  181. overflow: hidden;
  182. text-overflow: ellipsis;
  183. white-space: nowrap;
  184. }
  185. }
  186. .ellipsisStyle {
  187. overflow: hidden;
  188. text-overflow: ellipsis;
  189. white-space: nowrap;
  190. }
  191. }
  192. .salary {
  193. font-size: 16px;
  194. font-weight: 700;
  195. color: var(--v-error-base);
  196. line-height: 22px;
  197. flex: none;
  198. }
  199. </style>