<script setup name="empMaterials">
import Accessory from '@/components/accessory/index.vue'

defineProps({
  detailData: {
    type: Object,
    default: () => {}
  },
  basicInfoData: {
    type: Object
  },
  approvalInfoData: {
    type: Object
  },
  baseProjSetYear: {
    type: String,
    default: ''
  }
})
</script>

<template>
  <el-descriptions :column="2" border>
    <el-descriptions-item label="初验意见" :span="2">
      <template v-if="detailData?.baseInitialOpinionFile&&JSON.parse(detailData?.baseInitialOpinionFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseInitialOpinionFile&&JSON.parse(detailData?.baseInitialOpinionFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="(['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)&&basicInfoData?.baseConstructionType?.includes('01'))||!basicInfoData?.baseConstructionType?.includes('01')" label="信息安全等级保护测评报告" :span="2">
      <template v-if="detailData?.baseInforLevelFile&&JSON.parse(detailData?.baseInforLevelFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseInforLevelFile&&JSON.parse(detailData?.baseInforLevelFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" label="商业密码应用评估报告" :span="2">
      <template v-if="detailData?.basePasswAssessFile&&JSON.parse(detailData?.basePasswAssessFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.basePasswAssessFile&&JSON.parse(detailData?.basePasswAssessFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item label="第三方验收测试报告" :span="2">
      <template v-if="detailData?.baseThirdAcceptFile&&JSON.parse(detailData?.baseThirdAcceptFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseThirdAcceptFile&&JSON.parse(detailData?.baseThirdAcceptFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" label="建设核查表" :span="2">
      <template v-if="detailData?.baseCheckFile&&JSON.parse(detailData?.baseCheckFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseCheckFile&&JSON.parse(detailData?.baseCheckFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="approvalInfoData?.releaseYearMoney>=2000&&!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)" label="财务审计报告" :span="2">
      <template v-if="detailData?.baseFinanlAuditFile&&JSON.parse(detailData?.baseFinanlAuditFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseFinanlAuditFile&&JSON.parse(detailData?.baseFinanlAuditFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" label="用户使用报告" :span="2">
      <template v-if="detailData?.baseUserConsFile&&JSON.parse(detailData?.baseUserConsFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseUserConsFile&&JSON.parse(detailData?.baseUserConsFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item label="监理总结报告" :span="2">
      <template v-if="detailData?.baseEstaSummFile&&JSON.parse(detailData?.baseEstaSummFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseEstaSummFile&&JSON.parse(detailData?.baseEstaSummFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" label="项目总结报告" :span="2">
      <template v-if="detailData?.baseSummReportFile&&JSON.parse(detailData?.baseSummReportFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseSummReportFile&&JSON.parse(detailData?.baseSummReportFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="basicInfoData?.baseProjSetProg==='07'" label="终验意见" :span="2">
      <template v-if="detailData?.baseFinalExpertOpinionFile&&JSON.parse(detailData?.baseFinalExpertOpinionFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseFinalExpertOpinionFile&&JSON.parse(detailData?.baseFinalExpertOpinionFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item label="项目延期申请表" :span="2">
      <template v-if="detailData?.baseEngineerPostpoFile&&JSON.parse(detailData?.baseEngineerPostpoFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseEngineerPostpoFile&&JSON.parse(detailData?.baseEngineerPostpoFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item label="变更申请单" :span="2">
      <template v-if="detailData?.baseChangeFormFile&&JSON.parse(detailData?.baseChangeFormFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseChangeFormFile&&JSON.parse(detailData?.baseChangeFormFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item label="变更批复文件" :span="2">
      <template v-if="detailData?.baseChanFile&&JSON.parse(detailData?.baseChanFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseChanFile&&JSON.parse(detailData?.baseChanFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
  </el-descriptions>
</template>
