fix: 路由開關
This commit is contained in:
@@ -25,6 +25,7 @@ export type PainLevel = "none" | "mild" | "moderate" | "severe";
|
|||||||
|
|
||||||
/** 慢性病項目 */
|
/** 慢性病項目 */
|
||||||
export type ChronicDisease =
|
export type ChronicDisease =
|
||||||
|
| "none"
|
||||||
| "hypertension"
|
| "hypertension"
|
||||||
| "diabetes"
|
| "diabetes"
|
||||||
| "hyperlipidemia"
|
| "hyperlipidemia"
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<ModuleRouterCard
|
<ModuleRouterCard
|
||||||
|
v-if="CHECKIN_ENABLED"
|
||||||
description="完成數值紀錄,建立個人功能基線。"
|
description="完成數值紀錄,建立個人功能基線。"
|
||||||
icon="mdi-run-fast"
|
icon="mdi-run-fast"
|
||||||
icon-color="accent"
|
icon-color="accent"
|
||||||
@@ -152,6 +153,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<ModuleRouterCard
|
<ModuleRouterCard
|
||||||
|
v-if="APPOINTMENT_ENABLED"
|
||||||
description="預訂首次量測或回測,追蹤健康狀態。"
|
description="預訂首次量測或回測,追蹤健康狀態。"
|
||||||
icon="mdi-calendar-clock"
|
icon="mdi-calendar-clock"
|
||||||
icon-color="accent"
|
icon-color="accent"
|
||||||
@@ -288,7 +290,11 @@ import HealthRadarChart from "@/components/HealthRadarChart.vue";
|
|||||||
import Layout from "@/components/layout/DefaultLayout.vue";
|
import Layout from "@/components/layout/DefaultLayout.vue";
|
||||||
import ModuleRouterCard from "@/components/ModuleRouterCard.vue";
|
import ModuleRouterCard from "@/components/ModuleRouterCard.vue";
|
||||||
import { useDisplayUserName } from "@/composables/useDisplayUserName";
|
import { useDisplayUserName } from "@/composables/useDisplayUserName";
|
||||||
import { RADAR_ENABLED } from "@/config/features";
|
import {
|
||||||
|
APPOINTMENT_ENABLED,
|
||||||
|
CHECKIN_ENABLED,
|
||||||
|
RADAR_ENABLED,
|
||||||
|
} from "@/config/features";
|
||||||
import { useAppStore } from "@/stores/app";
|
import { useAppStore } from "@/stores/app";
|
||||||
import { useCourseStore } from "@/stores/course";
|
import { useCourseStore } from "@/stores/course";
|
||||||
|
|
||||||
|
|||||||
@@ -372,6 +372,9 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
density="compact"
|
density="compact"
|
||||||
hide-details
|
hide-details
|
||||||
|
@update:model-value="
|
||||||
|
handleChronicDiseaseChange(disease.value, $event)
|
||||||
|
"
|
||||||
:label="disease.title"
|
:label="disease.title"
|
||||||
:value="disease.value"
|
:value="disease.value"
|
||||||
/>
|
/>
|
||||||
@@ -491,7 +494,7 @@
|
|||||||
variant="flat"
|
variant="flat"
|
||||||
@click="handleAppointment"
|
@click="handleAppointment"
|
||||||
>
|
>
|
||||||
立即預約
|
{{ APPOINTMENT_ENABLED ? "立即預約" : "預約功能尚未開放" }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</div>
|
</div>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
@@ -526,6 +529,7 @@ import type {
|
|||||||
} from "@/api/types";
|
} from "@/api/types";
|
||||||
import { CONSENT_VERSION } from "@/api/types";
|
import { CONSENT_VERSION } from "@/api/types";
|
||||||
import Layout from "@/components/layout/DefaultLayout.vue";
|
import Layout from "@/components/layout/DefaultLayout.vue";
|
||||||
|
import { APPOINTMENT_ENABLED } from "@/config/features";
|
||||||
import {
|
import {
|
||||||
readGuestSelfAssessmentDraft,
|
readGuestSelfAssessmentDraft,
|
||||||
saveGuestSelfAssessmentDraft,
|
saveGuestSelfAssessmentDraft,
|
||||||
@@ -613,6 +617,7 @@ const improvementsOptions = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const diseaseOptions = [
|
const diseaseOptions = [
|
||||||
|
{ title: "無", value: "none" as const },
|
||||||
{ title: "高血壓", value: "hypertension" as const },
|
{ title: "高血壓", value: "hypertension" as const },
|
||||||
{ title: "糖尿病", value: "diabetes" as const },
|
{ title: "糖尿病", value: "diabetes" as const },
|
||||||
{ title: "高血脂", value: "hyperlipidemia" as const },
|
{ title: "高血脂", value: "hyperlipidemia" as const },
|
||||||
@@ -621,6 +626,21 @@ const diseaseOptions = [
|
|||||||
{ title: "骨質疏鬆", value: "osteoporosis" as const },
|
{ title: "骨質疏鬆", value: "osteoporosis" as const },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function handleChronicDiseaseChange(
|
||||||
|
changedDisease: ChronicDisease,
|
||||||
|
selectedDiseases: ChronicDisease[] | null,
|
||||||
|
) {
|
||||||
|
const normalizedDiseases = selectedDiseases ?? [];
|
||||||
|
|
||||||
|
if (changedDisease === "none" && normalizedDiseases.includes("none")) {
|
||||||
|
assessmentForm.chronicDiseases = ["none"];
|
||||||
|
} else if (changedDisease !== "none") {
|
||||||
|
assessmentForm.chronicDiseases = normalizedDiseases.filter(
|
||||||
|
(disease) => disease !== "none",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const birthdayDate = computed<Date | null>({
|
const birthdayDate = computed<Date | null>({
|
||||||
get: () => parseDateString(profileForm.birthday),
|
get: () => parseDateString(profileForm.birthday),
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ const WANTED_IMPROVEMENT_VALUES: WantedImprovement[] = [
|
|||||||
"bodyComposition",
|
"bodyComposition",
|
||||||
];
|
];
|
||||||
const CHRONIC_DISEASE_VALUES: ChronicDisease[] = [
|
const CHRONIC_DISEASE_VALUES: ChronicDisease[] = [
|
||||||
|
"none",
|
||||||
"hypertension",
|
"hypertension",
|
||||||
"diabetes",
|
"diabetes",
|
||||||
"hyperlipidemia",
|
"hyperlipidemia",
|
||||||
|
|||||||
Reference in New Issue
Block a user