<template>
  <div>
    <div class="sub-li mb-3" v-for="item in list" :key="item.id" @mouseenter="item.active = true" @mouseleave="item.active = false">
      <div class="company-info-top" @click="handleClickEnterprise(item, 'briefIntroduction')">
        <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 }">{{ item.anotherName }}</h3>
          <p>{{ item.financingName }}<span class="mx-2">|</span>{{ item.industryName }}<span class="mx-2">|</span>{{ item.scaleName }}</p>
        </div>
        <div>
          <v-chip color="primary" size="small" label>已收藏</v-chip>
        </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="mx-1" v-if="i !== item.welfareList.length - 1">|</span>
          </div>
        </div>
        <div class="position" @click="handleClickEnterprise(item, 'recruitmentPositions')">
          查看全部职位
          <v-icon>mdi-menu-right</v-icon>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
defineOptions({ name: 'long-company-card'})
defineProps({
  list: Array
})
const handleClickEnterprise = (item, key) => {
  window.open(`/recruit/personal/company/details/${item.id}?key=${key}`)
}
</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;
  cursor: pointer;
  &:nth-child(4n) {
    margin-right: 0;
  }
  &:hover {
    box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  }
}
.company-info {
  float: left;
  margin-left: 16px;
  width: 282px;
}
.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: var(--color-222);
  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>
