|
|
@@ -68,8 +68,8 @@
|
|
|
<template #body-cell-status="{ row }">
|
|
|
<q-td align="center">
|
|
|
<q-badge
|
|
|
- :color="row.status === 'active' ? 'positive' : 'warning'"
|
|
|
- :label="row.status === 'active' ? 'Ativo' : 'Inativo'"
|
|
|
+ :color="getStatusColor(row.status)"
|
|
|
+ :label="getStatusLabel(row.status)"
|
|
|
/>
|
|
|
</q-td>
|
|
|
</template>
|
|
|
@@ -203,6 +203,22 @@ const loadStudents = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const getStatusColor = (status) => {
|
|
|
+ if (status === 'active') return 'positive';
|
|
|
+ if (status === 'ex_student') return 'grey';
|
|
|
+ if (status === 'locked') return 'warning';
|
|
|
+ if (status === 'lead') return 'info';
|
|
|
+ return 'grey';
|
|
|
+};
|
|
|
+
|
|
|
+const getStatusLabel = (status) => {
|
|
|
+ if (status === 'active') return 'Ativo';
|
|
|
+ if (status === 'ex_student') return 'Ex-aluno';
|
|
|
+ if (status === 'locked') return 'Trancado';
|
|
|
+ if (status === 'lead') return 'Lead';
|
|
|
+ return 'Desconhecido';
|
|
|
+};
|
|
|
+
|
|
|
const onAddStudent = () => {
|
|
|
$q.dialog({
|
|
|
component: AddEditStudentDialog,
|