Xxxu
2020-07-07 4f953ffc89fc95f83b152e914c5e65938b440f17
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
  <div class="led-info" :style="{ 'height': documentClientHeight*0.3 + 'px' }">
    <div class="title-text">LED信息</div>
    <div style="padding: 20px">
      <el-row>
        <el-col :span="12">
          <el-col :span="8" class="tip">名称</el-col>
          <el-col :span="16" class="tip">{{dataForm.lightemitName}}</el-col>
        </el-col>
        <el-col :span="12">
          <el-col :span="8" class="tip">网络状态</el-col>
          <el-col :span="16" class="tip">
            <div class="isConnet netstate" v-show="dataForm.state == true"></div>
            <div class="unConnet netstate" v-show="dataForm.state != true"></div>
          </el-col>
        </el-col>
        <el-col :span="24">
          <el-col :span="4" class="tip">编码</el-col>
          <el-col :span="20" class="tip">{{dataForm.lightemitControlCode}}</el-col>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-col :span="4" class="tip">屏幕分辨率</el-col>
          <el-col :span="20" class="tip">{{resolutrion}}</el-col>
        </el-col>
        <el-col :span="24">
          <el-col :span="4" class="tip">创建时间</el-col>
          <el-col :span="20" class="tip">{{dataForm.createTime}}</el-col>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-col :span="4" class="tip">备注</el-col>
          <el-col :span="20" class="tip"></el-col>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script>
export default {
  data () {
    return {
      visible: false,
      streetlightList: [],
      dataForm: {
        lightemitId: 0,
        lightemitName: '',
        lightemitControlCode: '',
        // url: '',
        // playTime: '',
        // addTime: '',
        playerSetting: '',
        status: '',
        // createUserId: '',
        createTime: '',
        streetlightId: '',
        state: ''
      },
      resolutrion: ''         // 分辨率
    }
  },
  computed: {
    lightemitStateId () {
      return this.$store.state.led.lightemitId
    },
    documentClientHeight: {
      get () { return this.$store.state.common.documentClientHeight }
    }
  },
  watch: {
    lightemitStateId (curVal, oldVal) {
      this.getLedInfo(curVal)
      this.getLedStatus(curVal)
      this.getLedResolution(curVal)
    }
  },
  methods: {
    getLedInfo (lightemitId) {
      this.$http({
        url: this.$http.adornUrl(`/pole/polelightemit/info/${lightemitId}`),
        method: 'get',
        params: this.$http.adornParams()
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataForm.lightemitName = data.poleLightemit.lightemitName
          this.dataForm.lightemitControlCode = data.poleLightemit.lightemitControlCode
          // this.dataForm.url = data.poleLightemit.url
          // this.dataForm.playTime = data.poleLightemit.playTime
          // this.dataForm.addTime = data.poleLightemit.addTime
          this.dataForm.playerSetting = data.poleLightemit.playerSetting
          this.dataForm.status = data.poleLightemit.status
          // this.dataForm.createUserId = data.poleLightemit.createUserId
          this.dataForm.createTime = data.poleLightemit.createTime
          this.dataForm.streetlightId = data.poleLightemit.streetlightId
        }
      })
    },
    getLedStatus (lightemitId) {
      this.$http({
        url: this.$http.adornUrl('/pole/polelightemit/ledStatus'),
        method: 'post',
        data: this.$http.adornData([lightemitId], false)
      }).then(({data}) => {
        this.dataForm.state = data.result[lightemitId] === 'true'
      })
    },
    // 获取屏幕分辨率
    getLedResolution (lightemitId) {
      this.$http({
        url: this.$http.adornUrl('/pole/polelightemit/getResolution'),
        method: 'post',
        data: this.$http.adornData(lightemitId, false)
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.resolutrion = data.msg
        } else {
          this.resolutrion = ''
        }
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.led-info {
  // background-image: url(~@/assets/img/led/info.png);
  // background-size: 100% 100%;
  // height: 400px;
  .tip {
    padding: 10px;
    font-size: 1.2em;
    &-title {
      color: aqua;
    }
  };
  .netstate {
    width: 95px;
    height: 30px;
  };
  .isConnet {
    background-image: url(~@/assets/img/led/netstate-isconnet.png);
    background-size: 100% 100%;
  }
  .unConnet {
    background-image: url(~@/assets/img/led/netstate-unconnet.png);
    background-size: 100% 100%;
  }
 
}
</style>