Browse Source

perf(views): 优化“设备工况”模块参数的历史数据曲线,无单位时不显示括号

wangcong 1 week ago
parent
commit
946fe73bee
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/views/device-work-status/DevWorkParamData.vue

+ 2 - 1
src/views/device-work-status/DevWorkParamData.vue

@@ -119,7 +119,8 @@ const historyData = ref<DevWorkHistoryDataItem[]>([]);
 const paramLabel = computed<string>(() => {
   if (historyData.value.length) {
     const { deviceParamName, unit } = historyData.value[0];
-    return `${deviceParamName}(${unit})`;
+    const unitText = unit ? `(${unit})` : '';
+    return deviceParamName + unitText;
   }
 
   return '';