消毒机设备
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.6 KiB

  1. <script lang="ts" setup>
  2. import { useDeviceStore } from 'stores/deviceStore'
  3. import { ref } from 'vue'
  4. const deviceStore = useDeviceStore()
  5. const deviceInfo = ref(deviceStore.deviceInfo)
  6. const screenInfo = {
  7. width: window.innerWidth, // 屏幕宽度(逻辑像素)
  8. height: window.innerHeight, // 屏幕高度(逻辑像素)
  9. availWidth: window.screen.availWidth, // 可用宽度(排除任务栏等)
  10. availHeight: window.screen.availHeight, // 可用高度
  11. pixelRatio: window.devicePixelRatio, // 设备像素比(物理像素/逻辑像素)
  12. colorDepth: window.screen.colorDepth, // 颜色深度
  13. }
  14. const width = Math.floor(screenInfo.width * screenInfo.pixelRatio)
  15. const height = Math.floor(screenInfo.height * screenInfo.pixelRatio)
  16. const screenWidth = ref(width)
  17. const screenHeight = ref(height)
  18. </script>
  19. <template>
  20. <div>
  21. <div class="device-ul">
  22. <div>设备ID{{ deviceInfo.deviceId }}</div>
  23. </div>
  24. <div class="device-ul">
  25. <div>设备类型{{ deviceInfo.deviceType }}</div>
  26. </div>
  27. <div class="device-ul">
  28. <div>IP地址{{ deviceInfo.ip }}</div>
  29. </div>
  30. <div class="device-ul">
  31. <div>初始化状态{{ deviceInfo.deviceTypeInited ? '已初始化' : '未初始化' }}</div>
  32. </div>
  33. <div class="device-ul">
  34. <div>设备屏幕尺寸{{ screenWidth }} x {{ screenHeight }}</div>
  35. </div>
  36. </div>
  37. </template>
  38. <style lang="scss" scoped>
  39. .device-ul{
  40. background: #F6FAFE;
  41. height: 4rem;
  42. display: flex;
  43. align-items: center;
  44. width: 100%;
  45. border-radius: 10px;
  46. margin-top: 1rem;
  47. padding-left: 2rem;
  48. font-size: 1.5rem;
  49. }
  50. </style>