<script setup name='expertDetail'>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { getExpertDetail } from '@/http/apis/expertManage/expertVerify'
import Accessory from '@/components/accessory/index.vue'
const route = useRoute()
const router = useRouter()
const activeName = ref('basicInfo')
const handleClick = (tab, event) => {
  console.log(tab, event)
}
const expertInfo = ref({ basicInfo: {}, eduInfo: {}, jobInfo: {}, professionalInfo: {}, recommendInfo: {}})
const getVerifyDetail = async () => {
  const res = await getExpertDetail({ expertUserId: route.query.id })
  expertInfo.value = res.data
}
// 查看文件
const view = (data) => {
  const routeUrl = router.resolve({
    path: '/fileView',
    query: { id: data }
  })
  window.open(routeUrl.href, '_blank')
}
onMounted(async () => {
  getVerifyDetail()
})
</script>

<template>
  <div class="">
    <el-card class="box-card">
      <el-tabs
        v-model="activeName"
        class="demo-tabs"
        @tab-click="handleClick"
      >
        <el-tab-pane
          label="基本信息"
          name="basicInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="专家名称"
              span="1"
              width="200px"
            >
              {{ expertInfo.basicInfo.name }}
            </el-descriptions-item>
            <el-descriptions-item label="是否在浙政钉组织">
              {{ expertInfo.basicInfo.isDingUser?'是':'否' }}
            </el-descriptions-item>
            <el-descriptions-item
              label="手机号码"
              width="200px"
            >
              {{ expertInfo.basicInfo.phoneNo }}
            </el-descriptions-item>
            <el-descriptions-item label="性别">
              {{ expertInfo.basicInfo.gender === '1' ? '男': '女' }}
            </el-descriptions-item>
            <el-descriptions-item label="籍贯">
              {{ expertInfo.basicInfo.hometown ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="民族">
              {{ expertInfo.basicInfo.nationality ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="政治面貌">
              {{ expertInfo.basicInfo.political?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="身份证号">
              {{ expertInfo.basicInfo.idCard||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="办公电话">
              {{ expertInfo.basicInfo.officePhone||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="出生年月">
              {{ expertInfo.basicInfo.birth ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="银行卡号">
              {{ expertInfo.basicInfo.bankNo||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="开户银行">
              {{ expertInfo.basicInfo.bank||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="电子邮箱">
              {{ expertInfo.basicInfo.email||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="专家级别">
              {{ expertInfo.basicInfo?.expertRegionInfo?.regionName.split('@@').map(i=>i.split('##')[1]).join('-') }}
            </el-descriptions-item>
            <el-descriptions-item label="专家来源">
              {{ expertInfo.basicInfo.expertSource?.[0].tagName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="专家类型">
              {{ expertInfo.basicInfo.expertType?.[0].dictionaryName||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="履职意向">
              {{ expertInfo.basicInfo.expertIntentionWorkRegions?.map(i=>i.regionName.split('@@').map(j=>j.split('##')[1]).join('-')).join(';') }}
            </el-descriptions-item>
            <el-descriptions-item
              label="头像（免冠照）"
              span="2"
            >
              <a target="_blank" @click="view(expertInfo.basicInfo.avatarFile.fileId)">{{ expertInfo.basicInfo.avatarFile?.fileName }}</a>

            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane
          label="学历信息"
          name="eduInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="毕业院校"
              span="2"
              width="200px"
            >
              {{ expertInfo.eduInfo.school||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="毕业时间">
              {{ expertInfo.eduInfo.graduatedAt||'-' }}
            </el-descriptions-item>
            <el-descriptions-item
              label="所学专业"
              width="200px"
            >
              {{ expertInfo.eduInfo.academicTitle ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="学位">
              {{ expertInfo.eduInfo.degree?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="学历">
              {{ expertInfo.eduInfo.edu?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="毕业证书">
              <p v-for="(file,fileIndex) in expertInfo.eduInfo.graduationCertificateFile" :key="fileIndex" class="mb-4">
                <accessory :file-name="file.fileName" :file-id="file.fileId" />
              </p>
            </el-descriptions-item>
            <el-descriptions-item label="学位证书">
              <p v-for="(file,fileIndex) in expertInfo.eduInfo.degreeCertificateFile" :key="fileIndex" class="mb-4">
                <accessory :file-name="file.fileName" :file-id="file.fileId" />
              </p>
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane
          label="职业信息"
          name="professionInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="工作单位"
              width="200px"
            >
              {{ expertInfo.jobInfo.company||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="工作单位code">
              {{ expertInfo.jobInfo.companyUniqCode ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item
              label="单位法人编号"
              width="200px"
            >
              {{ expertInfo.jobInfo.legalEntityCode||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="行政职务">
              {{ expertInfo.jobInfo.administrativeDuties ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="开始工作日期">
              {{ expertInfo.jobInfo.startWorkAt ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="行政职级">
              {{ expertInfo.jobInfo.administrativeRank?.[0].dictionaryName||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="在职状态">
              {{ expertInfo.jobInfo.jobStatus?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="退休日期">
              {{ expertInfo.jobInfo.retiredAt||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="单位类型">
              {{ expertInfo.jobInfo.companyAttribute?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="条线">
              {{ expertInfo.jobInfo?.businessStrips?.map(i=>i.businessStripName).join('、')||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="工作地址">
              {{ expertInfo.jobInfo.address||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="工作经历">
              {{ expertInfo.jobInfo.experience||'-' }}
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane
          label="专业信息"
          name="majorInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="技术职称"
              width="200px"
            >
              {{ expertInfo.professionalInfo.technicalTitles||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="职称级别">
              {{ expertInfo.professionalInfo.titleLevel?.[0].dictionaryName ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item
              label="擅长方向"
              width="200px"
            >
              {{ expertInfo.professionalInfo.goodAt?.map(i=>i.tagName).join('、') ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="技术专长">
              <span v-for="(item,index) in expertInfo.professionalInfo.technicalExpertise" :key="index">{{ item.tagName }}&nbsp;&nbsp;</span>
            </el-descriptions-item>
            <el-descriptions-item label="行业领域">
              <span v-for="(item,index) in expertInfo.professionalInfo.industrySector" :key="index">{{ item.tagName }}&nbsp;&nbsp;</span>
            </el-descriptions-item>
            <el-descriptions-item label="获奖情况">
              {{ expertInfo.professionalInfo.awards||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="表彰奖励">
              {{ expertInfo.professionalInfo.recognitionReward ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item label="回避单位">
              <span v-for="(item, index) in expertInfo.professionalInfo.avoidCompanyList" :key="index">{{ item.companyName }}&nbsp;&nbsp;</span>
            </el-descriptions-item>
            <el-descriptions-item label="职称证明">
              <p v-for="(file,fileIndex) in expertInfo.professionalInfo.titleCertificateFile" :key="fileIndex" class="mb-4">
                <accessory :file-name="file.fileName" :file-id="file.fileId" />
              </p>
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane
          label="推荐信息"
          name="recommendInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="推荐类型"
              width="200px"
            >
              {{ expertInfo.recommendInfo.recommendedWay?.[0].dictionaryName||'-' }}
            </el-descriptions-item>
            <el-descriptions-item
              width="200px"
              label="推荐证明"
            >
              <p v-for="(file,fileIndex) in expertInfo.recommendInfo.recommendationProofFile" :key="fileIndex" class="mb-4">
                <accessory :file-name="file.fileName" :file-id="file.fileId" />
              </p>
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane
          label="其他信息"
          name="otherInfo"
        >
          <el-descriptions
            class="mt-20"
            title=""
            :column="2"
            border
          >
            <el-descriptions-item
              label="其他标签"
              width="200px"
            >
              {{ expertInfo.expertOtherInfo?.other?.map(i=>i.tagName)?.join('、') ||'-' }}
            </el-descriptions-item>
            <el-descriptions-item
              width="200px"
              label="备注"
            >
              {{ expertInfo.expertOtherInfo?.remark ||'-' }}
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<style lang='less' scoped> </style>
