feat(users,professors): add student-to-professor promotion dialog, complete student profile view and charts

This commit is contained in:
2026-08-24 22:53:24 +03:30
parent 05d96fd550
commit a2a7e756ad
9 changed files with 1302 additions and 171 deletions
+18 -2
View File
@@ -3,7 +3,10 @@
<div class="professor-list-view">
<PageHeader :title="$t('professors.title')" :subtitle="$t('professors.subtitle')">
<PermissionGate permission="professors:create">
<Button :label="$t('professors.addProfessor')" icon="pi pi-plus" @click="$router.push('/professors/create')" />
<div class="flex gap-2">
<Button label="افزودن از بین دانشجویان" icon="pi pi-user-plus" severity="secondary" outlined @click="showAddFromUserDialog = true" />
<Button :label="$t('professors.addProfessor')" icon="pi pi-plus" @click="$router.push('/professors/create')" />
</div>
</PermissionGate>
</PageHeader>
@@ -33,7 +36,13 @@
<Column field="specialization" header="تخصص">
<template #body="{ data }">
<Tag :value="data.specialization || 'عمومی'" severity="secondary" />
<div class="flex flex-wrap gap-1">
<template v-if="data.expertise?.length">
<Tag v-for="exp in data.expertise.slice(0, 2)" :key="exp" :value="exp" severity="info" class="text-xs" />
<Tag v-if="data.expertise.length > 2" :value="`+${data.expertise.length - 2}`" severity="secondary" class="text-xs" />
</template>
<Tag v-else :value="data.specialization || 'عمومی'" severity="secondary" />
</div>
</template>
</Column>
@@ -75,6 +84,11 @@
:loading="isDeleting"
@confirm="handleDelete"
/>
<AddProfessorFromUserDialog
v-model="showAddFromUserDialog"
@saved="loadData"
/>
</div>
</template>
@@ -88,6 +102,7 @@ import PageHeader from '@/components/common/PageHeader.vue';
import DataTableWrapper from '@/components/common/DataTableWrapper.vue';
import ConfirmDeleteDialog from '@/components/common/ConfirmDeleteDialog.vue';
import PermissionGate from '@/components/common/PermissionGate.vue';
import AddProfessorFromUserDialog from '@/components/professors/AddProfessorFromUserDialog.vue';
import Button from 'primevue/button';
import Column from 'primevue/column';
import Tag from 'primevue/tag';
@@ -109,6 +124,7 @@ const {
const deleteDialogVisible = ref(false);
const selectedProf = ref(null);
const isDeleting = ref(false);
const showAddFromUserDialog = ref(false);
const confirmDelete = (prof) => {
selectedProf.value = prof;