positionList.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="d-flex pl-3">
  3. <div class="position-box">
  4. <div
  5. v-for="(item, index) in list" :key="index"
  6. class="sub-li pl-3"
  7. :class="[{'hoverShadowSolid': chosenIndex === index}, item.active ? 'elevation-8 hoverShadow' : 'elevation-0']"
  8. :style="`margin-top: ${index ? '12px' : '0'}`"
  9. @mouseenter="item.active = true" @mouseleave="item.active = false"
  10. @click="handleClick(item, index)"
  11. >
  12. <div class="job-info">
  13. <div class="sub-li-top">
  14. <div class="sub-li-info">
  15. <p v-ellipse-tooltip :class="['name', {'default-active': item.active }]">{{ formatName(item.name) }}</p>
  16. <svg-icon v-if="item.hire" name="pin" size="30"></svg-icon>
  17. </div>
  18. </div>
  19. <div class="d-flex justify-space-between align-center">
  20. <div v-ellipse-tooltip :style="`max-width': ${!item.payFrom && !item.payTo ? '250px' : '200px'}`">
  21. <span v-for="(j, i) in desc" :key="i" class="font-size-13" style="color: #808080;">
  22. <span v-if="item[j.value] || j.value === 'areaName'" class="mr-1 d-inline-block">
  23. {{ j.value === 'areaName' ? !item.areaId ? '全国' : item.area?.str : item[j.value]}}
  24. </span>
  25. <span v-if="i !== desc.length - 1 && (j.value === 'areaName' || item[desc[i + 1].value])" class="septal-line ml-1"></span>
  26. </span>
  27. </div>
  28. <div>
  29. <p v-if="!item.payFrom && !item.payTo" class="salary">面议</p>
  30. <p v-else class="salary">{{ item.payFrom ? item.payFrom + '-' : '' }}{{ item.payTo }}{{ item.payName ? '/' + item.payName : '' }}</p>
  31. </div>
  32. </div>
  33. <div class="ellipsis" style="height: 24px;overflow: hidden;">
  34. <span v-for="(j, i) in item.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
  35. </div>
  36. </div>
  37. <div class="sub-li-bottom">
  38. <div class="user-info">
  39. <div class="d-flex align-center">
  40. <v-avatar tile size="35">
  41. <v-img class="entLogoImg" :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" />
  42. </v-avatar>
  43. <span v-ellipse-tooltip class="names ml-2 font-size-14 ellipsis" style="max-width: 88%;">
  44. {{ formatName(item.anotherName || item.name) }}
  45. <span class="color-999 font-size-13 ml-3">
  46. <span>{{ item.industryName }}</span>
  47. <span class="septal-line" v-if="item.industryName && item.scaleName"></span>
  48. <span>{{ item.scaleName }}</span>
  49. </span>
  50. </span>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script setup>
  59. defineOptions({ name: 'position-card-item' })
  60. import { ref, watch } from 'vue'
  61. import { formatName } from '@/utils/getText'
  62. const emit = defineEmits(['selectChange'])
  63. const props = defineProps({
  64. items: {
  65. type: Array,
  66. default: () => []
  67. }
  68. })
  69. const chosenIndex = ref(0)
  70. const list = ref([])
  71. watch(
  72. () => props.items,
  73. (newVal) => {
  74. list.value = newVal
  75. },
  76. { immediate: true },
  77. { deep: true }
  78. )
  79. const desc = [
  80. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  81. { mdi: 'mdi-school-outline', value: 'eduName' },
  82. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  83. ]
  84. const handleClick = (item, index) => {
  85. chosenIndex.value = index
  86. list.value.forEach((e, i) => e.active = i === index )
  87. emit('selectChange', item)
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .position-box {
  92. width: 100%;
  93. height: 100%;
  94. }
  95. .sub-li {
  96. position: relative;
  97. width: 384px;
  98. height: 149px;
  99. margin-right: 8px;
  100. margin-top: 12px;
  101. border-radius: 12px;
  102. padding: 0;
  103. overflow: hidden;
  104. cursor: pointer;
  105. background-color: #fff;
  106. border: 1px solid #ddd;
  107. }
  108. .job-info {
  109. position: relative;
  110. padding: 16px 20px;
  111. }
  112. .recommend {
  113. position: absolute;
  114. left: 0;
  115. top: 0;
  116. }
  117. .sub-li-top {
  118. display: flex;
  119. width: 100%;
  120. align-items: center;
  121. }
  122. .sub-li-info {
  123. display: flex;
  124. align-items: center;
  125. flex-wrap: wrap;
  126. height: 31%;
  127. overflow: hidden;
  128. flex: 1;
  129. }
  130. .salary {
  131. font-size: 16px;
  132. font-weight: 700;
  133. color: #00B760;
  134. line-height: 22px;
  135. flex: none;
  136. }
  137. .tags {
  138. font-size: 12px;
  139. color: #666;
  140. display: inline-block;
  141. }
  142. .job-text {
  143. white-space: normal;
  144. padding-right: 0;
  145. height: 22px;
  146. line-height: 22px;
  147. overflow: hidden;
  148. word-break: break-all;
  149. max-width: none;
  150. }
  151. .sub-li-info .name {
  152. position: relative;
  153. margin-right: 8px;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. white-space: nowrap;
  157. font-weight: 600;
  158. color: #0E100F;
  159. &:hover {
  160. color: var(--v-primary-base);
  161. }
  162. }
  163. .sub-li-bottom {
  164. position: absolute;
  165. width: 100%;
  166. height: 54px;
  167. bottom: 1px;
  168. left: 0;
  169. margin-top: 10px;
  170. padding-top: 0;
  171. display: block;
  172. border: none;
  173. }
  174. .user-info {
  175. padding: 12px 20px;
  176. }
  177. .names {
  178. font-weight: 500;
  179. &:hover {
  180. color: #0E100F;
  181. }
  182. }
  183. </style>