<script name="filesInfo" setup>
import Accessory from '@/components/accessory/index.vue'
defineProps({
  detailData: Object,
  isDownLoadFile: {
    type: Boolean,
    default: true
  }
})
</script>

<template>
  <el-descriptions :column="2" border>
    <el-descriptions-item label="初步方案">
      <p v-for="(item,index) in detailData.preliminaryPlanFile&&JSON.parse(detailData.preliminaryPlanFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="false" label="佐证材料">
      <p v-for="(item,index) in detailData.supportingMaterialsFile&&JSON.parse(detailData.supportingMaterialsFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="false" label="项目总投资测算明细">
      <p v-for="(item,index) in detailData.calculationTotalInvestmentFile&&JSON.parse(detailData.calculationTotalInvestmentFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="false" label="申报单位主要职责（单位三定方案）">
      <p v-for="(item,index) in detailData.mainResponsibilitiesApplicantFile&&JSON.parse(detailData.mainResponsibilitiesApplicantFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="detailData?.projectType!=='03'&&false" label="项目申报书">
      <p v-for="(item,index) in detailData.projectApplicationForm&&JSON.parse(detailData.projectApplicationForm)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="detailData?.projectType!=='03'" label="可行性研究报告">
      <p v-for="(item,index) in detailData.baseResearchReportFile&&JSON.parse(detailData.baseResearchReportFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="detailData.constructionPlanFile&&JSON.parse(detailData.constructionPlanFile)?.length" label="建设方案">
      <p v-for="(item,index) in detailData.constructionPlanFile&&JSON.parse(detailData.constructionPlanFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item label="其他附件">
      <p v-for="(item,index) in detailData.baseProjOtherFile&&JSON.parse(detailData.baseProjOtherFile)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
    <el-descriptions-item v-if="detailData.declareAmount>=1000" label="申报单位主要职责文件（单位三定职责）">
      <p v-for="(item,index) in detailData.mainAccusationDoc&&JSON.parse(detailData.mainAccusationDoc)" :key="index" class="mb-4">
        <accessory :file-name="item.originalFileName" :file-id="item.id" :is-down-load="isDownLoadFile" />
      </p>
    </el-descriptions-item>
  </el-descriptions>
</template>
