positionList.vue 5.2 KB

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