123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <div class="hot-box">
- <div class="sub-li" v-for="(item, index) in list" :key="index">
- <div v-if="item">
- <!-- 公司信息 -->
- <div class="company-info-top align-center" :class="{'elevation-5': item.active}" @click.stop="jumpToEnterpriseDetail(item.enterprise.id, false)" @mouseenter="item.active = true" @mouseleave="item.active = false">
- <div class="float-left">
- <v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" alt="" width="77" height="77" style="border-radius: 4px;"/>
- </div>
- <div class="company-info cursor-pointer">
- <!-- <h3 v-ellipse-tooltip>{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3> -->
- <h3 :ref="el => { if(el) companyNameRefs[index] = el }">
- {{ formatName(item.enterprise.anotherName || item.enterprise.name) }}
- <v-tooltip v-if="isTextOverflow[index]" activator="parent" location="top">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</v-tooltip>
- </h3>
- <p>
- {{ item?.enterprise.scaleName }}
- <span class="septal-line" v-if="item.enterprise.industryName"></span>
- {{ item?.enterprise.industryName }}
- </p>
- </div>
- </div>
- <div v-if="item?.enterprise?.welfareTagStr" style="padding: 6px 0; border-bottom: 1px solid #EBEBEB">
- <div v-ellipse-tooltip class="px-5 welfareTag ellipsis-tag">{{ item.enterprise.welfareTagStr }}</div>
- </div>
- <!-- 职位列表 -->
- <ul class="company-job-list pt-3">
- <li v-for="(k, i) in item.jobList" :key="i" @mouseenter="k.active = true" @mouseleave="k.active = false" @click="handleClickPosition(k)">
- <v-card :elevation="k.active ? 5 : 0" class="company-job-item cursor-pointer mb-3">
- <div class="mb-2 d-flex">
- <span v-ellipse-tooltip :class="['name', 'cursor-pointer', {'default-active': k.active }]" :style="{'max-width': !k.payFrom && !k.payTo ? '290px' : '200px'}">{{ formatName(k.name) }}</span>
- <span v-if="!k.payFrom && !k.payTo" class="salary">面议</span>
- <span v-else class="salary">{{ k.payFrom ? k.payFrom + '-' : '' }}{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
- </div>
- <div class="d-flex font-size-13" style="height: 24px; overflow: hidden; color: #808080; line-height: 24px;">
- <div class="text-truncate mr-3" style="flex: 1">
- <span v-for="(j, index) in desc" :key="index">
- <span v-if="k[j] || j === 'areaName'" class="mr-1">
- {{ j === 'areaName' ? !k.areaId ? '全国' : k.area?.str : k[j] }}
- </span>
- <span v-if="index !== desc.length - 1 && (k[j] || j === 'areaName') && k[desc[index + 1]]" class="septal-line ml-1"></span>
- </span>
- </div>
- <div style="width: 73px;">{{ timesTampChange(k.updateTime, 'Y-M-D') }}</div>
- </div>
- </v-card>
- </li>
- </ul>
- <div class="moreBtn d-flex align-center justify-center" @click.stop="handleMoreEnterprise(item)">
- <span>{{ $t('position.moreBtn') }}</span>
- <v-icon>mdi-menu-right</v-icon>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup name="hotPromoted">
- import { nextTick, ref, watch } from 'vue'
- import { timesTampChange } from '@/utils/date'
- import { formatName } from '@/utils/getText'
- import { jumpToEnterpriseDetail } from '@/utils/position'
- import { useRouter } from 'vue-router'
- import { spaces } from '@/utils/index.js'
- // import Ellipsis from '@/components/Ellipsis'
- const props = defineProps({
- items: {
- type: Array,
- default: () => []
- }
- })
- const router = useRouter()
- const isTextOverflow = ref({})
- const companyNameRefs = ref({})
- // 检查文本是否溢出
- const checkTextOverflow = () => {
- Object.entries(companyNameRefs.value).forEach(([index, element]) => {
- if (element) {
- isTextOverflow.value[index] = element.scrollWidth > element.clientWidth
- }
- })
- }
- const list = ref([])
- watch(
- () => props.items,
- (newVal) => {
- list.value = newVal
- nextTick(() => {
- checkTextOverflow()
- })
- },
- { immediate: true },
- { deep: true }
- )
- const desc = ['areaName', 'eduName', 'expName']
- // 职位详情
- const handleClickPosition = (k) => {
- router.push(`/recruit/personal/position/details/${k.id}`)
- }
- // 查看更多职位
- const handleMoreEnterprise = (item) => {
- if (!item.enterprise.id) return
- // window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=recruitmentPositions`)
- const name = formatName(item.enterprise.anotherName || item.enterprise.name)
- window.open(`/recruit/personal/position?content=${name.includes('&') ? encodeURIComponent(name) : name}`)
- }
- </script>
- <style lang="scss" scoped>
- .hot-box {
- display: flex;
- flex-wrap: wrap;
- }
- .sub-li {
- position: relative;
- width: calc((100% - 24px) / 3);
- min-width: calc((100% - 24px) / 3);
- max-width: calc((100% - 24px) / 3);
- margin: 0 12px 12px 0;
- height: 370px;
- border-radius: 12px;
- padding: 0;
- overflow: hidden;
- transition: all .2s linear;
- background-color: #fff;
- box-shadow: 0 2px 20px 0 rgba(37, 39, 48, .2);
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
- .ellipsis-tag {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- color: #cec149 !important;
- }
- .company-info {
- float: left;
- margin-left: 16px;
- width: 262px;
- }
- .company-info-top {
- display: flex;
- height: 90px;
- margin: 12px 12px 0 12px;
- padding: 0 12px;
- overflow: hidden;
- border-bottom: 1px solid #EBEBEB;
- border-radius: 8px;
- }
- .welfareTag {
- color: #CEC149;
- font-size: 13px;
- }
- .company-info h3 {
- height: 22px;
- font-size: 18px;
- font-weight: 700;
- color: #404040;
- line-height: 22px;
- margin: 0 0 4px 0;
- padding: 0;
- max-width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- &:hover {
- color: var(--v-primary-base);
- }
- }
- .company-info p {
- height: 18px;
- font-size: 13px;
- font-weight: 400;
- color: var(--color-999);
- line-height: 18px;
- }
- .company-job-list {
- padding: 4px 10px 12px;
- }
- ul li {
- list-style: none
- }
- .company-job-item {
- display: block;
- height: auto;
- padding: 12px 10px;
- margin: 0;
- border-radius: 8px;
- }
- .salary {
- font-size: 16px;
- float: right;
- font-weight: 700;
- color: #CEC149;
- line-height: 22px;
- max-width: none;
- text-align: right;
- flex: 1;
- }
- .name {
- position: relative;
- // max-width: 200px;
- line-height: 22px;
- font-weight: 700;
- color: #404040;
- margin-right: 8px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- transition: all linear .2s;
- }
- .moreBtn {
- position: absolute;
- width: 100%;
- bottom: 0;
- height: 47px;
- color: #fff;
- cursor: pointer;
- font-size: 14px;
- background: linear-gradient(to right, #12ebb0, #427daa);
- &:hover {
- font-size: 16px;
- span {
- font-weight: 700;
- }
- }
- }
- </style>
|