From 9521eecd67bc151ab00d8de47895d74229ae682a Mon Sep 17 00:00:00 2001 From: artem Date: Sat, 3 Oct 2026 07:42:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=81=D1=87=D0=B5=D1=82=D0=B0=20=D0=B2=D0=B8=D1=80?= =?UTF-8?q?=D1=82=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=BC=D0=BE?= =?UTF-8?q?=D1=89=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workouts/components/WorkoutItem.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) => {