positionList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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 }]">{{ item.name }}</p>
  15. <svg-icon v-if="item.hire" name="pin" size="30"></svg-icon>
  16. </div>
  17. <p v-if="!item.payFrom && !item.payTo" class="salary">面议</p>
  18. <p v-else class="salary">{{ item.payFrom ? item.payFrom + '-' : '' }}{{ item.payTo }}{{ item.payName ? '/' + item.payName : '' }}</p>
  19. </div>
  20. <div class="d-flex justify-space-between align-center">
  21. <div>
  22. <span v-for="(j, i) in desc" :key="i" class="font-size-13" style="color: #808080;">
  23. <span v-if="item[j.value]" class="mr-1 d-inline-block">{{ item[j.value] }}</span>
  24. <span v-if="i !== desc.length - 1 && item[j.value] && item[desc[i + 1].value]" class="septal-line ml-1"></span>
  25. </span>
  26. </div>
  27. </div>
  28. <div class="ellipsis" style="height: 24px;overflow: hidden;">
  29. <span v-for="(j, i) in item.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
  30. </div>
  31. </div>
  32. <div class="sub-li-bottom">
  33. <div class="user-info">
  34. <div class="d-flex align-center">
  35. <v-avatar size="35">
  36. <v-img :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" />
  37. </v-avatar>
  38. <span class="names ml-2 font-size-14 ellipsis" style="max-width: 88%;">
  39. {{ item.anotherName }}
  40. <span class="color-999 font-size-13 ml-3">
  41. <span>{{ item.industryName }}</span>
  42. <span class="septal-line" v-if="item.industryName && item.scaleName"></span>
  43. <span>{{ item.scaleName }}</span>
  44. </span>
  45. </span>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. defineOptions({ name: 'position-card-item' })
  55. import { ref, watch } from 'vue'
  56. const emit = defineEmits([''])
  57. const props = defineProps({
  58. items: {
  59. type: Array,
  60. default: () => []
  61. }
  62. })
  63. const chosenIndex = ref(0)
  64. const list = ref([])
  65. watch(
  66. () => props.items,
  67. (newVal) => {
  68. list.value = newVal
  69. },
  70. { immediate: true },
  71. { deep: true }
  72. )
  73. const desc = [
  74. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  75. { mdi: 'mdi-school-outline', value: 'eduName' },
  76. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  77. ]
  78. const handleClick = (item, index) => {
  79. chosenIndex.value = index
  80. list.value.forEach((e, i) => e.active = i === index )
  81. emit('selectChange', item)
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .position-box {
  86. width: 100%;
  87. height: 100%;
  88. }
  89. .chosen { border: 1px solid var(--v-primary-lighten2) !important; }
  90. .sub-li {
  91. position: relative;
  92. width: 384px;
  93. height: 149px;
  94. margin-right: 8px;
  95. margin-top: 12px;
  96. border-radius: 12px;
  97. padding: 0;
  98. overflow: hidden;
  99. cursor: pointer;
  100. // transition: all .2s linear;
  101. background-color: #fff;
  102. border: 1px solid #fff;
  103. &:hover {
  104. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  105. .salary { color: var(--v-error-base) !important; }
  106. }
  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: #CEC149;
  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. max-width: 140px;
  154. margin-right: 8px;
  155. overflow: hidden;
  156. text-overflow: ellipsis;
  157. white-space: nowrap;
  158. font-weight: 600;
  159. color: #345768;
  160. &:hover {
  161. color: var(--v-primary-base);
  162. }
  163. }
  164. .sub-li-bottom {
  165. position: absolute;
  166. width: 100%;
  167. height: 54px;
  168. bottom: 1px;
  169. left: 0;
  170. margin-top: 10px;
  171. padding-top: 0;
  172. display: block;
  173. border: none;
  174. }
  175. .user-info {
  176. padding: 12px 20px;
  177. }
  178. .names {
  179. font-weight: 500;
  180. &:hover {
  181. // color: var(--v-primary-base);
  182. color: #404040;
  183. }
  184. }
  185. </style>