longyvfengyun
2024-04-24 2ea742e653a2f6e4f14bb183297ca48da1130d09
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
<script>
import HdwLight from "@/components/HdwLight.vue";
import { getLabelByValue } from "../../../assets/js/tools";
 
export default {
  name: "IntelDevStateTools",
  methods: { getLabelByValue },
  components: { HdwLight },
  props: {
    list: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  data() {
    return {};
  },
};
</script>
 
<template>
  <div class="page-tools">
    <div class="page-tools-header">设备状态</div>
    <table class="page-tools-table">
      <tr>
        <td></td>
        <td>DCDC1</td>
        <td>DCDC2</td>
      </tr>
      <tr v-for="(item, key) in list" :key="'key' + key">
        <td class="item-label">{{ item.label }}</td>
        <td>
          <hdw-light
            v-if="item.type === 'light'"
            :type="item.value1"
          ></hdw-light>
          <span v-else>
            {{ getLabelByValue(item.value1, item.list) }}
          </span>
        </td>
        <td>
          <hdw-light
            v-if="item.type === 'light'"
            :type="item.value2"
          ></hdw-light>
          <span v-else>
            {{ getLabelByValue(item.value2, item.list) }}
          </span>
        </td>
      </tr>
    </table>
  </div>
</template>
 
<style scoped lang="less">
.page-tools {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #00fefe;
  .page-tools-header {
    color: #003d64;
    background-color: #00fefe;
    padding: 4px 16px;
    font-weight: bold;
    text-align: center;
  }
}
.page-tools-table {
  user-select: none;
  width: 100%;
  font-size: 14px;
  color: #00fefe;
  td {
    text-align: center;
    padding: 2px 4px;
    &.item-label {
      text-align: right;
    }
  }
}
</style>