123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <div>
- <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">
- <div class="company-info-top">
- <div class="company-info">
- <div class="float-left mr-5">
- <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;"/>
- </div>
- <h3 :class="{'default-active': item.active }" class="cursor-pointer" @click.stop="jumpToEnterpriseDetail(item.id, true)">
- {{ formatName(item.anotherName || item.name) }}
- </h3>
- <p>{{ item.industryName }}<span v-if="item.industryName && item.scaleName" class="mx-2">|</span>{{ item.scaleName }}</p>
- </div>
- <div v-if="item.active">
- <v-btn class="half-button ml-3" color="primary" size="small" @click.stop="handleCancel(item)">取消收藏</v-btn>
- </div>
- </div>
- <div class="company-info-bottom">
- <div class="chipBox">
- <div class="d-inline-block" v-for="(val, i) in item.welfareList" :key="i">
- <span>{{ val }}</span>
- <span class="septal-line" v-if="i !== item.welfareList.length - 1 && val && item.welfareList[i + 1]"></span>
- </div>
- </div>
- <div class="position" @click.stop="jumpToEnterpriseDetail(item.id, true, 1)">
- 查看全部职位
- <v-icon>mdi-menu-right</v-icon>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- defineOptions({ name: 'long-company-card'})
- import Snackbar from '@/plugins/snackbar'
- import { useI18n } from '@/hooks/web/useI18n'
- import { formatName } from '@/utils/getText'
- import { getEnterpriseUnsubscribe } from '@/api/enterprise'
- import { jumpToEnterpriseDetail } from '@/utils/position'
- const emits = defineEmits(['refresh'])
- defineProps({
- list: Array
- })
- const { t } = useI18n()
- // 取消收藏
- const handleCancel = async (item) => {
- if (!item.id) return Snackbar.warning(t('sys.api.operationFailed'))
- await getEnterpriseUnsubscribe(item.id)
- emits('refresh')
- Snackbar.success(t('common.operationSuccessful'))
- }
- </script>
- <style scoped lang="scss">
- .sub-li {
- position: relative;
- height: 130px;
- border-radius: 12px;
- padding: 0;
- overflow: hidden;
- transition: all .2s linear;
- background-color: #fff;
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
- .company-info {
- width: 100%;
- }
- .company-info-top {
- display: flex;
- height: 76px;
- padding: 16px 20px;
- overflow: hidden;
- justify-content: space-between;
- }
- .company-info h3 {
- height: 22px;
- font-size: 16px;
- font-weight: 400;
- color: #0E100F;
- line-height: 22px;
- margin: 0 0 4px 0;
- padding: 0;
- max-width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .company-info p {
- height: 18px;
- font-size: 13px;
- font-weight: 400;
- color: var(--color-999);
- line-height: 18px;
- }
- .company-info-bottom {
- display: flex;
- width: 100%;
- padding: 16px 20px;
- justify-content: space-between;
- background-color: #f8fcfb;
- .chipBox {
- width: 70%;
- min-width: 70%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 13px;
- color: var(--color-999);
- }
- .position {
- color: var(--color-666);
- font-size: 14px;
- cursor: pointer;
- &:hover {
- color: var(--v-primary-base);
- }
- }
- }
- </style>
|