<template>
  <div>
    <xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增政策' : '编辑政策'" :form="form" :rules="rules">
      <template v-slot:name>
        <div class="xy-table-item">
          <div class="xy-table-item-label">
            <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>名称：
          </div>
          <div class="xy-table-item-content">
            <el-input v-model="form.name" placeholder="请输入名称" clearable style="width: 300px;"></el-input>
          </div>
        </div>
      </template>
      <template v-slot:items>
        <div class="xy-table-item">
          <div class="xy-table-item-label">
            <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>政策：
          </div>
          <div class="xy-table-item-content">
            <el-form-item v-for="(item,index) in form.items">
              <div>{{'政策'+index}}</div>
            </el-form-item>
          </div>
        </div>
      </template>
    </xy-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id:'',
      isShow:false,
      type:'',

      form:{
        name:'',
        items:[]
      },
      rules:{

      }
    }
  },
  methods: {

  },
  watch:{
    isShow(newVal){
      if(newVal){

      }else{
        this.id = ''
        this.type = ''
        this.$refs['dialog'].reset()
      }
    }
  }
}
</script>

<style scoped lang="scss">
</style>
