Explorar el Código

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

wangcong hace 1 semana
padre
commit
946fe73bee
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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 '';