positionList.vue 5.5 KB

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