<template>
  <div>
    <el-row>
      <el-col>
<!--        如果满足一下-->
<!--        <el-select size="mini">-->
<!--          <el-option value="0">全部</el-option>-->
<!--          <el-option value="1">任意</el-option>-->
<!--        </el-select>-->
<!--        条件，信效度设定为：-->
<!--        <el-select size="mini">-->
<!--          <el-option value="0">无效</el-option>-->
<!--          <el-option value="1">有效</el-option>-->
<!--        </el-select>-->
      </el-col>
    </el-row>
    <div v-for="(it,index) in item">
      <condition-setting-item
          @add="addFactor" @del="delFactor" :key="it.uid" :index="index"
          :data='it' :data-source="factorListAll"
          :last-btn-index="item.length" :buts="['isAdd','isDel']"/>
    </div>
  </div>
</template>

<script>
import ConditionSettingItem from './condition-setting-item'

export default {
  name: 'condition-setting',
  components: { ConditionSettingItem },
  data () {
    return {

      item: [{}],
      factorListAll: [
        { name: '因子1', value: '$1' },
        { name: '因子2', value: '$2' },
        { name: '因子3', value: '$3' },
        { name: '因子4', value: '$4' },
        { name: '因子5', value: '$5' },
      ],
    }
  },
  created () {
    this.getFactor()
  },
  methods: {
    // 获取因子列表
    getFactor () {

    },
    addFactor (obj) {
      this.item.push(obj)
    },
    delFactor (obj, index) {
      this.item.splice(index, 1)
    },
  }
}
</script>

<style scoped>

</style>
