<template>
  <div id="root">
    <el-form ref="monitoringForm" :model="formInfo" label-width="120px" style="margin-top: 20px; width: 500px; margin-left: auto; margin-right: auto;">
      <div style="margin: 20px 15px 10px 15px;">
        <el-form-item label="视频流地址">
          <el-input v-model="formInfo.url" :disabled="false" name="name"/>
        </el-form-item>
        <el-form-item label="地址">
          <el-input v-model="formInfo.address" :disabled="false" name="address"/>
        </el-form-item>
        <el-form-item label="安保人员电话">
          <el-input v-model="formInfo.securityGuardTel" :disabled="false" name="phone"/>
        </el-form-item>
        <el-form-item label="保安室电话">
          <el-input v-model="formInfo.securityRoomTel" :disabled="false" name="phone-2"/>
        </el-form-item>
      </div>
      <el-form-item>
        <el-button type="primary" @click="monitoringSubmit" >提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'MonitoringAdd',
  data() {
    return {
      formInfo: {
        url: '',
        address: '',
        securityGuardTel: '',
        securityRoomTel: ''
      },
      equipment: [] // 监控设备
    }
  },
  methods: {
    monitoringSubmit() { // 监控提交
      console.log('monitoringForm : ', this.formInfo)
      this.$store.dispatch('EquipmentMonitoring', this.formInfo).then((res) => {
        if (res.code === '0') {
          this.$message.success(res.message)
          // 监控
          // this.equipmentGetAll()
          this.$router.go(-1)
        }
      }).catch(() => {
        console.log('EquipmentMonitoring error')
      })
    }
  }
}
</script>

<style scoped>

</style>
