<template>
  <div class="add-div" style="width: 100%;height: 100%;padding: 50px;">
    <el-row :gutter="20">
      <span>新增设备</span>
      <el-input placeholder="请输入设备名称" style="width: 300px;margin-left: 20px;"></el-input>
      <el-input placeholder="请输入设备阈值" style="width: 300px;margin-left: 50px;"></el-input>
    </el-row>
    <el-button type="primary" class="el-icon-plus clolos1" @click="addPdfFile" style="margin-top: 20px;margin-bottom: 20px;">新增关联设备</el-button>
    <div class="add_pdf" v-for="(item, index) in addPdf" :key="index" style="margin-bottom: 30px;">
      
      <el-form ref="form" :model="form" label-width="80px">
        <el-row :gutter="20">
          <el-col :span="11" style="float: left;box-shadow: rgb(233, 229, 229) 3px 3px 7px 2px;padding-top: 20px;padding-left: 15px;">
            <el-form-item label="关联管道:" prop="pipeCode">
              <el-input v-model="form.sss" placeholder="请输入关联管道名称" style="width: 40%;margin-left: 20px;"></el-input>
              <el-input v-model="form.aaa" placeholder="请输入关联管道阈值" style="width: 40%;margin-left: 50px;"></el-input>
            </el-form-item>
            <el-form-item label="关联设备:" prop="pipeCode">
              <el-input placeholder="请输入关联设备名称" style="width: 40%;margin-left: 20px;"></el-input>
              <el-input placeholder="请输入关联设备阈值" style="width: 40%;margin-left: 50px;"></el-input>
            </el-form-item>
          </el-col>
          <div style="float: left;margin-top: 50px;margin-left: 50px;">
            <el-button type="danger" class="el-icon-delete clolos clolos3" @click="deletePdf(index)" circle></el-button>
          </div>
        </el-row>
      </el-form>
      <!-- <div v-show="index !== 0"> -->
    </div>
    <el-form label-width="100px">
      <el-form-item style="margin-left:200px;margin-top:40px;">
        <el-button type="primary" @click="submitForm()">提交</el-button>
        <el-button @click="close()">返回</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        addPdf: [1],
        form: {}
      };
    },
    methods:{
      addPdfFile(){
        this.addPdf.push([]);
      },
      deletePdf(index){
        this.addPdf.splice(index,1);
      }
    }
  }
</script>

<style lang='scss' scoped>

</style>
