瀏覽代碼

优化样式

xiongxing 3 周之前
父節點
當前提交
c7c668a1a3
共有 1 個文件被更改,包括 15 次插入5 次删除
  1. 15 5
      src/views/Home/home.vue

+ 15 - 5
src/views/Home/home.vue

@@ -94,7 +94,7 @@
                   v-if="hasWarning(elderly.id)"
                   icon="mdi:alert"
                   class="warning-flag"
-                  color="yellow"
+                  color="red"
                   :size="50"
                 />
                 <div class="elderly-avatar-large" :class="getGenderClass(elderly.gender)">
@@ -368,7 +368,7 @@
     <el-drawer
       v-model="warningDrawerVisible"
       direction="rtl"
-      size="520px"
+      size="620px"
       class="warning-drawer"
       :title="`设备预警历史 (共${total}条)`"
       append-to-body
@@ -1049,7 +1049,9 @@ const getDeviceStatusInfo = (
 const getHealthStatusClass = (healthText: string) => {
   if (!healthText) return ''
   if (healthText.includes('良好') || healthText.includes('稳定')) return 'good'
-  if (healthText.includes('偏高') || healthText.includes('需关注')) return 'warning'
+  if (healthText.includes('偏高') || healthText.includes('关注') || healthText.includes('严重'))
+    return 'warning'
+  if (healthText.includes('危险')) return 'error'
   return 'normal'
 }
 
@@ -1701,6 +1703,7 @@ const handleSOSAlert = (alertData) => {
         // 为对应的老人卡片添加闪烁效果
         addFlashingEffect(selectedElder)
         getElderDeviceMessage(alert.elderId)
+        // 更新单个老人信息
       }
     }
     largeScreenStatsData.value = {
@@ -1741,7 +1744,7 @@ const handleHealthAlert = (healthAlert) => {
         <div>预警指标: ${healthAlertData.indicatorName || '未知'}</div>
         <div>预警信息: ${healthAlertData.message || '未知'}</div>
         <div>处理建议: ${healthAlertData.suggestion || '未知'}</div>
-        <div>预警程度: ${healthAlertData.alertLevel || '0%'}</div>
+        <div>预警程度: ${healthAlertData.alertLevel || ''}</div>
         <div>时间: ${new Date(healthAlertData.timestamp).toLocaleString()}</div>
         `
     }),
@@ -1752,6 +1755,8 @@ const handleHealthAlert = (healthAlert) => {
   if (healthAlertData.elderId && elderlyList.value.length > 0) {
     const elderIndex = elderlyList.value.findIndex((elder) => elder.id === healthAlertData.elderId)
     if (elderIndex !== -1) {
+      elderlyList.value[elderIndex].healthText =
+        healthAlertData.message + healthAlertData.suggestion
       // 创建一个新数组,将指定的老人移到第一位
       const reorderedList = [...elderlyList.value]
       const [selectedElder] = reorderedList.splice(elderIndex, 1)
@@ -2259,6 +2264,11 @@ $transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   background: $warning-color;
 }
 
+.status-dot.error {
+  color: $danger-color;
+  background: $danger-color;
+}
+
 .status-dot.normal {
   color: $primary-color;
   background: $primary-color;
@@ -2768,7 +2778,7 @@ $transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   font-size: 16px !important;
   background: rgb(255 255 255 / 10%) !important;
   border-radius: 10px !important;
-  box-shadow: 0 0 0 1px rgb(255 255 255 / 20%) !important;
+  // box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
 }
 
 :deep(.el-input__inner) {