longCompany.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div>
  3. <div class="sub-li mb-3" :class="item.active ? 'elevation-8' : 'elevation-3'" v-for="item in list" :key="item.id" @mouseenter="item.active = true" @mouseleave="item.active = false">
  4. <div class="company-info-top">
  5. <div class="company-info">
  6. <div class="float-left mr-5">
  7. <v-img :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" :alt="item.anotherName" :width="40" style="height: 40px;border-radius: 4px;"/>
  8. </div>
  9. <h3 :class="{'default-active': item.active }" class="cursor-pointer" @click.stop="jumpToEnterpriseDetail(item.id, true)">
  10. {{ formatName(item.anotherName || item.name) }}
  11. </h3>
  12. <p>{{ item.industryName }}<span v-if="item.industryName && item.scaleName" class="mx-2">|</span>{{ item.scaleName }}</p>
  13. </div>
  14. <div v-if="item.active">
  15. <v-btn class="half-button ml-3" color="primary" size="small" @click.stop="handleCancel(item)">取消收藏</v-btn>
  16. </div>
  17. </div>
  18. <div class="company-info-bottom">
  19. <div class="chipBox">
  20. <div class="d-inline-block" v-for="(val, i) in item.welfareList" :key="i">
  21. <span>{{ val }}</span>
  22. <span class="septal-line" v-if="i !== item.welfareList.length - 1 && val && item.welfareList[i + 1]"></span>
  23. </div>
  24. </div>
  25. <div class="position" @click.stop="jumpToEnterpriseDetail(item.id, true, 1)">
  26. 查看全部职位
  27. <v-icon>mdi-menu-right</v-icon>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. defineOptions({ name: 'long-company-card'})
  35. import Snackbar from '@/plugins/snackbar'
  36. import { useI18n } from '@/hooks/web/useI18n'
  37. import { formatName } from '@/utils/getText'
  38. import { getEnterpriseUnsubscribe } from '@/api/enterprise'
  39. import { jumpToEnterpriseDetail } from '@/utils/position'
  40. const emits = defineEmits(['refresh'])
  41. defineProps({
  42. list: Array
  43. })
  44. const { t } = useI18n()
  45. // 取消收藏
  46. const handleCancel = async (item) => {
  47. if (!item.id) return Snackbar.warning(t('sys.api.operationFailed'))
  48. await getEnterpriseUnsubscribe(item.id)
  49. emits('refresh')
  50. Snackbar.success(t('common.operationSuccessful'))
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .sub-li {
  55. position: relative;
  56. height: 130px;
  57. border-radius: 12px;
  58. padding: 0;
  59. overflow: hidden;
  60. transition: all .2s linear;
  61. background-color: #fff;
  62. &:nth-child(4n) {
  63. margin-right: 0;
  64. }
  65. }
  66. .company-info {
  67. width: 100%;
  68. }
  69. .company-info-top {
  70. display: flex;
  71. height: 76px;
  72. padding: 16px 20px;
  73. overflow: hidden;
  74. justify-content: space-between;
  75. }
  76. .company-info h3 {
  77. height: 22px;
  78. font-size: 16px;
  79. font-weight: 400;
  80. color: #0E100F;
  81. line-height: 22px;
  82. margin: 0 0 4px 0;
  83. padding: 0;
  84. max-width: 100%;
  85. overflow: hidden;
  86. white-space: nowrap;
  87. text-overflow: ellipsis;
  88. }
  89. .company-info p {
  90. height: 18px;
  91. font-size: 13px;
  92. font-weight: 400;
  93. color: var(--color-999);
  94. line-height: 18px;
  95. }
  96. .company-info-bottom {
  97. display: flex;
  98. width: 100%;
  99. padding: 16px 20px;
  100. justify-content: space-between;
  101. background-color: #f8fcfb;
  102. .chipBox {
  103. width: 70%;
  104. min-width: 70%;
  105. overflow: hidden;
  106. text-overflow: ellipsis;
  107. white-space: nowrap;
  108. font-size: 13px;
  109. color: var(--color-999);
  110. }
  111. .position {
  112. color: var(--color-666);
  113. font-size: 14px;
  114. cursor: pointer;
  115. &:hover {
  116. color: var(--v-primary-base);
  117. }
  118. }
  119. }
  120. </style>