item.vue 6.2 KB

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