positionList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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}"
  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 :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 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([''])
  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. .chosen { border: 1px solid var(--v-primary-lighten2) !important; }
  96. .sub-li {
  97. position: relative;
  98. width: 384px;
  99. height: 149px;
  100. margin-right: 8px;
  101. margin-top: 12px;
  102. border-radius: 12px;
  103. padding: 0;
  104. overflow: hidden;
  105. cursor: pointer;
  106. // transition: all .2s linear;
  107. background-color: #fff;
  108. border: 1px solid #fff;
  109. &:hover {
  110. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  111. .salary { color: var(--v-error-base) !important; }
  112. }
  113. }
  114. .job-info {
  115. position: relative;
  116. padding: 16px 20px;
  117. }
  118. .recommend {
  119. position: absolute;
  120. left: 0;
  121. top: 0;
  122. }
  123. .sub-li-top {
  124. display: flex;
  125. width: 100%;
  126. align-items: center;
  127. }
  128. .sub-li-info {
  129. display: flex;
  130. align-items: center;
  131. flex-wrap: wrap;
  132. height: 31%;
  133. overflow: hidden;
  134. flex: 1;
  135. }
  136. .salary {
  137. font-size: 16px;
  138. font-weight: 700;
  139. color: #CEC149;
  140. line-height: 22px;
  141. flex: none;
  142. }
  143. .tags {
  144. font-size: 12px;
  145. color: #666;
  146. display: inline-block;
  147. }
  148. .job-text {
  149. white-space: normal;
  150. padding-right: 0;
  151. height: 22px;
  152. line-height: 22px;
  153. overflow: hidden;
  154. word-break: break-all;
  155. max-width: none;
  156. }
  157. .sub-li-info .name {
  158. position: relative;
  159. // max-width: 140px;
  160. margin-right: 8px;
  161. overflow: hidden;
  162. text-overflow: ellipsis;
  163. white-space: nowrap;
  164. font-weight: 600;
  165. color: #345768;
  166. &:hover {
  167. color: var(--v-primary-base);
  168. }
  169. }
  170. .sub-li-bottom {
  171. position: absolute;
  172. width: 100%;
  173. height: 54px;
  174. bottom: 1px;
  175. left: 0;
  176. margin-top: 10px;
  177. padding-top: 0;
  178. display: block;
  179. border: none;
  180. }
  181. .user-info {
  182. padding: 12px 20px;
  183. }
  184. .names {
  185. font-weight: 500;
  186. &:hover {
  187. // color: var(--v-primary-base);
  188. color: #404040;
  189. }
  190. }
  191. </style>