he wei
2024-09-21 70edda3b00f2528a473c28ec5a50b739ed160f0f
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
<script>
import FlexBox from "@/components/FlexBox.vue";
import HdwLight from "@/components/HdwLight.vue";
 
export default {
  name: "sinalData",
  components: {
    HdwLight,
    FlexBox
  },
  props: {
    cols: {
      type: Number,
      default: 2
    },
    list: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  computed: {
    colsArr() {
      let arr = [];
      const cols = this.cols;
      let resArr = [];
 
      for(let i=0; i<this.list.length; i++) {
        const item = this.list[i];
        for(let j=0; j<item.list.length; j++) {
          resArr.push(item.list[j]);
        }
      }
 
      for(let i=0; i<cols; i++) {
        let temp = [];
        for(let j=0; j<resArr.length; j++) {
          if(j%cols === i) {
            temp.push(resArr[j]);
          }
        }
        arr.push(temp);
      }
      return arr;
    }
  }
}
</script>
 
<template>
  <div class="page-flex-layout">
    <div class="data-list-wrapper">
      <div class="data-list-content">
        <div class="data-list-container" v-for="(list, colKey) in colsArr" :key="'colKey'+colKey">
          <div class="data-list">
            <div class="data-item" v-for="(item, key) in list" :key="'key'+key">
              <div class="data-label">{{ item.label }}</div>
              <div class="data-value">
                <hdw-light style="height: 26px" :type="item.value"></hdw-light>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<style scoped lang="less">
.page-flex-layout {
  height: 100%;
  box-sizing: border-box;
  padding-bottom: 4px;
}
.data-list-container {
  display: inline-block;
  vertical-align: top;
}
.data-list-wrapper {
  padding: 1px;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  .data-list-content {
    background-color: #011F39;
    text-align: center;
  }
}
 
.data-list {
  padding: 4px;
  vertical-align: top;
  .data-item {
    background-color: #14354d;
    padding: 6px 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow-x: hidden;
    text-align: right;
    &:nth-child(even) {
      background-color: #0D2F48;
    }
    .data-label {
      font-size: 13px;
      display: inline-block;
      text-align: left;
      vertical-align: middle;
    }
    .data-value {
      display: inline-block;
      padding: 0 8px;
      color: #00FEFF;
      text-align: right;
      vertical-align: middle;
    }
  }
}
</style>