item.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="position-box">
  3. <div class="sub-li" v-for="(item, index) in list" :key="index" @mouseenter="item.active = true" @mouseleave="item.active = false">
  4. <div class="job-info">
  5. <div class="sub-li-top">
  6. <div class="sub-li-info">
  7. <p :class="['name', {'default-active': item.active }]">{{ item.name }}</p>
  8. <v-chip size="x-small" color="error" label variant="outlined" class="mr-1">急聘</v-chip>
  9. <v-chip size="x-small" color="warning" label variant="outlined">NEW</v-chip>
  10. </div>
  11. <p class="salary">{{ item.payFrom }}-{{ item.payTo }}/{{ item.payName }}</p>
  12. </div>
  13. <div style="height: 24px;overflow: hidden;">
  14. <v-chip size="x-small" label v-for="(k, i) in item.tagList" :key="i" class="mr-1" color="#666">{{ k }}</v-chip>
  15. </div>
  16. <div>
  17. <v-chip size="x-small" label v-for="(j, i) in desc" :key="i" class="mr-1" color="#666" :prepend-icon="j.mdi">{{ item[j.value] }}</v-chip>
  18. </div>
  19. </div>
  20. <div class="sub-li-bottom">
  21. <div class="user-info">
  22. <div class="d-flex align-center">
  23. <v-img src="../../assets/logo.png" width="40" style="height: 40px;" />
  24. <span class="names ml-2" style="font-size: 14px">{{ item.anotherName }}</span>
  25. </div>
  26. <p class="names float-right">
  27. <span>{{ item.industryName }}</span>
  28. <span class="vline"></span>
  29. <span>{{ item.scaleName }}</span>
  30. </p>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script setup>
  37. defineOptions({ name: 'position-card-item' })
  38. import { ref, watch } from 'vue'
  39. const props = defineProps({
  40. items: {
  41. type: Array,
  42. default: () => []
  43. }
  44. })
  45. const list = ref([])
  46. watch(
  47. () => props.items,
  48. (newVal) => {
  49. list.value = newVal
  50. },
  51. { immediate: true },
  52. { deep: true }
  53. )
  54. const desc = [
  55. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  56. { mdi: 'mdi-school-outline', value: 'eduName' },
  57. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  58. ]
  59. </script>
  60. <style lang="scss" scoped>
  61. .position-box {
  62. display: flex;
  63. flex-wrap: wrap;
  64. }
  65. .sub-li {
  66. position: relative;
  67. width: calc((100% - 24px) / 3);
  68. min-width: calc((100% - 24px) / 3);
  69. max-width: calc((100% - 24px) / 3);
  70. margin: 0 12px 12px 0;
  71. height: 165px;
  72. border-radius: 12px;
  73. padding: 0;
  74. overflow: hidden;
  75. cursor: pointer;
  76. transition: all .2s linear;
  77. background-color: #fff;
  78. &:nth-child(3n) {
  79. margin-right: 0;
  80. }
  81. &:hover {
  82. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  83. }
  84. }
  85. .job-info {
  86. padding: 16px 20px;
  87. }
  88. .sub-li-top {
  89. display: flex;
  90. width: 100%;
  91. align-items: center;
  92. margin-bottom: 12px;
  93. }
  94. .sub-li-info {
  95. display: flex;
  96. align-items: center;
  97. flex-wrap: wrap;
  98. height: 22px;
  99. overflow: hidden;
  100. flex: 1;
  101. }
  102. .salary {
  103. font-size: 16px;
  104. font-weight: 700;
  105. color: #fe574a;
  106. line-height: 22px;
  107. flex: none;
  108. }
  109. .job-text {
  110. white-space: normal;
  111. padding-right: 0;
  112. height: 22px;
  113. line-height: 22px;
  114. overflow: hidden;
  115. word-break: break-all;
  116. max-width: none;
  117. }
  118. .sub-li-info .name {
  119. position: relative;
  120. max-width: 200px;
  121. margin-right: 8px;
  122. overflow: hidden;
  123. text-overflow: ellipsis;
  124. white-space: nowrap;
  125. font-weight: 600;
  126. &:hover {
  127. color: var(--v-primary-base);
  128. }
  129. }
  130. .sub-li-bottom {
  131. position: absolute;
  132. width: 100%;
  133. bottom: -6px;
  134. left: 0;
  135. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  136. margin-top: 10px;
  137. padding-top: 0;
  138. display: block;
  139. border: none;
  140. }
  141. .user-info {
  142. display: flex;
  143. padding: 12px 20px;
  144. align-items: center;
  145. justify-content: space-between;
  146. }
  147. .names {
  148. color: #666;
  149. font-size: 13px;
  150. }
  151. .vline {
  152. display: inline-block;
  153. width: 1px;
  154. height: 10px;
  155. vertical-align: middle;
  156. background-color: #e0e0e0;
  157. margin: 0 10px;
  158. }
  159. </style>