longCompany.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div>
  3. <div class="sub-li mb-3 elevation-2" 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="handleClickEnterprise(item, 'briefIntroduction')">{{ dealEnterpriseName(item.anotherName || item.name) }}</h3>
  10. <p>{{ item.industryName }}<span v-if="item.industryName && item.scaleName" class="mx-2">|</span>{{ item.scaleName }}</p>
  11. </div>
  12. <div v-if="item.active">
  13. <v-btn class="half-button ml-3" color="primary" size="small" @click.stop="handleCancel(item)">取消收藏</v-btn>
  14. </div>
  15. </div>
  16. <div class="company-info-bottom">
  17. <div class="chipBox">
  18. <div class="d-inline-block" v-for="(val, i) in item.welfareList" :key="i">
  19. <span>{{ val }}</span>
  20. <span class="septal-line" v-if="i !== item.welfareList.length - 1 && val && item.welfareList[i + 1]"></span>
  21. </div>
  22. </div>
  23. <div class="position" @click="handleClickEnterprise(item, 'recruitmentPositions')">
  24. 查看全部职位
  25. <v-icon>mdi-menu-right</v-icon>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script setup>
  32. defineOptions({ name: 'long-company-card'})
  33. import Snackbar from '@/plugins/snackbar'
  34. import { useI18n } from '@/hooks/web/useI18n'
  35. import { dealEnterpriseName } from '@/utils/getText'
  36. import { getEnterpriseUnsubscribe } from '@/api/enterprise'
  37. const emits = defineEmits(['refresh'])
  38. defineProps({
  39. list: Array
  40. })
  41. const { t } = useI18n()
  42. const handleClickEnterprise = (item, key) => {
  43. window.open(`/recruit/personal/company/details/${item.id}?key=${key}`)
  44. }
  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. &:hover {
  66. box-shadow: 0px 3px 5px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 5px 8px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 14px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12)) !important;
  67. }
  68. }
  69. .company-info {
  70. float: left;
  71. margin-left: 16px;
  72. width: 282px;
  73. }
  74. .company-info-top {
  75. display: flex;
  76. height: 76px;
  77. padding: 16px 20px;
  78. overflow: hidden;
  79. justify-content: space-between;
  80. }
  81. .company-info h3 {
  82. height: 22px;
  83. font-size: 16px;
  84. font-weight: 400;
  85. color: var(--color-222);
  86. line-height: 22px;
  87. margin: 0 0 4px 0;
  88. padding: 0;
  89. max-width: 100%;
  90. overflow: hidden;
  91. white-space: nowrap;
  92. text-overflow: ellipsis;
  93. }
  94. .company-info p {
  95. height: 18px;
  96. font-size: 13px;
  97. font-weight: 400;
  98. color: var(--color-999);
  99. line-height: 18px;
  100. }
  101. .company-info-bottom {
  102. display: flex;
  103. width: 100%;
  104. padding: 16px 20px;
  105. justify-content: space-between;
  106. background-color: #f8fcfb;
  107. .chipBox {
  108. width: 70%;
  109. min-width: 70%;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. white-space: nowrap;
  113. font-size: 13px;
  114. color: var(--color-999);
  115. }
  116. .position {
  117. color: var(--color-666);
  118. font-size: 14px;
  119. cursor: pointer;
  120. &:hover {
  121. color: var(--v-primary-base);
  122. }
  123. }
  124. }
  125. </style>