鸿蒙智能电子锁前端项目
whychdw
2024-12-18 45b4ff5c0b824d2e5b51a6af3c44076d05f0214d
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<script>
import { defineComponent } from 'vue';
import HdwCard from '@/components/HdwCard/index.vue';
import LedNum from '@/components/LedNum/index.vue';
import LineChart from '@/views/dashboard/components/LineChart.vue';
import MapChart from '@/components/Charts/MapChart.vue';
 
export default defineComponent({
  name: 'Dashboard',
  components: { MapChart, LineChart, LedNum, HdwCard },
  data() {
    return {
      stationNum: 0,
      devNum: 0,
      cardNum: 0,
      chartData: []
    };
  },
  methods: {}
});
</script>
 
<template>
  <div class="dashboard-wrapper">
    <div class="dashboard-left">
      <div class="left-content-list">
        <div class="left-content-item">
          <hdw-card is-full title="屏柜类型"></hdw-card>
        </div>
        <div class="left-content-item">
          <hdw-card is-full title="设备工作状态"></hdw-card>
        </div>
        <div class="left-content-item last">
          <hdw-card is-full title="环境状态"></hdw-card>
        </div>
      </div>
    </div>
    <div class="dashboard-middle">
      <div class="middle-content-wrapper">
        <hdw-card>
          <div class="number-list-wrapper">
            <div class="number-item">
              <div class="number-label">站点</div>
              <div class="number-value">
                <led-num color="#f00" :num="stationNum"></led-num>
              </div>
            </div>
            <div class="number-item">
              <div class="number-label">设备</div>
              <div class="number-value">
                <led-num color="#f00" :num="devNum"></led-num>
              </div>
            </div>
            <div class="number-item">
              <div class="number-label">电子卡</div>
              <div class="number-value">
                <led-num color="#f00" :num="cardNum"></led-num>
              </div>
            </div>
          </div>
        </hdw-card>
        <div class="map-wrapper">
          <hdw-card is-full>
            <map-chart></map-chart>
          </hdw-card>
        </div>
        <div class="dev-real-info">
          <hdw-card title="实时开锁信息" is-full></hdw-card>
        </div>
      </div>
    </div>
    <div class="dashboard-right">
      <div class="left-content-list">
        <div class="left-content-item">
          <hdw-card is-full title="屏柜品牌"></hdw-card>
        </div>
        <div class="left-content-item">
          <hdw-card is-full title="使用频次"></hdw-card>
        </div>
        <div class="left-content-item last">
          <hdw-card is-full title="告警统计"></hdw-card>
        </div>
      </div>
    </div>
  </div>
</template>
 
<style scoped lang="scss">
.dashboard-wrapper {
  display: flex;
  flex-direction: row;
  height: 100%;
  .dashboard-left{
    width: 500px;
    height: 100%;
  }
  .dashboard-middle {
    flex: 1;
    height: 100%;
  }
  .dashboard-right {
    width: 500px;
    height: 100%;
  }
}
 
.left-content-list {
  padding: 8px;
  height: 100%;
  .left-content-item {
    height: 33%;
    padding-bottom: 8px;
    &.last {
      height: 34%;
      padding-bottom: 0;
    }
  }
}
 
.middle-content-wrapper {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  height: 100%;
  .number-list-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    margin-top: 8px;
    .number-item {
      cursor: pointer;
      display: flex;
      // border-radius: 6px;
      align-items: center;
      .number-label {
        white-space: nowrap;
        background: #0ff;
        border-radius: 6px;
        color: #333;
        font-size: 16px;
        font-weight: bold;
        padding: 0 10px;
      }
      .number-value {
        width: 4.5em;
        height: 1.5em;
        padding: 0 10px;
      }
    }
  }
  .map-wrapper {
    flex: 1;
    padding: 8px 0;
  }
  .dev-real-info {
    height: 34%;
  }
}
</style>