liuxiaolong
2019-05-06 8700cf1dc46c350371d865532c2914595187788e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<template>
  <b-modal
    ref="modalRef"
    hide-footer
    title="设备信息"
    :size="deviceInfo&&(deviceInfo.deviceType==='4'||deviceInfo.deviceType==='5')?'lg':''"
  >
    <div class="row">
      <div :class="deviceInfo&&(deviceInfo.deviceType==='4'||deviceInfo.deviceType==='5')?'col-6':'col-12'">
        <b-form-group
          horizontal
          :label-cols="4"
          label="设备状态:"
        >
          <div class="pt-2">
            正常
          </div>
        </b-form-group>
        <b-form-group
          horizontal
          :label-cols="4"
          label="设备种类:"
        >
          <div class="pt-2">
            {{deviceInfo&&deviceInfo.deviceLable}}
          </div>
        </b-form-group>
        <b-form-group
          horizontal
          :label-cols="4"
          label="IP地址:"
        >
          <div class="pt-2">
            {{deviceInfo&&deviceInfo.ip}}
          </div>
        </b-form-group>
        <b-form-group
          horizontal
          :label-cols="4"
          label="相关描述:"
        >
          <div class="pt-2">
            {{deviceInfo&&deviceInfo.description}}
          </div>
        </b-form-group>
      </div>
      <div class="col-6">
        <div v-if="deviceInfo&&deviceInfo.deviceType==='4'">
           <h4>温度:</h4>
          <h2 class="text-danger f40">{{deviceInfo&&deviceInfo.temperatureNum}}</h2>
        </div>
        <div v-if="deviceInfo&&deviceInfo.deviceType==='5'">
          <h4>湿度:</h4>
          <h2 class="text-primary f40">{{deviceInfo&&deviceInfo.humidityNum}}</h2>
        </div>
      </div>
    </div>
  </b-modal>
</template>
 
<script>
export default {
  props: {
    deviceInfo: {
      default: null,
      type: Object
    }
  },
  methods: {
    showModal () {
      this.$refs.modalRef.show()
    },
    hideModal () {
      this.$refs.modalRef.hide()
    }
  }
}
</script>