item.vue 5.9 KB

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