<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 == '1'">
            <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/textBack1.png') no-repeat;
    width: 100%;
    min-height: vw(94);
    background-size: cover;
    color: #7d0207;
    font-size: vw(36);
    text-align: center;
    line-height: vw(50);
    margin: vw(35) 0 vw(20) 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: vw(18) 0;
  }

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