longStrip.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div>
  3. <div class="position-item mb-3 job-closed" v-for="(val, i) in props.items" :key="i" @mouseenter="val.active = true" @mouseleave="val.active = false">
  4. <div class="info-header">
  5. <div v-if="val.active" class="header-btn">
  6. <v-btn v-if="props.showCancelBtn" class="half-button ml-3" color="primary" size="small" @click="handleCancel(val)">取消感兴趣</v-btn>
  7. </div>
  8. <div class="img-box">
  9. <v-avatar :image="getUserAvatar(val.contact.avatar, val.contact.sex)" size="x-small"></v-avatar>
  10. <span class="name">
  11. <span class="mx-3">{{ val.contact.name }}</span>
  12. <span class="gray">{{ val.contact.postNameCn }}</span>
  13. </span>
  14. </div>
  15. </div>
  16. <div class="info-content">
  17. <div class="job-info">
  18. <div class="job-name cursor-pointer">
  19. <span class="mr-3 info-name" @click="handleToPositionDetails(val)">{{ val.job.name }}</span>
  20. <span v-if="val?.job?.areaName">[{{ val.job.areaName }}]</span>
  21. </div>
  22. <div class="job-other">
  23. <span class="salary">{{ val.job.payFrom }}-{{ val.job.payTo }}/{{ val.job.payName }}</span>
  24. <v-chip class="mx-3" color="primary" label size="small">{{ val.job.expName }}</v-chip>
  25. <v-chip color="primary" label size="small">{{ val.job.eduName }}</v-chip>
  26. </div>
  27. </div>
  28. <div class="company-info">
  29. <v-img width="50" height="50" :src="val.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/7.png'"></v-img>
  30. <div class="ml-3">
  31. <div class="cursor-pointer info-name">{{ val.enterprise.name }}</div>
  32. <div class="mt-3">
  33. <v-chip color="primary" label size="small" class="mr-3" v-for="k in desc" :key="k">{{ val.enterprise[k] }}</v-chip>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script setup>
  42. defineOptions({ name: 'longStrip'})
  43. import { getPersonJobUnfavorite } from '@/api/position'
  44. import { useI18n } from '@/hooks/web/useI18n'
  45. import Snackbar from '@/plugins/snackbar'
  46. import { getUserAvatar } from '@/utils/avatar'
  47. import { useRouter } from 'vue-router'
  48. const emits = defineEmits(['refresh'])
  49. const { t } = useI18n()
  50. const props = defineProps({
  51. items: {
  52. type: Array,
  53. default: () => []
  54. },
  55. showCancelBtn: {
  56. type: Boolean,
  57. default: false
  58. }
  59. })
  60. const router = useRouter()
  61. const desc = ['industryName', 'financingName', 'scaleName']
  62. const handleCancel = async (item) => {
  63. if (!item.job.id) return Snackbar.warning(t('sys.api.operationFailed'))
  64. await getPersonJobUnfavorite(item.job.id)
  65. emits('refresh')
  66. Snackbar.success(t('common.operationSuccessful'))
  67. }
  68. // 职位详情
  69. const handleToPositionDetails = (item) => {
  70. router.push(`/recruit/personal/position/details/${item.job.id}`)
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .position-item {
  75. height: 144px;
  76. background-color: #fff;
  77. border-radius: 12px;
  78. &:hover {
  79. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  80. }
  81. .info-header {
  82. height: 48px;
  83. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  84. border-radius: 12px;
  85. .img-box {
  86. padding: 12px 24px;
  87. .name {
  88. color: var(--color-222);
  89. font-weight: 400;
  90. font-size: 13px;
  91. .gray {
  92. color: var(--color-666);
  93. }
  94. }
  95. }
  96. .header-btn {
  97. padding: 10px 10px 0 0;
  98. float: right;
  99. .v-btn {
  100. z-index: 1;
  101. }
  102. }
  103. }
  104. .info-content {
  105. display: flex;
  106. padding: 16px 24px;
  107. justify-content: space-between;
  108. .job-info {
  109. width: 430px;
  110. min-width: 430px;
  111. max-width: 430px;
  112. font-weight: 500;
  113. font-size: 16px;
  114. .job-name {
  115. height: 22px;
  116. line-height: 22px;
  117. color: var(--color-222);
  118. margin-bottom: 12px;
  119. }
  120. .job-other {
  121. color: var(--v-error-base);
  122. height: 22px;
  123. line-height: 22px;
  124. }
  125. }
  126. .company-info {
  127. display: flex;
  128. align-items: center
  129. }
  130. .interview-info {
  131. color: var(--color-333);
  132. font-size: 15px;
  133. }
  134. }
  135. }
  136. .info-name:hover {
  137. color: var(--v-primary-base);
  138. }
  139. </style>