item.vue 4.9 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}"
  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. // const handleEnterprise = (item) => {
  84. // window.open(`/recruit/personal/company/details/${item.id}?key=briefIntroduction`)
  85. // }
  86. </script>
  87. <style lang="scss" scoped>
  88. .position-box {
  89. width: 100%;
  90. height: 100%;
  91. }
  92. .chosen { border: 1px solid var(--v-primary-lighten2) !important; }
  93. .sub-li {
  94. position: relative;
  95. width: 384px;
  96. height: 149px;
  97. margin-right: 8px;
  98. margin-top: 12px;
  99. border-radius: 12px;
  100. padding: 0;
  101. overflow: hidden;
  102. cursor: pointer;
  103. // transition: all .2s linear;
  104. background-color: #fff;
  105. border: 1px solid #fff;
  106. &:hover {
  107. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  108. .salary { color: var(--v-primary-base) !important; }
  109. }
  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: #CEC149;
  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: #345768;
  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>