Xxxu
2020-07-03 1ac6ef52a03f25f9def9f6a2594d2a8196aa77f6
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<template>
  <div class="streetlight-info" :style="{ 'height': documentClientHeight + 'px' }">
    <div class="title-text">智能路灯信息</div>
    <div style="padding: 20px">
      <el-row>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">ID</el-col>
          <el-col :span="18" class="tip">{{dataForm.streetlightId}}</el-col>
        </el-col>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">亮度</el-col>
          <el-col :span="18" class="tip">{{dataForm.light}}</el-col>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">名称</el-col>
          <el-col :span="18" class="tip">{{dataForm.streetlightName}}</el-col>
        </el-col>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">创建时间</el-col>
          <el-col :span="18" class="tip">{{dataForm.addTime}}</el-col>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">经度</el-col>
          <el-col :span="18" class="tip">{{dataForm.longitude}}</el-col>
        </el-col>
        <el-col :span="12" class="tip">
          <el-col :span="6" class="tip">纬度</el-col>
          <el-col :span="18" class="tip">{{dataForm.latitude}}</el-col>
        </el-col>
      </el-row>
      <el-row>
        <el-col class="tip">
          <el-col :span="3" class="tip">地址</el-col>
          <el-col :span="18" class="tip">{{dataForm.streetlightAddress}}</el-col>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script>
export default {
  data () {
    return {
      dataForm: {
        streetlightId: 0,
        streetlightName: ' ',
        streetlightAddress: ' ',
        longitude: '',
        latitude: '',
        addTime: '',
        codeNumber: '',
        power: '',
        control: '',
        light: '',
        city: '',
        cityCode: '',
        singLampId: '',
        remark: '',
        updateTime: '',
        createUserId: '',
        createTime: '',
        userId: '',
        linkMethod: ''
      }
    }
  },
  computed: {
    streetlightStateId () {
      return this.$store.state.streetlight.streetlightId
    },
    documentClientHeight: {
      get () { return this.$store.state.common.documentClientHeight * 0.2 }
    }
  },
  watch: {
    streetlightStateId (curVal, oldVal) {
      this.getStreetlightInfo(curVal)
    }
  },
  methods: {
    getStreetlightInfo (streetlightId) {
      this.$http({
        url: this.$http.adornUrl(`/pole/polestreetlight/info/${streetlightId}`),
        method: 'get',
        params: this.$http.adornParams()
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataForm.streetlightId = data.polestreetlight.streetlightId
          this.dataForm.streetlightName = data.polestreetlight.streetlightName
          this.dataForm.streetlightAddress = data.polestreetlight.streetlightAddress
          this.dataForm.longitude = data.polestreetlight.longitude
          this.dataForm.latitude = data.polestreetlight.latitude
          this.dataForm.addTime = data.polestreetlight.addTime
          this.dataForm.codeNumber = data.polestreetlight.codeNumber
          this.dataForm.power = data.polestreetlight.power
          this.dataForm.control = data.polestreetlight.control
          this.dataForm.light = data.polestreetlight.light
          this.dataForm.city = data.polestreetlight.city
          this.dataForm.cityCode = data.polestreetlight.cityCode
          this.dataForm.singLampId = data.polestreetlight.singLampId
          this.dataForm.remark = data.polestreetlight.remark
          this.dataForm.updateTime = data.polestreetlight.updateTime
          this.dataForm.createUserId = data.polestreetlight.createUserId
          this.dataForm.createTime = data.polestreetlight.createTime
          this.dataForm.userId = data.polestreetlight.userId
          this.dataForm.linkMethod = data.polestreetlight.linkMethod
        }
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.streetlight-info {
  // background-image: url(~@/assets/img/streetlight/info.png);
  // background-size: 100% 100%;
  .tip {
    padding: 4px;
    font-size: 1.1em;
    &-title {
      color: aqua;
    }
  }
}
</style>