item.vue 6.0 KB

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