<template>
    <div class="form-wrap">
      <!--渲染不同的模块表单-->
      <div v-for="(item, index) in addComponents">
        <div class="content-box" >
          <div class="title">{{item.title}}</div>
          <el-form
            ref="form"
            :model="form"
            size="medium"
            label-position="left"
            class="form"
          >
            <FormScale :dataSource="item.dataSource" :form="form" />
          </el-form>
        </div>
      </div>
    </div>
</template>

<script>
  // 量表 template
  import FormScale from '@/components/followup/form/index'
  // 量表模块数据模型
  import dataSourceBaseInfo from '../models/stroke/dataSourceBaseInfo'
  import dataSourceMainSickControl from '../models/stroke/dataSourceMainSickControl'
  import dataSourceLifeStyleGuide from '../models/stroke/dataSourceLifeStyleGuide'
  import dataSourceTreatmentSituation from '../models/stroke/dataSourceTreatmentSituation'
  import dataSourceCheckBody from '../models/stroke/dataSourceCheckBody'
  import dataSourceCheckLab from '../models/stroke/dataSourceCheckLab'


  export default {
    components: {
      FormScale,
    },
    data(){
      return {
        addComponents: [
          {name: 'BaseInfo',dataSource: dataSourceBaseInfo(this), title: '一、基本信息'},
          {name: 'DataType',dataSource: dataSourceLifeStyleGuide(this), title: '二、随访期间生活方式'},
          {name: 'DataType',dataSource: dataSourceMainSickControl(this), title: '三、随访期间主要病史及控制情况'},
          {name: 'DataType',dataSource: dataSourceTreatmentSituation(this), title: '四、本次随访期间血管病变的外科手术或介入治疗情况'},
          {name: 'DataType',dataSource: dataSourceCheckBody(this), title: '五、体格检查（高危人群12个月随访必做）'},
          {name: 'DataType',dataSource: dataSourceCheckLab(this), title: '六、实验室检查（高危人群12个月随访必填）'},
        ],
        form: {
          heartType: [],
          medicalUseSituation: []
        },
      }
    },
    mounted(){
      console.log('==mounted=============', this.form)
    }
  }
</script>

<style scoped lang="scss">
.form-wrap{
  .content-box{
    .title{
      line-height: 60px;
      height: 60px;
      font-weight: bold;
      font-size: 18px;
      border-bottom: 1px dashed #ccc;
    }
  }
}
</style>
