Explorar o código

feat(student): update status rendering with new rules (active, lead, locked, ex_student)

alvesantos hai 1 semana
pai
achega
c9e7d7da7c
Modificáronse 1 ficheiros con 18 adicións e 2 borrados
  1. 18 2
      src/pages/students/StudentPage.vue

+ 18 - 2
src/pages/students/StudentPage.vue

@@ -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,