<template>
  <BasicModal v-bind="$attrs" @register="registerModal" width="75%" title="评审信息" @ok="handleSubmit" destroyOnClose>
    <Border title="评审材料" v-model="isreview">
      <!-- 默认是可以编辑，disabled:true，代表该表单不能编辑 -->
      <!-- 风险管控效果评估 修复效果评估 风险管控与修复效果评估 都是S6,需要额外的参数判断-->
      <InvestigateMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S2'" />
      <FxpgMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S3'" />
      <FxgkMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S4'" />
      <GkpgMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S6' && type === 'gkpg'" />
      <RepairMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S5'" />
      <XfpgMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S6' && type === 'xfpg'" />
      <GkxfMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S10'" />
      <GkxfpgMaterialUpload class="w-[98%] mx-auto" :data="data" :disabled="true" v-if="isreview && data?.scjdbm === 'S6' && type === 'gkxfpg'" />
    </Border>
    <!-- 专家组意见 -->
    <Border title="专家组意见" v-model="isexpert">
      <ViewZjz class="w-[98%] mx-auto" :data="data?.zjz || []" :dcjdPsfs="data?.dcjdPsfs" v-show="isexpert" />
    </Border>
    <!-- 参会人员信息 -->
    <Border title="参会人员信息" v-model="isparticipant">
      <ViewChry class="w-[98%] mx-auto" :data="data?.chry || []" :dcjdPsfs="data?.dcjdPsfs" v-show="isparticipant" />
    </Border>
    <!-- 归档材料信息 -->
    <!-- <Border title="归档材料信息" v-model="ismaterial"> -->
    <!-- <ViewGdcl class="w-[98%] mx-auto" :data="data?.gdcl || []" v-show="ismaterial" /> -->
    <!-- </Border> -->
  </BasicModal>
</template>

<script lang="ts" name="HistoryInfoModal" setup>
  import { ref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import Border from '/@/components/customComponent/Border.vue'; // 公共组件
  import ViewZjz from '/@/views/dkgl/investigate/components/ViewZjz.vue'; // 公共组件
  import ViewChry from '/@/views/dkgl/investigate/components/ViewChry.vue'; // 公共组件
  import ViewGdcl from '/@/components/customComponent/ViewGdcl.vue'; // 公共组件
  import InvestigateMaterialUpload from '/@/views/dkgl/investigate/components/MaterialUpload.vue'; // 地块调查
  import FxpgMaterialUpload from '/@/views/dkgl/fxpg/components/MaterialUpload.vue'; // 风险评估
  import FxgkMaterialUpload from '/@/views/dkgl/fxgk/components/MaterialUpload.vue'; // 风险管控
  import GkpgMaterialUpload from '/@/views/dkgl/gkpg/components/MaterialUpload.vue'; // 风险管控效果评估
  import RepairMaterialUpload from '/@/views/dkgl/repair/components/MaterialUpload.vue'; // 修复
  import XfpgMaterialUpload from '/@/views/dkgl/xfpg/components/MaterialUpload.vue'; // 修复效果评估
  import GkxfMaterialUpload from '/@/views/dkgl/gkxf/components/MaterialUpload.vue'; // 风险管控与修复
  import GkxfpgMaterialUpload from '/@/views/dkgl/gkxfpg/components/MaterialUpload.vue'; // 风险管控与修复效果评估

  const data = ref({});
  const type = ref('');
  // 评审信息
  const isreview = ref(true);
  const isexpert = ref(true);
  const isparticipant = ref(true);
  const ismaterial = ref(true);
  const [registerModal, { closeModal }] = useModalInner(async (d) => {
    data.value = d.record;
    type.value = d.type;
  });
  async function handleSubmit() {
    //关闭弹窗
    closeModal();
  }
</script>
