songshankun
2023-11-13 e6b7921fc2e2b95e4c2b666b372ad611c08e9d62
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
<template>
  <div class="device-number-info">
    <div class="device-l">
      <div class="device-t">本机设备编码</div>
      <div class="device-b">
        <div class="device-info">
          {{ deviceInfo?.systemDeviceID }}
        </div>
      </div>
    </div>
    <div class="device-r">
      <el-scrollbar always class="scroller">
        <div class="device-t">云端设备编码</div>
        <div class="device-b">
          <div v-for="item in deviceInfo?.deviceList" :key="item.deviceID" class="device-info">
            <el-popover placement="top" :width="200" trigger="click" :content="item.deviceID">
              <template #reference>
                <el-text truncated style="color: #fff; max-width: 100px">{{ item.deviceID }}</el-text>
              </template>
            </el-popover>
          </div>
        </div>
      </el-scrollbar>
    </div>
  </div>
</template>
<script setup lang="ts">
import { useDevicesStore } from '@/stores/devices'
import { storeToRefs } from 'pinia'
 
const deviceStore = useDevicesStore()
const { deviceInfo } = storeToRefs(deviceStore)
</script>
 
<style scoped lang="scss">
$status-default: #2c5dbb82;
$status-running: #00ff00f0;
$status-ready: #0059ffd0;
$status-border: #ffffff21;
$status-dark-font: #efefef;
$status-off: red;
.device-number-info {
  width: 100%;
  height: 180px;
  margin-top: 20px;
  color: #fff;
  overflow: hidden;
  float: left;
  text-align: center;
  font-size: 12px;
  background: $status-default;
  border: 1px solid $status-border;
  box-sizing: border-box;
  border-radius: 4px;
  padding: 5px 5px 5px 20px;
  .device-l {
    width: 100px;
    height: 100%;
    float: left;
    padding-right: 10px;
    border-right: 1px solid $status-border;
  }
  .device-r {
    width: calc(100% - 120px);
    height: 100%;
    float: right;
  }
  .device-t {
    text-align: left;
    height: 25px;
    line-height: 25px;
  }
  .device-b {
    width: 100%;
    height: calc(100% - 35px);
    overflow: hidden;
  }
  .device-info {
    padding: 2px 10px;
    font-size: 14px;
    line-height: 20px;
    background: $status-ready;
    color: #fff;
    border-radius: 4px;
    float: left;
    margin-right: 5px;
    margin-top: 5px;
  }
}
</style>