<template>
  <div></div>
  <div class="position-content">
    <div class="position-content__list">
      <div v-for="item in positionList" :key="item" class="position-content__item enterprise">
        <div class="enterprise-tp" @click="toPositionDetail(item.JobName)">
          <div class="flx-justify-between">
            <div class="item-lf nowrap-ellipsis" :title="item.JobName">
              {{ item.JobName }}
            </div>
            <div class="item-rg">{{ item.FMINIMUMWAGE }}-{{ item.FMAXIMUMSALARY }}</div>
          </div>
          <div class="position-content__item-ft">
            <span class="nowrap-ellipsis">{{
              `${item.FWORKPLACE.split('/')[0]} ${item.FWORKPLACE.split('/')[1]} ${
                item.FWORKPLACE.split('/')[2]
              }`
            }}</span>
            <span>{{ item.FEXPERIENCE }}</span>
            <span>{{ item.FEDUCATIONALBACKGROUND }}</span>
          </div>
        </div>
        <div class="enterprise-bt flx-justify-between">
          <div class="flx-align-center">
            <img :src="baseURL + '/' + item.FLOGO" width="24" height="24" />
            <span style="margin-left: 8px">{{ item.FirmName }}</span>
          </div>
          <div>
            <span>{{ item.FINDUSTRY }}</span>
            <el-divider direction="vertical" />
            <span>{{ item.FFINANCINGS }}</span>
          </div>
        </div>
      </div>
      <div class="position-content__item">eqwe</div>
    </div>
    <div class="position-content__detail">
      <div class="position-content__detail__tp">
        <div>
          <div class="flx-align-center">
            <span class="position-title">高级声学工程师</span>
            <span style="font-size: 24px; color: #ff3333">16-30k</span>
          </div>
          <div class="flx-align-center" style="margin-top: 6px; font-size: 14px">
            <div class="flx-align-center" style="margin-right: 12px">
              <img src="@/assets/img/icon-map1.png" />
              <span>{{ '深圳' }}</span>
            </div>
            <div class="flx-align-center" style="margin-right: 12px">
              <img src="@/assets/img/icon-resume8.png" />
              <span>{{ '10年以上经验' }}</span>
            </div>
            <div class="flx-align-center">
              <img src="@/assets/img/icon-resume.png" />
              <span>{{ '本科' }}</span>
            </div>
          </div>
        </div>
        <span class="resume-btn">投递简历</span>
      </div>
      <span class="desc-title" style="margin-bottom: 16px">职位描述</span>
      <div class="flx-align-center" style="margin-bottom: 18px">
        <span class="keyWords">带团队</span>
        <span class="keyWords">带团队</span>
        <span class="keyWords">带团队</span>
      </div>
      <pre>
1.负责新销售团队的搭建、管理和组织，制定销售目标和销售策略，确保团队实现业绩目标，6.主持新员工的货代行业业务培训，确保团队成员对货运行业有深入的理解和认识。</pre
      >
      <el-divider />
      <span class="desc-title" style="margin-bottom: 16px">工作地址</span>
      <div class="map-info">
        <div class="map-addr">
          <el-icon color="#177CFA" style="margin-right: 4px"><i-ep-LocationFilled /></el-icon>
          奋成智谷大厦
        </div>
        <qqMap ref="mapRef" />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { baseURL } from '@/services'
import qqMap from '@/components/qqMap.vue'

defineProps({
  positionList: {
    type: Array,
    default: () => []
  } as any
})

const router = useRouter()
const mapRef: any = ref()

const toPositionDetail = (FID: number) => {
  router.push({ path: '/recruitmentManagement/positionDetail', query: { FID } })
}

const init = async () => {
  setTimeout(() => {
    mapRef.value.initMap('广东省深圳市宝安区奋成智谷大厦A座')
  }, 300)
}

defineExpose({
  init
})
</script>

<style lang="scss" scoped>
.position-content {
  display: flex;
  width: 100%;
  .position-content__list {
    width: 428px;
    display: flex;
    flex-direction: column;
    margin-right: 16px;
    .position-content__item {
      width: 100%;
      margin-bottom: 16px;
      box-sizing: border-box;
      background: #ffffff;
      border-radius: 12px;
      padding: 26px 20px;
      cursor: pointer;

      .item-lf {
        width: 183px;
        // height: 14px;
        font-size: 16px;
        font-weight: 400;
        color: #222222;
        // line-height: 14px;
        text-align: left;
      }
      .item-rg {
        font-size: 18px;
        font-weight: 400;
        color: #ff3333;
      }
      .position-content__item-ft {
        margin-top: 16px;
        display: flex;
        span:first-child {
          width: 40%;
        }
        span {
          display: inline-block;
          padding: 6px 12px;
          background: #f8f8f8;
          border-radius: 4px;
          line-height: 24px;
          font-size: 14px;
          font-weight: 400;
          color: #666666;
          margin-right: 8px;
        }
      }
    }
  }
  .position-content__detail {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 20px;
    .position-content__detail__tp {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
      .position-title {
        font-size: 30px;
        font-weight: 500;
        color: #222222;
        margin-right: 34px;
      }
      .resume-btn {
        display: block;
        width: 120px;
        height: 43px;
        line-height: 43px;
        background: #177cfa;
        border-radius: 6px;
        font-size: 18px;
        font-weight: 500;
        color: #ffffff;
        text-align: center;
        cursor: pointer;
      }
    }
  }
}

.desc-title {
  display: inline-block;
  font-size: 18px;
  color: #000000;
  margin-bottom: 24px;
}

pre {
  white-space: pre-wrap;
}
</style>
