<template>
  <div>
    <Modal v-model="showDetailModal" v-drag title="微生物环境检测详情" class="modal-footer-none">
      <div class="maxHeight">
        <table class="tableClass">
          <tbody>
            <tr>
              <th>类型</th>
              <td>{{ type }}</td>
            </tr>
            <tr>
              <th>位置</th>
              <td>{{ obj.location }}</td>
            </tr>
            <tr>
              <th>相对湿度(%)</th>
              <td>{{ obj.humidity }}</td>
            </tr>
            <tr>
              <th>温度(℃)</th>
              <td>{{ obj.temperature }}</td>
            </tr>
            <tr>
              <th>浮游菌(cfu/m³)</th>
              <td>{{ obj.airborneMicrobe }}</td>
            </tr>
            <tr>
              <th>沉降菌(个/皿)</th>
              <td>{{ obj.settlingMicrobe }}</td>
            </tr>
            <tr>
              <th>监测日期</th>
              <td>{{ date.monitorDate }}</td>
            </tr>
            <tr>
              <th>记录人</th>
              <td>{{ obj.recorderName }}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </Modal>
  </div>
</template>
<script>
/**
 * 微生物环境检测详情
 */

export default {
  data() {
    return {
      obj: {},
      showDetailModal: false,
      type: '',
      date: {
        monitorDate: ''
      }
    }
  },
  methods: {
    _open(obj) {
      this.showDetailModal = true
      this.obj = obj
      if (this.obj.type === 0) {
        this.type = '常规'
      } else if (this.obj.type === 1) {
        this.type = '微生物'
      }
      this.date.monitorDate = obj.monitorDate
        ? this.$dateformat(obj.monitorDate, 'yyyy-mm-dd')
        : ''
    }
  }
}
</script>
