<template>
  <div class="symp-wrap">
    <div class="choose">
      <ul class="addPart">
        <li v-for="(item,idx) in dataTrd">
          <p class="question">{{idx+1 + '. ' +item.name}}</p>
          <ComTextArea
            v-if="item.controlType == 6"
            @changeAreaVal="changeAreaVal($event,idx)"
          ></ComTextArea>
          <template
            v-if="item.controlType == 3"
            v-for="(part,index) in item.questionDetailList"
          >
            <MultiLineInput
              v-if="item.controlType == 3"
              @changeMultipVal="changeMultipVal($event,idx)"
              :msg="part.name"
            ></MultiLineInput>
          </template>
        </li>
      </ul>
      <div class="thanks">
        <p>感谢您的回答，您的病历已经自动生成。</p>
        <p>您可以点击预览病历回顾病情；或者点击顶部修改病历采集信息。</p>
        <p>如果没有需要修改的内容，请点击提交，医生便能看到您的病历。</p>
      </div>
    </div>
    <div class="foot">
      <span class="back" @click="back">{{'返回'+ preName}}</span>
      <span class="next" @click="next">预览</span>
    </div>
  </div>
</template>
<script type="text/javascript">
import ComTextArea from '../common/ComTextArea.vue';
import MultiLineInput from '../common/MultiLineInput.vue';

export default {
  name: 'AddContent',
  props: ['allMoudles','preName'],
  data() {
    return {
      dataTrd: [],
      val: ''
    }
  },
  mounted() {
    this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
  },
  methods: {
    back() {
      this.$emit("back");
    },
    changeAreaVal(value, idx) {
      // console.log(value,idx)
      this.val = value
    },
    changeMultipVal(value, idx) {
      console.log(value, idx)
    },
    next(){
      this.$emit('next','preview')
    }
  },
  components: {
    ComTextArea,
    MultiLineInput,
  }
}
</script>
<style lang="less" scoped>
@import "../less/base.less";
.symp-wrap {
  font-size: 0.3rem;
  h3 {
    color: #000;
    margin-bottom: 0.36rem;
  }
}
.choose {
  padding-bottom: 0.2rem;
  .addPart {
    li {
      margin-bottom: 0.5rem /* 50/100 */;
    }
    .question {
      margin-bottom: 0.3rem /* 30/100 */;
      font-weight: bold;
    }
  }
}
  .foot{
    .dbfooter;
  }
.thanks {
  font-size: .28rem /* 28/100 */;
  color: #666666;
  letter-spacing: 0;
  text-align: justify;
  line-height: .48rem /* 48/100 */;
}
</style>