Browse Source

[Mod 0000]过度页细节修改

wangkeyi 2 months ago
parent
commit
f7b7eb2477

+ 6 - 3
src/views/dashboard/Overhaul/components/LeafPage.vue

@@ -400,7 +400,7 @@
    */
   const getRiskText = (level?: string | number) => {
     if (!level && level !== 0) return '-';
-    return RISK_LEVEL_MAP[String(level)]?.text || '未知';
+    return RISK_LEVEL_MAP[String(level)]?.text || '-';
   };
   /**
    * 根据点分字符串路径获取对象值 (例如: 'fireAlarm.alarmName')
@@ -448,10 +448,11 @@
       if (riskInfo) {
         return { text: riskInfo.text, color: riskInfo.color };
       }
-      return { text: '未知', color: '#333' };
+      return { text: '-', color: '#333' };
     }
 
     if (key === 'gasLevelName') {
+      if ( !value ) return { text: value ?? '-', color: '#333' };
       // 瓦斯等级特殊处理
       const val = String(value);
       if (val.includes('低瓦斯')) {
@@ -465,6 +466,7 @@
     }
 
     if (key === 'gjMineStatus') {
+      if ( !value ) return { text: value ?? '-', color: '#333' };
       // 生产状态特殊处理
       const val = String(value);
       if (val.includes('正常生产')) {
@@ -473,7 +475,7 @@
         return { text: val, color: StatusColorEnum.blue }; // 蓝色
       } else {
         // 其余状态均显示绿色
-        return { text: val, color: StatusColorEnum.red };
+        return { text: val ?? '-', color: StatusColorEnum.red };
       }
     }
 
@@ -807,6 +809,7 @@
 
 .stat-item {
   flex: 1;
+  min-height: 80px;
   padding: 16px 50px 10px 90px;
   text-align: left;
   position: relative;

+ 25 - 6
src/views/dashboard/Overhaul/components/RootPage.vue

@@ -131,7 +131,7 @@
                           boxShadow: `0 0 10px ${getColValueColor(col, item)}`,
                         }"
                       ></span>
-                      {{ getColDisplayText(col, item) }}
+                      <span class="text-content"> {{ getColDisplayText(col, item) }} </span>
                     </div>
                   </div>
                 </div>
@@ -267,7 +267,7 @@
     { label: '瓦斯等级', key: 'gasLevelName', type: 'alarm', showPoint: true },
     { label: '煤层自燃倾向性', key: 'coalSeamLevel', type: 'text' },
     { label: '联网', key: 'status', colorKey: 'status', type: 'status', showPoint: true },
-    { label: '永久密闭数量', key: 'goafNum', type: 'text' },
+    { label: '永久密闭数量', key: 'goafDataCount', type: 'custom' },
     { label: '报警数量', key: 'alarmCount', type: 'custom' },
     { label: '报警原因', key: 'alarmReasons', type: 'custom' },
     { label: '开始时间', key: 'earliestTime', type: 'text' },
@@ -354,7 +354,7 @@
    */
   const getRiskText = (level?: string | number) => {
     if (!level && level !== 0) return '-';
-    return RISK_LEVEL_MAP[String(level)]?.text || '未知';
+    return RISK_LEVEL_MAP[String(level)]?.text || '-';
   };
 
   /**
@@ -436,6 +436,12 @@
     if (col.type === 'status') {
       return getlinkStatusInfo(rawValue).text;
     }
+    
+    // 处理永久密闭数量:取 goafDataList 的长度
+    if (col.key === 'goafDataCount') {
+      return item.goafDataList && Array.isArray(item.goafDataList) ? item.goafDataList.length : 0;
+    }
+    
     if (col.key === 'alarmCount') {
       // 取 alarmRecordList 的长度
       return item.alarmRecordList ? item.alarmRecordList.length : 0;
@@ -1137,12 +1143,25 @@
     .col-value {
       color: #000;
       font-size: 14px;
+      display: flex;
+      align-items: center;
+      width: 100%;
+      overflow: visible;
 
       .status-dot {
         width: 8px;
         height: 8px;
+        margin-right: 5px;
         border-radius: 50%;
         display: inline-block;
+        flex-shrink: 0;
+      }
+      .text-content {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        min-width: 0; 
       }
     }
 
@@ -1150,15 +1169,15 @@
       grid-column: span 1;
     }
     .col-second-row:nth-child(6) {
-      grid-column: 1 / span 3; // 占据第 1 到第 3 列
+      grid-column: 1 / span 3;
     }
 
     .col-second-row:nth-child(7) {
-      grid-column: span 1; // 占据第 4 列
+      grid-column: span 1;
     }
 
     .col-second-row:nth-child(8) {
-      grid-column: span 1; // 占据第 5 列
+      grid-column: span 1;
     }
   }