he wei
2025-06-06 895129470d7ee48183fc15b9ee18ef0880503e5d
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
<script>
import FlexBox from "@/components/FlexBox.vue";
 
export default {
  name: "upsDataList",
  components: {FlexBox},
  props: {
    cols: {
      type: Number,
      default: 2
    },
    list: {
      type: Array,
      default() {
        return []
      }
    },
  },
  computed: {
    colsArr() {
      let arr = [];
      const cols = this.cols;
      for(let i=0; i<cols; i++) {
        let temp = [];
        for(let j=0; j<this.list.length; j++) {
          if(j%cols === i) {
            temp.push(this.list[j]);
          }
        }
        arr.push(temp);
      }
      return arr;
    }
  }
}
</script>
 
<template>
  <flex-box title="输入/输出电压" size="mini" no-header>
    <div class="data-list-wrapper">
      <div class="data-list-content">
        <div class="data-list-container">
          <div class="data-list" v-for="(cols, key) in colsArr" :key="'key'+key">
            <div class="data-item" v-for="(item, key1) in cols" :key="'key'+key1">
              <div class="data-label">{{ item.label }}</div>
              <div class="data-value">{{item.value}}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </flex-box>
</template>
 
<style scoped lang="less">
.data-list-wrapper {
  padding: 1px;
  height: 100%;
  box-sizing: border-box;
  .data-list-content {
    background-color: #011F39;
    height: 100%;
    display: flex;
    overflow-y: auto;
    justify-content: center;
    .data-list-container {
      display: inline-block;
      max-width: 100%;
      .data-list {
        display: inline-block;
        padding: 4px;
        vertical-align: top;
        text-align: right;
        .data-item {
          background-color: #14354d;
          padding: 6px 8px;
          font-size: 14px;
          white-space: nowrap;
          overflow-x: hidden;
          &:nth-child(even) {
            background-color: #0D2F48;
          }
          .data-label {
            display: inline-block;
            text-align: left;
            vertical-align: middle;
          }
          .data-value {
            display: inline-block;
            padding: 0 8px;
            color: #00FEFF;
            min-width: 2.5rem;
            text-align: left;
            vertical-align: middle;
          }
        }
      }
    }
 
  }
}
</style>