item.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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" :style="{'height': tab === 3 && item.hire ? '180px' : '149px'}">
  5. <div class="job-info" @click.stop="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 }]">{{ formatName(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
  16. v-if="item[j.value] || j.value === 'areaName'"
  17. class="mr-1 d-inline-block"
  18. >
  19. {{ j.value === 'areaName' ? !item.areaId ? '全国' : item.area?.str : item[j.value] }}
  20. <!-- {{ (j.value === 'areaName' && !item.areaId) ? '全国' : item[j.value] }} -->
  21. </span>
  22. <span
  23. v-if="i !== desc.length - 1 && (item[j.value] || (j.value === 'areaName' && !item.areaId)) && item[desc[i + 1].value]"
  24. class="septal-line ml-1"
  25. >
  26. </span>
  27. </span>
  28. </div>
  29. <div>
  30. <p v-if="!item.payFrom && !item.payTo" class="salary">面议</p>
  31. <p v-else class="salary">{{ item.payFrom ? item.payFrom + '-' : '' }}{{ item.payTo }}{{ item.payName ? '/' + item.payName : '' }}</p>
  32. </div>
  33. </div>
  34. <div v-ellipse-tooltip.top class="ellipsis" style="height: 24px;overflow: hidden;">
  35. <span v-for="(j, i) in item.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
  36. </div>
  37. <div v-if="tab === 3 && item.hire" class="text-end mt-3">
  38. <v-chip v-if="item.hirePrice" size="small" label color="primary">赏金:{{ commissionCalculation(item.hirePrice / 100, 1) }}元</v-chip>
  39. <v-chip v-if="item.hirePoint" size="small" label class="ml-1" color="primary">积分:{{ commissionCalculation(item.hirePoint / 100, 1) }}点</v-chip>
  40. </div>
  41. <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>
  42. </div>
  43. <div class="sub-li-bottom" @click.stop="jumpToEnterpriseDetail(item.enterpriseId, isOpenWindow)">
  44. <div class="user-info">
  45. <div class="d-flex align-center">
  46. <v-avatar size="35">
  47. <v-img :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" />
  48. </v-avatar>
  49. <span v-ellipse-tooltip.top class="names ml-2 font-size-14 ellipsis" style="max-width: 88%;">
  50. {{ formatName(item.anotherName || item.enterpriseName) }}
  51. <span class="color-999 font-size-13 ml-3">
  52. <span>{{ item.industryName }}</span>
  53. <span class="septal-line" v-if="item.industryName && item.scaleName"></span>
  54. <span>{{ item.scaleName }}</span>
  55. </span>
  56. </span>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script setup>
  65. defineOptions({ name: 'position-card-item' })
  66. import { ref, watch } from 'vue'
  67. import { commissionCalculation, jumpToEnterpriseDetail } from '@/utils/position'
  68. import { timesTampChange } from '@/utils/date'
  69. import { formatName } from '@/utils/getText'
  70. const props = defineProps({
  71. items: {
  72. type: Array,
  73. default: () => []
  74. },
  75. tab: {
  76. type: Number,
  77. default: 1
  78. },
  79. isOpenWindow: {
  80. type: Boolean,
  81. default: true
  82. }
  83. })
  84. // const list = ref([])
  85. // watch(
  86. // () => props.items,
  87. // (newVal) => {
  88. // console.log(123, newVal)
  89. // list.value = newVal
  90. // },
  91. // { immediate: true },
  92. // { deep: true }
  93. // )
  94. const desc = [
  95. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  96. { mdi: 'mdi-school-outline', value: 'eduName' },
  97. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  98. ]
  99. const emits = defineEmits(['position', 'enterprise'])
  100. const handlePosition = (item) => {
  101. emits('position', item)
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .position-box {
  106. display: flex;
  107. flex-wrap: wrap;
  108. width: 100%;
  109. height: 100%;
  110. }
  111. .sub-li {
  112. position: relative;
  113. width: calc((100% - 24px) / 3);
  114. min-width: calc((100% - 24px) / 3);
  115. max-width: calc((100% - 24px) / 3);
  116. margin: 0 12px 12px 0;
  117. border-radius: 12px;
  118. padding: 0;
  119. overflow: hidden;
  120. cursor: pointer;
  121. transition: all .2s linear;
  122. background-color: #fff;
  123. &:nth-child(3n) {
  124. margin-right: 0;
  125. }
  126. &:hover {
  127. box-shadow: 0 2px 12px 0 rgba(153, 153, 153, 1);
  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. // align-items: center;
  200. // justify-content: space-between;
  201. background-color: #b2dfdb2b;
  202. }
  203. .names {
  204. font-weight: 500;
  205. color: #404040;
  206. &:hover {
  207. color: var(--v-error-base);
  208. }
  209. }
  210. </style>