diff --git a/src/pages/workouts/components/WorkoutItem.vue b/src/pages/workouts/components/WorkoutItem.vue index 857d381..9985270 100644 --- a/src/pages/workouts/components/WorkoutItem.vue +++ b/src/pages/workouts/components/WorkoutItem.vue @@ -201,6 +201,7 @@ :color=" workoutItem!.virtual_power_bike_type ? 'primary' : 'textPrimary' " + :disabled="!!workoutItem!.virtual_power_bike_type" @click="showVPModal = true" > {{ t("workout.virtualPower") }} @@ -298,7 +299,7 @@

{{ config.title }} @@ -617,6 +618,9 @@ const getUnit = (label: string) => { if (label == "Подъем") { return " м"; } + if (label == "Вирт. мощность") { + return " Вт"; + } }; /** Computes "Данные участка" over every metric for the given point range. */ const computeAreaData = (start: number, end: number) => { @@ -1123,6 +1127,9 @@ const workoutNP = computed(() => ); // Rebuilt per x-axis mode: labels switch between times and distances and // options get a fresh x-scale, so every canvas must remount on mode change. +const vpChartKey = computed(() => + workoutItem?.virtual_power != null ? "-vp" : "" +); const chartConfigs = computed>(() => { const labels = xAxisMode.value === "time" ? times : distances; const configs: Array = []; @@ -1263,6 +1270,13 @@ const calculateVP = () => { }) .then(() => { showVPModal.value = false; + const hasRealPower = data.power != null && data.power.datasets?.length > 0; + init({ + message: hasRealPower + ? "Виртуальная мощность рассчитана и отображается на графике мощности пунктирной линией." + : "Виртуальная мощность рассчитана и отображается на отдельном графике.", + color: "success", + }); emits("vpCalculated"); }) .catch((err: unknown) => {