<template>
  <div class="app-container">
    <div class="info">
      <div>
        <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.tempValue"></el-input>
              </el-form-item>
              <el-form-item label="风速">
                <el-input v-model="form.windSpeed"></el-input>
              </el-form-item>
              <el-form-item label="降雨量">
                <el-input v-model="form.rainsValue"></el-input>
              </el-form-item>
              <el-form-item label="有无雨雪">
                <el-input v-model="form.ywyx"></el-input>
              </el-form-item>
              <el-form-item label="PM2.5">
                <el-input v-model="form.PM2"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="11" :offset="2">
              <el-form-item label="湿度">
                <el-input v-model="form.wetValue"></el-input>
              </el-form-item>
              <el-form-item label="风向">
                <el-input v-model="form.windDirection"></el-input>
              </el-form-item>
              <el-form-item label="气压">
                <el-input v-model="form.pressureValue"></el-input>
              </el-form-item>
              <el-form-item label="辐射强度">
                <el-input v-model="form.fsqd"></el-input>
              </el-form-item>
              <el-form-item label="检测时间">
                <el-input v-model="form.collectorTime"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <el-footer style="height: 41px;">
        <el-button type="primary" class="footerBtn" @click="back">返 回</el-button>
      </el-footer>
    </div>
  </div>
</template>

<script>
import { getMeteorologicalItem } from '@/api/grainDetection/weatherStationData/index'
export default {
  data () {
    return {
      form: {
        tempValue: '26',
        windSpeed: '5',
        rainsValue: '60',
        wetValue: '22',
        windDirection: '西北',
        pressureValue: '40',
        collectorTime: '2022-10-12',

        // 接口缺少字段 ， 待定
        ywyx: '无',
        PM2: '20',
        fsqd: '4级',
      },
    }
  },
  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
      getMeteorologicalItem(id).then(res => {
        console.log(res, 'getMeteorologicalItem')
        if (res.code == 200) {

        }
      }).catch(err => {
        console.log(err)
      })
    },
    back () {
      this.$router.push({ name: "WeatherStationData" })
    }
  }

}
</script>
<style lang='scss' scoped>
.info {
  background-color: #fff;
  border-radius: 15px;
  padding: 10px 15px;
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .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;
// }
.el-footer {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%;
  color: #888;
  font-weight: 500;
  font-family: Source Han Sans CN;
  font-size: 14px;
  text-align: center;
  z-index: 2;
  .footerBtn {
    width: 300px;
    border-radius: 20px;
  }
}
</style>
