positionList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="d-flex">
  3. <div class="position-box">
  4. <div class="sub-li"
  5. v-for="(item, index) in list" :key="index"
  6. :class="[{'chosen': chosenIndex === index}, item.active ? 'elevation-8' : 'elevation-3']"
  7. :style="`margin-top: ${index ? '12px' : '0'}`"
  8. @mouseenter="item.active = true" @mouseleave="item.active = false"
  9. @click="handleClick(item, index)"
  10. >
  11. <div class="job-info">
  12. <div class="sub-li-top">
  13. <div class="sub-li-info">
  14. <p v-ellipse-tooltip :class="['name', {'default-active': item.active }]">{{ formatName(item.name) }}</p>
  15. <svg-icon v-if="item.hire" name="pin" size="30"></svg-icon>
  16. </div>
  17. </div>
  18. <div class="d-flex justify-space-between align-center">
  19. <div>
  20. <span v-for="(j, i) in desc" :key="i" class="font-size-13" style="color: #808080;">
  21. <span v-if="item[j.value] || j.value === 'areaName'" class="mr-1 d-inline-block">
  22. {{ j.value === 'areaName' ? !item.areaId ? '全国' : item.area?.str : item[j.value]}}
  23. <!-- {{ (j.value === 'areaName' && !item.areaId) ? '全国' : 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 size="35">
  41. <v-img :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. // import { spaces } from '@/utils/index.js'
  63. const emit = defineEmits(['selectChange'])
  64. const props = defineProps({
  65. items: {
  66. type: Array,
  67. default: () => []
  68. }
  69. })
  70. const chosenIndex = ref(0)
  71. const list = ref([])
  72. watch(
  73. () => props.items,
  74. (newVal) => {
  75. list.value = newVal
  76. },
  77. { immediate: true },
  78. { deep: true }
  79. )
  80. const desc = [
  81. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  82. { mdi: 'mdi-school-outline', value: 'eduName' },
  83. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  84. ]
  85. const handleClick = (item, index) => {
  86. chosenIndex.value = index
  87. list.value.forEach((e, i) => e.active = i === index )
  88. emit('selectChange', item)
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .position-box {
  93. width: 100%;
  94. height: 100%;
  95. }
  96. .chosen { border: 1px solid var(--v-primary-base) !important; }
  97. .sub-li {
  98. position: relative;
  99. width: 384px;
  100. height: 149px;
  101. margin-right: 8px;
  102. margin-top: 12px;
  103. border-radius: 12px;
  104. padding: 0;
  105. overflow: hidden;
  106. cursor: pointer;
  107. // transition: all .2s linear;
  108. background-color: #fff;
  109. border: 1px solid #fff;
  110. }
  111. .job-info {
  112. position: relative;
  113. padding: 16px 20px;
  114. }
  115. .recommend {
  116. position: absolute;
  117. left: 0;
  118. top: 0;
  119. }
  120. .sub-li-top {
  121. display: flex;
  122. width: 100%;
  123. align-items: center;
  124. }
  125. .sub-li-info {
  126. display: flex;
  127. align-items: center;
  128. flex-wrap: wrap;
  129. height: 31%;
  130. overflow: hidden;
  131. flex: 1;
  132. }
  133. .salary {
  134. font-size: 16px;
  135. font-weight: 700;
  136. color: #00B760;
  137. line-height: 22px;
  138. flex: none;
  139. }
  140. .tags {
  141. font-size: 12px;
  142. color: #666;
  143. display: inline-block;
  144. }
  145. .job-text {
  146. white-space: normal;
  147. padding-right: 0;
  148. height: 22px;
  149. line-height: 22px;
  150. overflow: hidden;
  151. word-break: break-all;
  152. max-width: none;
  153. }
  154. .sub-li-info .name {
  155. position: relative;
  156. // max-width: 140px;
  157. margin-right: 8px;
  158. overflow: hidden;
  159. text-overflow: ellipsis;
  160. white-space: nowrap;
  161. font-weight: 600;
  162. color: #0E100F;
  163. &:hover {
  164. color: var(--v-primary-base);
  165. }
  166. }
  167. .sub-li-bottom {
  168. position: absolute;
  169. width: 100%;
  170. height: 54px;
  171. bottom: 1px;
  172. left: 0;
  173. margin-top: 10px;
  174. padding-top: 0;
  175. display: block;
  176. border: none;
  177. }
  178. .user-info {
  179. padding: 12px 20px;
  180. }
  181. .names {
  182. font-weight: 500;
  183. &:hover {
  184. // color: var(--v-primary-base);
  185. color: #404040;
  186. }
  187. }
  188. </style>