item.vue 5.7 KB

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