item.vue 6.1 KB

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