DeviceInfoPanel.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!-- 设备信息面板组件 -->
  2. <template>
  3. <div class="data-card device-info-card">
  4. <div class="card-header">
  5. <h3 class="card-title">设备基础信息</h3>
  6. </div>
  7. <div class="card-body">
  8. <div class="device-info-header">
  9. <h4 class="device-name">{{ device.name }}</h4>
  10. <span class="device-status-tag" :class="statusClass">{{ statusLabel }}</span>
  11. </div>
  12. <div class="device-info-grid">
  13. <div class="info-row">
  14. <span class="info-label">设备类型</span>
  15. <span class="info-tag">{{ device.type || '振弦式应变计/位移计' }}</span>
  16. </div>
  17. <div class="info-row">
  18. <span class="info-label">安装日期</span>
  19. <span class="info-value">{{ device.installDate || '2023-06-15' }}</span>
  20. </div>
  21. <div class="info-row">
  22. <span class="info-label">出厂编号</span>
  23. <span class="info-value">{{ device.serialNumber || 'BK20230615001' }}</span>
  24. </div>
  25. <div class="info-row">
  26. <span class="info-label">监测项</span>
  27. <span class="info-value">{{ device.monitorType || '水平位移' }}</span>
  28. </div>
  29. </div>
  30. <div class="device-image-row">
  31. <div class="device-image-wrapper">
  32. <img src="/src/assets/images/Heilin/image.png" class="device-image" alt="设备图片" />
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. name: "DeviceInfoPanel",
  41. props: {
  42. device: { type: Object, default: () => ({ name: '坝顶水平位移仪 - R201YL1' }) },
  43. },
  44. computed: {
  45. statusLabel() {
  46. const map = { normal: '正常', warning: '预警', fault: '故障' };
  47. return map[this.device.status] || '正常';
  48. },
  49. statusClass() {
  50. return 'status-' + (this.device.status || 'normal');
  51. },
  52. },
  53. };
  54. </script>
  55. <style scoped>
  56. .device-info-card {
  57. position: relative;
  58. overflow: visible;
  59. }
  60. .card-header { height: 42px; background-image: url("/src/assets/images/数据小标题.png"); background-size: 100% 100%; background-position: center; background-repeat: no-repeat; display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 16px 0; }
  61. .card-title { font-size: var(--fs-card-title); font-weight: bold; color: #e0fcff; margin: 0; text-shadow: 0 0 5px rgba(0,212,255,0.5); padding-left: 20px; }
  62. .card-body {
  63. padding: 10px 12px 8px;
  64. background: rgba(0,20,40,0.7);
  65. border-radius: 0 0 4px 4px;
  66. }
  67. .device-info-header {
  68. display: flex;
  69. align-items: center;
  70. justify-content: space-between;
  71. margin-bottom: 6px;
  72. }
  73. .device-name {
  74. color: #e0fcff;
  75. font-size: 15px;
  76. font-weight: bold;
  77. margin: 0;
  78. text-shadow: 0 0 5px rgba(0,212,255,0.4);
  79. flex: 1;
  80. white-space: nowrap;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. }
  84. .device-status-tag {
  85. font-size: 10px;
  86. font-weight: bold;
  87. padding: 2px 10px;
  88. border-radius: 10px;
  89. flex-shrink: 0;
  90. margin-left: 8px;
  91. }
  92. .status-normal {
  93. color: #22c55e;
  94. background: rgba(34,197,94,0.15);
  95. border: 1px solid rgba(34,197,94,0.3);
  96. }
  97. .status-warning {
  98. color: #ffd93d;
  99. background: rgba(255,217,61,0.15);
  100. border: 1px solid rgba(255,217,61,0.3);
  101. }
  102. .status-fault {
  103. color: #ef4444;
  104. background: rgba(239,68,68,0.15);
  105. border: 1px solid rgba(239,68,68,0.3);
  106. }
  107. .device-image-row {
  108. margin-top: 8px;
  109. display: flex;
  110. justify-content: center;
  111. }
  112. .device-image-wrapper {
  113. width: 350px;
  114. height: 150px;
  115. border-radius: 4px;
  116. overflow: hidden;
  117. border: 1px solid rgba(0,212,255,0.2);
  118. background: rgba(0,20,40,0.5);
  119. display: flex;
  120. align-items: center;
  121. justify-content: center;
  122. }
  123. .device-image {
  124. width: 100%;
  125. height: 100%;
  126. object-fit: cover;
  127. }
  128. .device-info-grid {
  129. display: flex;
  130. flex-direction: column;
  131. gap: 4px;
  132. }
  133. .info-row {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-between;
  137. padding: 3px 0;
  138. }
  139. .info-label {
  140. color: #7bbef6;
  141. font-size: 11px;
  142. flex-shrink: 0;
  143. }
  144. .info-value {
  145. color: #e0fcff;
  146. font-size: 11px;
  147. font-weight: bold;
  148. }
  149. .info-tag {
  150. color: #62f6fb;
  151. font-size: 10px;
  152. font-weight: bold;
  153. padding: 1px 8px;
  154. background: rgba(98,246,251,0.1);
  155. border-radius: 2px;
  156. border: 1px solid rgba(98,246,251,0.2);
  157. }
  158. </style>