entCard.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <v-hover v-slot="{ isHovering, props }" v-for="(val, index) in list" :key="val.id">
  3. <v-card v-bind="props" :elevation="isHovering ? 10 : 5" class="cursor-pointer mb-3" :class="{'active': chosenIndex === index}" width="500" @click="handleClickEnterprise(val, index)">
  4. <div class="d-flex pa-4 pb-2">
  5. <img :src="val.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" style="width: 80px; height: 80px; border-radius: 4px;" />
  6. <div style="max-width: 390px;">
  7. <h3 v-ellipse-tooltip class="enterprise-name ml-3">{{ formatName(val.anotherName || val.name) }}</h3>
  8. <p class="font-size-14 color-666 mt-1 mb-2 ml-3">
  9. <span>{{ val.industryName }}</span>
  10. <span class="septal-line" v-if="val.industryName && val.scaleName"></span>
  11. <span>{{ val.scaleName }}</span>
  12. </p>
  13. <div class="flex-nowrap overflow-hidden pl-3" style="height: 35px;">
  14. <v-chip v-for="(welfare, index) in val.welfareList" :key="index" class="mr-2 mb-4 display-inline-block" variant="flat" color="primary" size="small">
  15. {{ welfare }}
  16. </v-chip>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="card-bottom">{{ val.jobCount }}个在线职位招聘中</div>
  21. </v-card>
  22. </v-hover>
  23. </template>
  24. <script setup>
  25. defineOptions({ name: 'EntCard' })
  26. import { formatName } from '@/utils/getText'
  27. import { ref } from 'vue'
  28. const emit = defineEmits(['selectChange'])
  29. defineProps({
  30. list: Array
  31. })
  32. const chosenIndex = ref(0)
  33. const handleClickEnterprise = (val, index) => {
  34. chosenIndex.value = index
  35. emit('selectChange', val)
  36. }
  37. </script>
  38. <style scoped lang="scss">
  39. .card-bottom {
  40. height: 40px;
  41. line-height: 40px;
  42. color: #fff;
  43. text-align: center;
  44. font-size: 15px;
  45. background: linear-gradient(to right, #12ebb0, #427daa);
  46. }
  47. .active {
  48. border: 1px solid var(--v-primary-base);
  49. }
  50. .v-card:hover {
  51. h3 {
  52. color: var(--v-primary-base);
  53. }
  54. }
  55. </style>