<template>
  <div class="app-container">
    <div class="info">
      <div class="title">检测信息</div>
      <el-form ref="form" :model="form" label-width="120px" label-position="left">
        <el-row :gutter="20">
          <el-col :span="11">
            <el-form-item label="仓房名称">
              <el-input v-model="form.houseCode"></el-input>
            </el-form-item>
            <el-form-item label="氧气(%)">
              <el-input v-model="form.oxygenNumber"></el-input>
            </el-form-item>
            <el-form-item label="磷化氢(ppm)">
              <el-input v-model="form.phosphineNumber"></el-input>
            </el-form-item>
            <el-form-item label="检测虫数">
              <el-input v-model="form.number"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11" :offset="2">
            <el-form-item label="检测通道位数">
              <el-input v-model="form.type"></el-input>
            </el-form-item>
            <el-form-item label="二氧化氮(ppm)">
              <el-input v-model="form.carbonDioxideNumber"></el-input>
            </el-form-item>
            <el-form-item label="检测虫种类">
              <el-input v-model="form.kind"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import {getGasItem} from '@/api/grainDetection/gasDetection/index'
export default {
  data () {
    return {
      form: {
        houseCode: '1号仓',
        oxygenNumber: '60',
        phosphineNumber: '30',
        type: '20122200202',
        oxygenNumber: '13',
        kind: '玉米虫',
        number: '3000'
      },
    }
  },
  created () {
    // console.log(this.$route.query, 'query')
  },
  mounted () {
    console.log(this.$route.params.data, 'this.$route.params.data')
    this.form = this.$route.params.data
     if (this.$route.params.data.id) {
      console.log('cunzaiid')
      this.getDetail()
    }
  },
  methods: {
    getDetail () {
      let id = this.$route.params.data.id
      getGasItem(id).then(res => {
        console.log(res, 'getGasItem')
        if (res.code == 200) {

        }
      }).catch(err => {
        console.log(err)
      })
    },
    back() {
      this.$router.push({ name: "GasDetection" })
    }
  }
}
</script>
<style lang='scss' scoped>
.info {
  background-color: #fff;
  border-radius: 15px;
  padding: 10px 15px;
  height: calc(100vh - 110px);
  .title {
    border-left: 4px solid #4a7de6;
    padding-left: 10px;
  }
  .el-form {
    margin-top: 15px;
  }
}
.table {
  border-radius: 0.185185rem;
}
.th {
  height: 1.074074rem;
  line-height: 1.074074rem;
  background-color: #1d9eef;
  text-align: center;
  // border: 1px solid #000;
}
.list-tr {
  height: 1.074074rem;
  line-height: 1.074074rem;
  border: 1px solid #000;
}
td {
  text-align: center;
}
// ::v-deep .el-input__inner {
//   text-align: center;
// }
</style>
