he wei
2024-04-15 c94f1afa786f297be86b01b49a641b2c0ad98b6e
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
<template>
  <div class="container">
    <instrument-board :name="labels[0]" :range="range" :unit="unit" class="item" ref="one"></instrument-board>
    <instrument-board :name="labels[1]" :range="range" :unit="unit" class="item" ref="two"></instrument-board>
    <instrument-board :name="labels[2]" :range="range" :unit="unit" class="item" ref="three"></instrument-board>
  </div>
</template>
 
<script>
 
import instrumentBoard from './instrumentBoard.vue'
 
export default {
  name: '',
  props: {
    labels: {
      type: Array,
      default() {
        return ['A相', 'B相', 'C相']
      }
    },
    unit: {
      type: String,
      default: '',
    },
    range: {
      type: Array,
      default() {
        return [0, 200]
      }
    }
  },
  data () {
    return {
 
    }
  },
  components: {
    instrumentBoard,
  },
  methods: {
    resize() {
      this.$refs.one.resize();
      this.$refs.two.resize();
      this.$refs.three.resize();
    },
    setData(data) {
      this.$refs.one.setData(data[0]);
      this.$refs.two.setData(data[1]);
      this.$refs.three.setData(data[2]);
    }
  },
 
  mounted () {
    this.resize();
    this.setData([0, 0, 0]);
  }
 
}
</script>
 
<style scoped lang="less">
.container {
  height: 100%;
  display: flex;
  .item {
    flex: 1;
  }
}
</style>