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

defineProps({
  moduleNum: Number,
  data: Object,
  isDownLoadFile: {
    type: Boolean,
    default: true
  }
})
</script>
<template>
  <el-descriptions :column="2" border>
    <el-descriptions-item v-for="(eachModule ,num) in data?.formList" :key="num" :label="eachModule.name">
      <p v-if="eachModule.props.type ==='单选' || eachModule.props.type ==='输入' || eachModule.props.type ==='数值输入'" class="mb-4">
        <span>{{ eachModule.value }}</span>
      </p>
      <p v-if="eachModule.props.type ==='多选'" class="mb-4">
        <span>{{ eachModule.value.join('，') }}</span>
      </p>
      <p v-if="eachModule.props.type ==='文件上传'" class="mb-4">
        <accessory
          v-for="(single , order) in eachModule.value"
          :key="order"
          :file-name="single.originalFileName"
          :file-id="single.id"
          :is-down-load="isDownLoadFile"
        />
      </p>
    </el-descriptions-item>
  </el-descriptions>
</template>
