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
<template>
  <div class="led-controller">
    <div class="title-text">播放内容设置</div>
    <el-row>
      <el-col :span="6">
        <div>
          <div><button class="btn img-btn" :class="{'click': isactive == 0}" @click="click(0)">图片上传</button></div>
          <div><button class="btn vid-btn" :class="{'click': isactive == 1}" @click="click(1)">视频上传</button></div>
          <div><button class="btn sub-btn" :class="{'click': isactive == 2}" @click="click(2)">字幕上传</button></div>
          <div><button class="btn sub-btn" :class="{'click': isactive == 3}" @click="click(3)">天气上传</button></div>
        </div>
      </el-col>
      <el-col :span="18">
        <div class="led-controller-controller">
          <image-upload v-if="isactive == 0"></image-upload>
          <video-upload v-if="isactive == 1"></video-upload>
          <subtext-upload v-if="isactive == 2"></subtext-upload>
          <weather-upload v-if="isactive == 3"></weather-upload>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
import ImageUpload from './led-controller/image-upload'
import VideoUpload from './led-controller/video-upload'
import SubtextUpload from './led-controller/subtext-upload'
import WeatherUpload from './led-controller/weather-upload'
export default {
  data () {
    return {
      isactive: 0
    }
  },
  computed: {
    lightemitStateId () {
      return this.$store.state.led.lightemitId
    }
  },
  watch: {
    lightemitStateId (curVal, oldVal) {
    }
  },
  components: {
    ImageUpload,
    VideoUpload,
    SubtextUpload,
    WeatherUpload
  },
  methods: {
    click (val) {
      this.isactive = val
    },
    // 推送天气数据
    pushLED () {
      var ids = [this.lightemitStateId]
      this.$http({
        url: this.$http.adornUrl(`/pole/polelightemit/pushLED`),
        method: 'post',
        data: this.$http.adornData({
          lightemitIds: ids
        })
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.$message({
            message: '操作成功',
            type: 'success',
            duration: 1500,
            onClose: () => {
              this.visible = false
              this.$emit('refreshDataList')
            }
          })
        } else {
          this.$message.error(data.msg)
        }
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.led-controller {
  margin-top: 10px;
  // background-image: url(~@/assets/img/led/controller.png);
  // background-size: 100% 100%;
  height: 451px;
  button:focus {
    outline:none;
  };
  .btn {
    border-style: none;
    width: 156px;
    height: 56px;
    margin: 15px;
    background: url(~@/assets/img/led/btn.png);
    background-repeat:no-repeat;
    background-size: 100%;
    color: #fff;
    font-size: 1.4em;
    font-weight: 550;
  };
  &-controller {
    border: 1px #d9d9d9 solid;
    display:block;
    margin: 20px;
    height: 345px;
  }
  /deep/ .el-upload-dragger {
    background-color: transparent;
    border: 1px dashed #d9d9d9;
  }
}
.click {
  background: url(~@/assets/img/led/btn-click.png) !important;
  background-repeat:no-repeat !important;
}
</style>