<script name="summarizeInfo" setup>
import { ref, onMounted } from 'vue'
import ApprovalInfo from './approvalInfo.vue'
import ExpertReviewInfo from './expertReviewInfo.vue'
import BiddingRegistration from './biddingRegistration.vue'
import NoData from '@/components/noData/index.vue'
import ContractInfo from './contractInfo.vue'
import InitialInfo from './initialInfo.vue'
import FinalInfo from './finalInfo.vue'
import TrialRunInfo from '@/pages/projectStoreManage/projectStore/projectDetail/components/trialRunInfo.vue'
import ImplementationPlan from '@/pages/projectStoreManage/projectStore/projectDetail/components/implementationPlan.vue'
import ReviewCheckList from '@/pages/projectStoreManage/projectStore/projectDetail/components/reviewCheckList.vue'
import { getIsShowReviewCheck } from '@/utils/getIsShowReviewCheck'

defineProps({
  detailData: Object
})
const activeName = ref('专家评审'),
  tabList = ref([
    '专家评审',
    '批复信息',
    '招标登记',
    '实施计划',
    '建设方案审查意见',
    '合同登记',
    '初验登记',
    '试运行报告',
    '终验信息',
    '项目变更'
  ]),
  setActiveName = (val) => {
    activeName.value = val
  }
defineExpose({ setActiveName })
onMounted(() => {
  if (getIsShowReviewCheck()) {
    tabList.value = [
      '专家评审',
      '批复信息',
      '招标登记',
      '实施计划',
      '建设方案审查意见',
      '合同登记',
      '初验登记',
      '试运行报告',
      '终验信息',
      '项目变更'
    ]
  } else {
    tabList.value = [
      '专家评审',
      '批复信息',
      '招标登记',
      '实施计划',
      '合同登记',
      '初验登记',
      '试运行报告',
      '终验信息',
      '项目变更'
    ]
  }
})
</script>

<template>
  <el-card shadow="never" class="tab-card">
    <template #header>
      <el-tabs v-model="activeName">
        <el-tab-pane
          v-for="(item,index) in tabList"
          :key="index"
          :label="item"
          :name="item"
        />
      </el-tabs>
    </template>
    <expert-review-info v-if="activeName==='专家评审'&&detailData.projectCode" :detail-data="detailData" />
    <approval-info v-else-if="activeName==='批复信息'" :detail-data="detailData" />
    <bidding-registration v-else-if="activeName==='招标登记'" :detail-data="detailData" />
    <implementation-plan v-else-if="activeName==='实施计划'" :detail-data="detailData" />
    <review-check-list v-else-if="activeName==='建设方案审查意见'" :detail-data="detailData" />
    <contract-info v-else-if="activeName==='合同登记'" :detail-data="detailData" />
    <initial-info v-else-if="activeName==='初验登记'" :detail-data="detailData" />
    <trial-run-info v-else-if="activeName==='试运行报告'" :detail-data="detailData" />
    <final-info v-else-if="activeName==='终验信息'" :detail-data="detailData" />
    <no-data v-else />
  </el-card>
</template>
