<template>
  <div class="shareReportCustom" v-if="fromData && fromData.length">
    <template v-for="(value, ind) in fromData">
      <template v-if="value.sfaReportCustomCollections">
        <div
          v-for="(item, index) in value.sfaReportCustomCollections"
          :key="item.reportCustomCollectionId">
          <template v-if="item.isShare">
            <template
              v-if="
                item.reportCustomCollectionType == 'sz' || item.reportCustomCollectionType == 'wb'
              ">
              <div class="text">{{ item.reportCustomCollectionName }}</div>
              <div class="content">{{ item.answerValue }}</div>
            </template>
            <template
              v-if="
                item.reportCustomCollectionType == 'duox' || item.reportCustomCollectionType == 'dx'
              ">
              <div class="text">{{ item.reportCustomCollectionName }}</div>
              <div class="content">
                <p v-for="value in item.sfaReportCustomOptions">
                  <template v-if="value.answerValue == 'Y'">{{ value.customOption }}</template>
                </p>
              </div>
            </template>
          </template>
        </div>
      </template>
    </template>
  </div>
</template>
<script>
import zRadio from '@/components/componentZRadio';
import zCheckbox from '@/components/componentZCheckbox';
export default {
  components: { zRadio, zCheckbox },
  props: {
    reportCustomData: {
      type: Array,
      default: () => [],
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    reportCustomData: {
      handler(val) {
        this.postName = localStorage.getItem('postName');
        this.filterFromData(val);
      },
      immediate: true,
      deep: true,
    },
  },
  data() {
    return {
      fromData: null,
      postName: '',
    };
  },
  methods: {
    filterFromData(val) {
      this.fromData = val;
    },
  },
};
</script>
<style lang="scss">
.shareReportCustom {
  .text {
    background: url('../assets/textBack.png') no-repeat;
    width: 100%;
    height: vw(94);
    background-size: cover;
    color: #7d0207;
    font-size: vw(36);
    text-align: center;
    line-height: vw(94);
    // margin-top: vw(152);
    // margin-bottom: vw(45);
    margin: vw(35) 0 vw(20) 0;
    font-weight: bold;
  }

  .content {
    font-size: vw(28);
    font-weight: bold;
    color: #ffff;
    line-height: vw(63);
    white-space: pre-wrap;
  }
}
</style>
