|
@@ -7,6 +7,7 @@
|
|
|
<DashboardStatCard
|
|
<DashboardStatCard
|
|
|
:badge="`${totalAlunos} ativos`"
|
|
:badge="`${totalAlunos} ativos`"
|
|
|
:value="String(totalAlunos)"
|
|
:value="String(totalAlunos)"
|
|
|
|
|
+ :value-color="activeStudentsColor"
|
|
|
icon="mdi-account-multiple-outline"
|
|
icon="mdi-account-multiple-outline"
|
|
|
title="Total alunos (contratos ativos)"
|
|
title="Total alunos (contratos ativos)"
|
|
|
/>
|
|
/>
|
|
@@ -299,6 +300,21 @@ const aniversariantes = ref([]);
|
|
|
const feriadosLoading = ref(false);
|
|
const feriadosLoading = ref(false);
|
|
|
const students = ref([]);
|
|
const students = ref([]);
|
|
|
const totalAlunos = ref(0);
|
|
const totalAlunos = ref(0);
|
|
|
|
|
+const unitConfig = ref({
|
|
|
|
|
+ active_students_min: 30,
|
|
|
|
|
+ active_students_medium: 50,
|
|
|
|
|
+ active_students_max: 80,
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const activeStudentsColor = computed(() => {
|
|
|
|
|
+ const count = totalAlunos.value;
|
|
|
|
|
+ const min = unitConfig.value.active_students_min;
|
|
|
|
|
+ const med = unitConfig.value.active_students_medium;
|
|
|
|
|
+
|
|
|
|
|
+ if (count < min) return "negative"; // Vermelho
|
|
|
|
|
+ if (count >= min && count < med) return "warning"; // Amarelo
|
|
|
|
|
+ return "positive"; // Verde (>= med)
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
const gaugeData = ref({
|
|
const gaugeData = ref({
|
|
|
datasets: [
|
|
datasets: [
|
|
@@ -541,6 +557,10 @@ const fetchSummary = async () => {
|
|
|
students.value = summary.enrollments;
|
|
students.value = summary.enrollments;
|
|
|
totalAlunos.value = summary.students_count;
|
|
totalAlunos.value = summary.students_count;
|
|
|
|
|
|
|
|
|
|
+ if (summary.unit_config) {
|
|
|
|
|
+ unitConfig.value = summary.unit_config;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
gaugeData.value.datasets[0].needleValue = Math.min(
|
|
gaugeData.value.datasets[0].needleValue = Math.min(
|
|
|
activeContracts.value,
|
|
activeContracts.value,
|
|
|
10,
|
|
10,
|
|
@@ -668,4 +688,4 @@ onMounted(() => {
|
|
|
flex: 1 1 calc(50% - 8px);
|
|
flex: 1 1 calc(50% - 8px);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|