<template>
  <el-dialog width="50%" title="总池体积阈值" :visible.sync="innerVisible" append-to-body>
    <el-form :inline="true" :model="form" class="demo-form-inline" label-width="180px" :label-position="'left'">
      <el-row :gutter="1">
        <el-col :span="12">
          <el-form-item label="井号：">
            <el-input v-model="form.jh" placeholder="井号"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="钻头监测阈值">
            <el-input v-model="form.bitdepth" placeholder="钻头监测阈值"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="均值阈值：">
            <el-input v-model="form.pittotalWarn" placeholder="均值阈值"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="速率阈值：">
            <el-input v-model="form.ranteWarn" placeholder="速率阈值"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预警类别：">
            <el-input v-model="form.warnType" placeholder="预警类别"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
      <el-button type="primary" @click="submit">提 交</el-button>
    </div>
  </el-dialog>
</template>

<script>
import totalPoolWarnValueApi from '@/api/warningThreshold/totalPoolWarnValueApi'
export default {
  name: 'totalPoolWarnForm',
  data() {
    return {
      innerVisible: false,
      form: {}
    }
  },
  created() { },
  mounted() { },
  methods: {
    open(row) {
      this.innerVisible = true
      if (row != '') {
        this.form = row
      }
    },
    submit() {
      totalPoolWarnValueApi.saveOrUpd(this.form).then(res => {
        // console.log('res', res)
        if (res.success) {
          this.$message({
            message: '阈值已更新',
            type: 'success'
          });
        } else {
          this.$message({
            message: '阈值更新失败',
            type: 'warning'
          });
        }
        this.$emit('close')
        this.innerVisible = false
      })
    }
  }
}
</script>

<style>
</style>