@@ -3,7 +3,7 @@
|
||||
<div class="assignments-filters__grid">
|
||||
<TextField v-model="form.title" name="title" label="عنوان تکلیف">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
<SvgIcon name="monitor" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<SelectField
|
||||
@@ -54,7 +54,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<SelectField
|
||||
v-model="form.priority"
|
||||
name="priority"
|
||||
label="اولویت"
|
||||
label="اولویت تکلیف"
|
||||
:options="priorityOptions"
|
||||
option-label="label"
|
||||
option-value="value"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
desc="در این قسمت میتوانید تکالیف خود را مدیریت کنید"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="check-square" :size="24" color="var(--color-primary)" />
|
||||
<img :src="assignmentIcon" alt="" />
|
||||
</template>
|
||||
</BoxedIconTitleBlock>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</SimpleTitleIconBlock>
|
||||
<BaseButton text="افزودن تکلیف جدید" custom-class="assignments-page__add-btn" @click="onAdd">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="plus" :size="18" color="#fff" />
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { gallery } from '@/utils/gallery'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
@@ -75,6 +76,8 @@ import {
|
||||
const queryClient = useQueryClient()
|
||||
const { openModal, isModal } = useModal()
|
||||
|
||||
const assignmentIcon = gallery.assignmentIcon
|
||||
|
||||
const filters = ref({
|
||||
title: '',
|
||||
termId: '',
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="courses-filters__grid">
|
||||
<TextField v-model="form.title" name="title" label="عنوان دوره">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
<SvgIcon name="graduation-cap" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<SelectField
|
||||
|
||||
@@ -14,16 +14,6 @@
|
||||
|
||||
<form class="course-form__form" @submit.prevent="onSubmit">
|
||||
<div class="course-form__grid">
|
||||
<div class="course-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="course-form__main-col">
|
||||
<div class="course-form__row">
|
||||
<div class="course-form__cell course-form__cell--third">
|
||||
@@ -100,6 +90,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-form__divider" />
|
||||
@@ -309,29 +309,23 @@ const onCancel = () => router.push({ name: 'admin-courses' })
|
||||
gap: 1rem;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: 4fr 8fr;
|
||||
grid-template-columns: 8fr 4fr;
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
grid-template-columns: 3fr 9fr;
|
||||
grid-template-columns: 9fr 3fr;
|
||||
}
|
||||
}
|
||||
|
||||
&__image-col {
|
||||
order: 2;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 1;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
&__main-col {
|
||||
order: 1;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 2;
|
||||
padding-inline-start: 1.25rem;
|
||||
padding-inline-end: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
desc="در این قسمت میتوانید دورههای خود را مدیریت کنید"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="book" :size="24" color="var(--color-primary)" />
|
||||
<img :src="courseIcon" alt="" />
|
||||
</template>
|
||||
</BoxedIconTitleBlock>
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { gallery } from '@/utils/gallery'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import NoItems from '@/components/blocks/NoItems.vue'
|
||||
import TabsBlock from '@/components/blocks/TabsBlock.vue'
|
||||
@@ -64,6 +64,8 @@ const router = useRouter()
|
||||
const queryClient = useQueryClient()
|
||||
const { openModal, isModal } = useModal()
|
||||
|
||||
const courseIcon = gallery.courseIcon
|
||||
|
||||
const routeTermId = computed(() => (route.params.termId ? Number(route.params.termId) : null))
|
||||
|
||||
const onAdd = () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="exams-filters__grid">
|
||||
<TextField v-model="form.title" name="title" label="عنوان آزمون">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
<SvgIcon name="monitor" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<SelectField
|
||||
|
||||
@@ -30,7 +30,11 @@
|
||||
label="عنوان آزمون"
|
||||
:error="errors.title"
|
||||
@blur="validateAt('title', form.title)"
|
||||
/>
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<TextField
|
||||
v-model="form.minimumScore"
|
||||
name="minimumScore"
|
||||
@@ -39,7 +43,11 @@
|
||||
:convert-digits="true"
|
||||
:error="errors.minimumScore"
|
||||
@blur="validateAt('minimumScore', form.minimumScore)"
|
||||
/>
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="newspaper" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<TextField
|
||||
v-model="form.score"
|
||||
name="score"
|
||||
@@ -48,7 +56,11 @@
|
||||
:convert-digits="true"
|
||||
:error="errors.score"
|
||||
@blur="validateAt('score', form.score)"
|
||||
/>
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="newspaper" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<TextField
|
||||
v-model="form.durationMinutes"
|
||||
name="durationMinutes"
|
||||
@@ -57,14 +69,15 @@
|
||||
:convert-digits="true"
|
||||
:error="errors.durationMinutes"
|
||||
@blur="validateAt('durationMinutes', form.durationMinutes)"
|
||||
/>
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="clock" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<div class="exam-form__toggle-cell">
|
||||
<ToggleSwitch v-model="form.isRandom" label="به صــــورت رندوم باشد." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="exam-form__card">
|
||||
<TextareaField
|
||||
v-model="form.description"
|
||||
name="description"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
desc="در این قسمت میتوانید آزمونهای خود را مدیریت کنید"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="pencil" :size="24" color="var(--color-primary)" />
|
||||
<img :src="sessionIcon" alt="" />
|
||||
</template>
|
||||
</BoxedIconTitleBlock>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</SimpleTitleIconBlock>
|
||||
<BaseButton text="افزودن آزمون جدید" custom-class="exams-page__add-btn" @click="onAdd">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="plus" :size="18" color="#fff" />
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
@@ -50,6 +50,7 @@
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { gallery } from '@/utils/gallery'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
@@ -75,6 +76,8 @@ const router = useRouter()
|
||||
const queryClient = useQueryClient()
|
||||
const { openModal, isModal } = useModal()
|
||||
|
||||
const sessionIcon = gallery.sessionIcon
|
||||
|
||||
const filters = ref({
|
||||
title: '',
|
||||
termId: '',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<form class="tickets-filters" @submit.prevent="onSubmit">
|
||||
<div class="tickets-filters__grid">
|
||||
<TextField v-model="form.userName" name="userName" label="نام کاربر">
|
||||
<TextField v-model="form.userName" name="userName" label="جستجو اسم کاربر">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="user" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
@@ -28,7 +28,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
</div>
|
||||
|
||||
<SkeletonLoaderBlock v-if="isLoading && !ticket" :rows="3" :cols-per-row="1" />
|
||||
<div v-else-if="messages.length > 0" class="ticket-details__thread" ref="thread">
|
||||
<div
|
||||
v-else-if="messages.length > 0 || ticketMedia.length > 0"
|
||||
class="ticket-details__thread"
|
||||
ref="thread"
|
||||
>
|
||||
<div v-if="ticketMedia.length > 0" class="ticket-details__row ticket-details__row--user">
|
||||
<div class="ticket-details__bubble">
|
||||
<MessageAttachments :media="ticketMedia" />
|
||||
<span class="ticket-details__time">{{ messageTime(ticket) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="message in messages"
|
||||
:key="message.id"
|
||||
@@ -22,6 +32,7 @@
|
||||
:class="`ticket-details__row--${senderClass(message)}`"
|
||||
>
|
||||
<div class="ticket-details__bubble">
|
||||
<MessageAttachments v-if="message.media?.length" :media="message.media" />
|
||||
<p class="ticket-details__text">{{ message.message }}</p>
|
||||
<span class="ticket-details__time">{{ messageTime(message) }}</span>
|
||||
</div>
|
||||
@@ -31,6 +42,25 @@
|
||||
|
||||
<div class="ticket-details__divider" />
|
||||
|
||||
<div v-if="attachments.length > 0" class="ticket-details__attachments">
|
||||
<span
|
||||
v-for="(file, index) in attachments"
|
||||
:key="file.id ?? index"
|
||||
class="ticket-details__attachment"
|
||||
>
|
||||
<SvgIcon name="file" :size="14" color="currentColor" />
|
||||
<span class="ticket-details__attachment-name">{{ file.name }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="ticket-details__attachment-remove"
|
||||
aria-label="حذف فایل"
|
||||
@click="removeAttachment(index)"
|
||||
>
|
||||
<SvgIcon name="close" :size="12" color="var(--color-error)" />
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<form class="ticket-details__compose" @submit.prevent="onSend">
|
||||
<button
|
||||
type="submit"
|
||||
@@ -57,6 +87,23 @@
|
||||
>
|
||||
<SvgIcon name="mood" :size="30" color="currentColor" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="ticket-details__compose-btn"
|
||||
:disabled="uploadMutation.isPending.value"
|
||||
aria-label="پیوست فایل"
|
||||
@click="fileInput?.click()"
|
||||
>
|
||||
<SvgIcon name="attach-file" :size="30" color="currentColor" />
|
||||
</button>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
class="ticket-details__file-input"
|
||||
accept="image/*,application/pdf"
|
||||
multiple
|
||||
@change="onFilesPicked"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -81,13 +128,17 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { toast } from 'vue3-toastify'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import NoItems from '@/components/blocks/NoItems.vue'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
import { objectToFormData } from '@/utils/object-to-formdata'
|
||||
import { useUploadMediaMutation } from '@/services/query/auth'
|
||||
import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'
|
||||
import MessageAttachments from '@/components/blocks/MessageAttachments.vue'
|
||||
import SkeletonLoaderBlock from '@/components/blocks/SkeletonLoaderBlock.vue'
|
||||
import {
|
||||
autoUpdate,
|
||||
@@ -143,6 +194,8 @@ const { data: ticket, isLoading } = useAdminTicketQuery(ticketId, {
|
||||
|
||||
const messages = computed(() => ticket.value?.messages ?? [])
|
||||
|
||||
const ticketMedia = computed(() => ticket.value?.media ?? [])
|
||||
|
||||
const ticketDate = computed(() => formatJalaaliDate(ticket.value?.createdAt) || '—')
|
||||
|
||||
// Anyone whose id matches the ticket's student is "the student"; everyone else
|
||||
@@ -157,7 +210,49 @@ const messageTime = (message) => {
|
||||
}
|
||||
|
||||
const text = ref('')
|
||||
const canSend = computed(() => text.value.trim().length > 0)
|
||||
|
||||
const MAX_ATTACHMENTS = 5
|
||||
|
||||
const fileInput = ref(null)
|
||||
const attachments = ref([])
|
||||
|
||||
const uploadMutation = useUploadMediaMutation()
|
||||
|
||||
const onFilesPicked = async (event) => {
|
||||
const picked = [...event.target.files]
|
||||
event.target.value = ''
|
||||
if (attachments.value.length + picked.length > MAX_ATTACHMENTS) {
|
||||
toast.warning(`حداکثر تعداد فایل مجاز ${MAX_ATTACHMENTS} عدد است.`)
|
||||
return
|
||||
}
|
||||
for (const file of picked) {
|
||||
try {
|
||||
const fd = objectToFormData({ file, purpose: 'attachment', context: 'ticket' })
|
||||
const response = await uploadMutation.mutateAsync(fd)
|
||||
const payload = response?.data ?? response
|
||||
const id = payload?.id ?? payload?.uploadId
|
||||
if (id == null) continue
|
||||
attachments.value = [
|
||||
...attachments.value,
|
||||
{ id, name: file.name, size: file.size, url: payload?.url ?? '' },
|
||||
]
|
||||
} catch {
|
||||
toast.error(`بارگذاری فایل "${file.name}" با خطا مواجه شد.`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const removeAttachment = (index) => {
|
||||
const next = [...attachments.value]
|
||||
next.splice(index, 1)
|
||||
attachments.value = next
|
||||
}
|
||||
|
||||
const canSend = computed(
|
||||
() =>
|
||||
(text.value.trim().length > 0 || attachments.value.length > 0) &&
|
||||
!uploadMutation.isPending.value
|
||||
)
|
||||
|
||||
const emojiOpen = ref(false)
|
||||
const emojiButton = ref(null)
|
||||
@@ -213,10 +308,15 @@ const sendMutation = useSendAdminTicketMessageMutation()
|
||||
const onSend = async () => {
|
||||
if (!canSend.value || !ticketId.value) return
|
||||
const value = text.value.trim()
|
||||
const mediaIds = attachments.value.map((f) => f.id).filter((id) => id != null)
|
||||
text.value = ''
|
||||
attachments.value = []
|
||||
emojiOpen.value = false
|
||||
// Backend POST /admin/tickets/:id/messages — body is { message: string }.
|
||||
await sendMutation.mutateAsync({ id: ticketId.value, payload: { message: value } })
|
||||
// Backend POST /admin/tickets/:id/messages — body is { message: string,
|
||||
// mediaIds?: number[] } where mediaIds reference previously uploaded media.
|
||||
const payload = { message: value }
|
||||
if (mediaIds.length > 0) payload.mediaIds = mediaIds
|
||||
await sendMutation.mutateAsync({ id: ticketId.value, payload })
|
||||
await queryClient.invalidateQueries({ queryKey: adminTicketsKeys.all })
|
||||
}
|
||||
|
||||
@@ -405,6 +505,12 @@ watch(messages, async () => {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__attachments {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
&__attachment {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
+138
-23
@@ -3,138 +3,253 @@ export default [
|
||||
path: '/main-dashboard',
|
||||
name: 'admin-dashboard',
|
||||
component: () => import('@/features/admin/pages/AdminDashboardPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'پیشخوان' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'سلام بر شما',
|
||||
subtitle: 'به سامانه موسسه بانو خوش آمدید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/users',
|
||||
name: 'admin-users',
|
||||
component: () => import('@/features/admin/users/pages/UsersListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت کاربران' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'لیست کاربران',
|
||||
subtitle: 'کنترل کامل روی اطلاعات، نقشها و وضعیت کاربران',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/add-user',
|
||||
name: 'admin-add-user',
|
||||
component: () => import('@/features/admin/users/pages/UserFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'افزودن کاربر جدید' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'لیست کاربران',
|
||||
subtitle: 'کنترل کامل روی اطلاعات، نقشها و وضعیت کاربران',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/edit-user/:id',
|
||||
name: 'admin-edit-user',
|
||||
component: () => import('@/features/admin/users/pages/UserFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'ویرایش کاربر' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'لیست کاربران',
|
||||
subtitle: 'کنترل کامل روی اطلاعات، نقشها و وضعیت کاربران',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/user-verification',
|
||||
name: 'admin-user-verification',
|
||||
component: () => import('@/features/admin/users/pages/UserVerificationPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'تایید هویت کاربران' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'کاربران سیستم من',
|
||||
subtitle: 'دسترسی کامل به اطلاعات، نقشها و وضعیت کاربران',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/terms',
|
||||
name: 'admin-terms',
|
||||
component: () => import('@/features/admin/terms/pages/TermsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت ترم' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/add-term',
|
||||
name: 'admin-add-term',
|
||||
component: () => import('@/features/admin/terms/pages/TermFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'افزودن ترم جدید' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/edit-term/:id',
|
||||
name: 'admin-edit-term',
|
||||
component: () => import('@/features/admin/terms/pages/TermFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'ویرایش ترم' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/courses',
|
||||
name: 'admin-courses',
|
||||
component: () => import('@/features/admin/courses/pages/CoursesListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت دوره' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/add-course',
|
||||
name: 'admin-add-course',
|
||||
component: () => import('@/features/admin/courses/pages/CourseFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'افزودن دوره' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/edit-course/:id',
|
||||
name: 'admin-edit-course',
|
||||
component: () => import('@/features/admin/courses/pages/CourseFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'ویرایش دوره' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/terms/:termId/courses',
|
||||
name: 'admin-term-courses',
|
||||
component: () => import('@/features/admin/courses/pages/CoursesListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'دورههای ترم' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/courses/:courseId/sessions',
|
||||
name: 'admin-course-sessions',
|
||||
component: () => import('@/features/admin/sessions/pages/SessionsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'جلسات دوره' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/sessions',
|
||||
name: 'admin-sessions',
|
||||
component: () => import('@/features/admin/sessions/pages/SessionsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت جلسات' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/add-session',
|
||||
name: 'admin-add-session',
|
||||
component: () => import('@/features/admin/sessions/pages/SessionFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'افزودن جلسه جدید' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/edit-session/:id',
|
||||
name: 'admin-edit-session',
|
||||
component: () => import('@/features/admin/sessions/pages/SessionFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'ویرایش جلسه' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/exams',
|
||||
name: 'admin-exams',
|
||||
component: () => import('@/features/admin/exams/pages/ExamsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت آزمونها' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/add-exam',
|
||||
name: 'admin-add-exam',
|
||||
component: () => import('@/features/admin/exams/pages/ExamFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'افزودن آزمون جدید' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/edit-exam/:id',
|
||||
name: 'admin-edit-exam',
|
||||
component: () => import('@/features/admin/exams/pages/ExamFormPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'ویرایش آزمون' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/assignments',
|
||||
name: 'admin-assignments',
|
||||
component: () => import('@/features/admin/assignments/pages/AssignmentsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت تکالیف' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز آموزش',
|
||||
subtitle: 'دسترسی سریع به دورهها، آزمونها و نتایج آموزشی.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/messages',
|
||||
name: 'admin-messages',
|
||||
component: () => import('@/features/admin/messages/pages/TicketsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت پیامها' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز پیامها',
|
||||
subtitle: 'تمام ارتباطات سیستمی و کاربری را در این بخش مدیریت نمایید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/services',
|
||||
name: 'admin-services',
|
||||
component: () => import('@/features/admin/services/pages/ServicesListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت خدمات' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز خدمات',
|
||||
subtitle: 'لیست خدمات را مشاهده و مدیریت نمایید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/consultations',
|
||||
name: 'admin-consultations',
|
||||
component: () => import('@/features/admin/consultations/pages/ConsultationsListPage.vue'),
|
||||
meta: { layout: 'admin', role: 'admin', title: 'مدیریت مشاوره' },
|
||||
meta: {
|
||||
layout: 'admin',
|
||||
role: 'admin',
|
||||
title: 'مرکز مشاوره',
|
||||
subtitle: 'جلسات مشاوره را پیگیری کرده و پاسخگوی نیازهای کاربران باشید.',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="sessions-filters__grid">
|
||||
<TextField v-model="form.title" name="title" label="عنوان جلسه">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
<SvgIcon name="monitor" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<SelectField
|
||||
@@ -38,7 +38,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -12,16 +12,6 @@
|
||||
|
||||
<form class="session-form__form" @submit.prevent="onSubmit">
|
||||
<div class="session-form__grid">
|
||||
<div class="session-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="session-form__main-col">
|
||||
<LineTitleBlock title="اطلاعات جلسه" title-en="Session Details" />
|
||||
|
||||
@@ -112,6 +102,16 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="session-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="session-form__divider" />
|
||||
@@ -392,32 +392,27 @@ const onCancel = () => router.push({ name: 'admin-sessions' })
|
||||
gap: 1rem;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: 4fr 8fr;
|
||||
grid-template-columns: 8fr 4fr;
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
grid-template-columns: 3fr 9fr;
|
||||
grid-template-columns: 9fr 3fr;
|
||||
}
|
||||
}
|
||||
|
||||
&__image-col {
|
||||
order: 2;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 1;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
&__main-col {
|
||||
order: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 2;
|
||||
padding-inline-start: 1.25rem;
|
||||
padding-inline-end: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
desc="در این قسمت میتوانید جلسات خود را مدیریت کنید"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="book" :size="24" color="var(--color-primary)" />
|
||||
<img :src="sessionIcon" alt="" />
|
||||
</template>
|
||||
</BoxedIconTitleBlock>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</SimpleTitleIconBlock>
|
||||
<BaseButton text="افزودن جلسه جدید" custom-class="sessions-page__add-btn" @click="onAdd">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="plus" :size="18" color="#fff" />
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="terms-filters__grid">
|
||||
<TextField v-model="form.title" name="title" label="عنوان">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="book" :size="20" color="var(--color-thd-gray)" />
|
||||
<SvgIcon name="graduation-cap" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<SelectField
|
||||
|
||||
@@ -14,16 +14,6 @@
|
||||
|
||||
<form class="term-form__form" @submit.prevent="onSubmit">
|
||||
<div class="term-form__grid">
|
||||
<div class="term-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="term-form__main-col">
|
||||
<LineTitleBlock title="اطلاعات ترم" title-en="Term Details" />
|
||||
<div class="term-form__row">
|
||||
@@ -91,6 +81,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="term-form__image-col">
|
||||
<ImageCropper
|
||||
v-model="image"
|
||||
name="image"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onImageCropped"
|
||||
@error="onImageError"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="term-form__divider" />
|
||||
@@ -249,29 +249,23 @@ const onCancel = () => router.push({ name: 'admin-terms' })
|
||||
gap: 1rem;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: 4fr 8fr;
|
||||
grid-template-columns: 8fr 4fr;
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
grid-template-columns: 3fr 9fr;
|
||||
grid-template-columns: 9fr 3fr;
|
||||
}
|
||||
}
|
||||
|
||||
&__image-col {
|
||||
order: 2;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 1;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
&__main-col {
|
||||
order: 1;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 2;
|
||||
padding-inline-start: 1.25rem;
|
||||
padding-inline-end: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +306,7 @@ const onCancel = () => router.push({ name: 'admin-terms' })
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
@@ -14,21 +14,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Badge v-if="user.status === 'blocked'" variant="danger" size="sm" dot>
|
||||
{{ USER_STATUS.blocked }}
|
||||
</Badge>
|
||||
<div class="users-table__middle">
|
||||
<div class="users-table__date">
|
||||
<span class="users-table__date-label">تاریخ ثبت نام:</span>
|
||||
<span class="users-table__date-value">
|
||||
{{ formatJalaaliDateTime(user.createdAt) || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="users-table__role-badge"
|
||||
:class="`users-table__role-badge--${roleName(user) || 'unknown'}`"
|
||||
:disabled="updateRoleMutation.isPending.value && activeUser?.id === user.id"
|
||||
@click="onRoleClick($event, user)"
|
||||
>
|
||||
<span class="users-table__role-dot" />
|
||||
<span>{{ roleLabel(user) || 'بدون نقش' }}</span>
|
||||
<SvgIcon name="caret-down" :size="12" color="currentColor" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="users-table__role-badge"
|
||||
:class="`users-table__role-badge--${roleName(user) || 'unknown'}`"
|
||||
:disabled="updateRoleMutation.isPending.value && activeUser?.id === user.id"
|
||||
@click="onRoleClick($event, user)"
|
||||
>
|
||||
<span class="users-table__role-dot" />
|
||||
<span>{{ roleLabel(user) || 'بدون نقش' }}</span>
|
||||
<SvgIcon name="caret-down" :size="12" color="currentColor" />
|
||||
</button>
|
||||
<Badge v-if="user.status === 'blocked'" variant="danger" size="sm" dot>
|
||||
{{ USER_STATUS.blocked }}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<div class="users-table__actions">
|
||||
<button
|
||||
@@ -77,6 +85,7 @@ import { useQueryClient } from '@tanstack/vue-query'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import DropdownMenu from '@/components/DropdownMenu.vue'
|
||||
import { formatJalaaliDateTime } from '@/utils/date-utils'
|
||||
import { adminUsersKeys, useUpdateAdminUserRoleMutation } from '@/services/query/admin-users'
|
||||
|
||||
defineProps({
|
||||
@@ -219,10 +228,38 @@ const menuItems = computed(() => {
|
||||
}
|
||||
|
||||
&__info {
|
||||
flex: 1;
|
||||
flex: 1 1 33%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__middle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
flex: 1 1 33%;
|
||||
}
|
||||
|
||||
&__date {
|
||||
background: rgba(107, 107, 107, 5%);
|
||||
padding: 0.25rem 1rem;
|
||||
border-radius: 0.875rem;
|
||||
white-space: nowrap;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&__date-label {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 300;
|
||||
font-size: 0.75rem;
|
||||
color: #848484;
|
||||
margin-inline-end: 0.25rem;
|
||||
}
|
||||
|
||||
&__date-value {
|
||||
font-family: var(--font-family-en);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 500;
|
||||
|
||||
@@ -13,31 +13,28 @@
|
||||
|
||||
<template v-else-if="user">
|
||||
<div class="user-details__section">
|
||||
<div v-if="isStudent && !user.profileCompleted" class="user-details__notice">
|
||||
<SvgIcon name="warning" :size="20" color="var(--color-primary)" />
|
||||
<span>اطلاعات ثبت نام این دانشجو کامل نیست.</span>
|
||||
</div>
|
||||
|
||||
<div class="user-details__head">
|
||||
<div class="user-details__avatar">
|
||||
<img v-if="user.avatarUrl" :src="user.avatarUrl" :alt="fullName" />
|
||||
<SvgIcon v-else name="user" :size="48" color="#cbd5e1" />
|
||||
</div>
|
||||
<div class="user-details__identity">
|
||||
<div class="user-details__status" :class="statusModifier">
|
||||
<span class="user-details__status-dot" />
|
||||
<span>{{ user.status === 'blocked' ? 'غیر فعال' : 'فعال' }}</span>
|
||||
<div class="user-details__row user-details__row--main">
|
||||
<div class="user-details__head">
|
||||
<div class="user-details__avatar">
|
||||
<img v-if="user.avatarUrl" :src="user.avatarUrl" :alt="fullName" />
|
||||
<SvgIcon v-else name="user" :size="48" color="#cbd5e1" />
|
||||
</div>
|
||||
<div class="user-details__identity">
|
||||
<div class="user-details__status" :class="statusModifier">
|
||||
<span class="user-details__status-dot" />
|
||||
<span>{{ user.status === 'blocked' ? 'غیر فعال' : 'فعال' }}</span>
|
||||
</div>
|
||||
<p class="user-details__label">نام و نام خانوادگی</p>
|
||||
<p class="user-details__name">{{ fullName || '—' }}</p>
|
||||
<Badge
|
||||
class="user-details__role"
|
||||
:variant="roleVariant"
|
||||
label="نقش:"
|
||||
:value="roleText"
|
||||
dot
|
||||
/>
|
||||
</div>
|
||||
<p class="user-details__label">نام و نام خانوادگی</p>
|
||||
<p class="user-details__name">{{ fullName || '—' }}</p>
|
||||
<p class="user-details__role">
|
||||
<span class="user-details__role-key">نقش:</span>
|
||||
<span class="user-details__role-val">{{ roleText }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-details__grid">
|
||||
<LineInfoBlock
|
||||
title="تاریخ تولد"
|
||||
:numeric-desc="formatJalaaliDate(user.birthday) || '—'"
|
||||
@@ -49,11 +46,14 @@
|
||||
:desc="MARITAL_STATUS[user.marriageStatus] || '—'"
|
||||
/>
|
||||
<LineInfoBlock title="جنسیت" :desc="GENDER[user.gender] || '—'" />
|
||||
<LineInfoBlock title="استان" :desc="user?.province?.name || '—'" />
|
||||
<LineInfoBlock title="شهر" :desc="user?.city?.name || '—'" />
|
||||
</div>
|
||||
|
||||
<LineInfoBlock title="آدرس" :desc="user?.address || '—'" />
|
||||
<div class="user-details__row user-details__row--location">
|
||||
<LineInfoBlock title="استان" :desc="user?.province?.name || '—'" />
|
||||
<LineInfoBlock title="شهر" :desc="user?.city?.name || '—'" />
|
||||
<LineInfoBlock title="آدرس" :desc="user?.address || '—'" />
|
||||
</div>
|
||||
|
||||
<LineInfoBlock title="بیوگرافی" :desc="user.bio || '—'" />
|
||||
</div>
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import Badge from '@/components/Badge.vue'
|
||||
import useModal from '@/composables/useModal'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
@@ -137,6 +138,16 @@ const roleText = computed(() => {
|
||||
return name ? ROLE_LABELS[name] || name : 'بدون نقش'
|
||||
})
|
||||
|
||||
const ROLE_BADGE_VARIANTS = {
|
||||
student: 'danger',
|
||||
teacher: 'warning',
|
||||
counselor: 'blue',
|
||||
missionary: 'info',
|
||||
admin: 'neutral',
|
||||
}
|
||||
|
||||
const roleVariant = computed(() => ROLE_BADGE_VARIANTS[roleName.value] || 'neutral')
|
||||
|
||||
const isStudent = computed(() => roleName.value === 'student')
|
||||
|
||||
const statusModifier = computed(() =>
|
||||
@@ -172,7 +183,43 @@ const statusModifier = computed(() =>
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.875rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
&__row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
&__row--main {
|
||||
align-items: center;
|
||||
|
||||
@media (min-width: 640px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: auto repeat(5, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
&__row--main &__head {
|
||||
grid-column: 1 / -1;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-column: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&__row--location {
|
||||
@media (min-width: 640px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
&__avatar {
|
||||
@@ -245,23 +292,7 @@ const statusModifier = computed(() =>
|
||||
}
|
||||
|
||||
&__role {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
margin: 0.25rem 0 0;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
background-color: rgba(0, 0, 0, 4%);
|
||||
font-family: var(--font-family-fa);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
&__role-key {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
&__role-val {
|
||||
font-weight: 500;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
|
||||
@@ -21,25 +21,25 @@
|
||||
<div class="verification-item__date">
|
||||
<span class="verification-item__date-label">تاریخ ثبت نام:</span>
|
||||
<span class="verification-item__date-value">
|
||||
{{ formatJalaaliDate(user.createdAt) || '—' }}
|
||||
{{ formatJalaaliDateTime(user.createdAt) || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="user.status === 'verified'"
|
||||
class="verification-item__badge verification-item__badge--pending"
|
||||
>
|
||||
<span class="verification-item__dot" />
|
||||
<span>در انتظار تایید</span>
|
||||
</div>
|
||||
<button
|
||||
v-else-if="user.status === 'rejected'"
|
||||
type="button"
|
||||
class="verification-item__badge verification-item__badge--rejected"
|
||||
<Badge
|
||||
v-if="user.status === 'rejected'"
|
||||
variant="danger"
|
||||
:dot="true"
|
||||
value="رد شده"
|
||||
:clickable="true"
|
||||
@click="emit('show-reject-reason', user)"
|
||||
>
|
||||
<span class="verification-item__dot" />
|
||||
<span>رد شده</span>
|
||||
</button>
|
||||
/>
|
||||
<Badge
|
||||
v-else-if="statusLabel"
|
||||
:variant="statusVariant"
|
||||
:dot="true"
|
||||
:value="statusLabel"
|
||||
:clickable="user.status === 'blocked'"
|
||||
@click="emit('show-reject-reason', user)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="verification-item__actions">
|
||||
@@ -54,11 +54,11 @@
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
v-if="user.status !== 'rejected'"
|
||||
v-if="user.status !== 'blocked'"
|
||||
tooltip="عدم تایید"
|
||||
bg-color="rgba(204, 40, 49, 0.08)"
|
||||
size="2.5rem"
|
||||
@click="emit('verify-user', { id: user.id, status: 'rejected' })"
|
||||
@click="emit('verify-user', { id: user.id, status: 'blocked' })"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" color="var(--color-error)" />
|
||||
@@ -80,10 +80,12 @@
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { USER_STATUS } from '@/enums'
|
||||
import Badge from '@/components/Badge.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
import CircleButton from '@/components/CircleButton.vue'
|
||||
import { formatJalaaliDateTime } from '@/utils/date-utils'
|
||||
|
||||
const props = defineProps({
|
||||
user: { type: Object, required: true },
|
||||
@@ -92,7 +94,16 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['show-details', 'show-reject-reason', 'verify-user'])
|
||||
|
||||
const STATUS_VARIANTS = {
|
||||
pending: 'neutral',
|
||||
verified: 'warning',
|
||||
approved: 'success',
|
||||
blocked: 'danger',
|
||||
}
|
||||
|
||||
const fullName = computed(() => `${props.user.name || ''}`.trim() || '—')
|
||||
const statusLabel = computed(() => USER_STATUS[props.user.status] || '')
|
||||
const statusVariant = computed(() => STATUS_VARIANTS[props.user.status] || 'neutral')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -202,37 +213,6 @@ const fullName = computed(() => `${props.user.name || ''}`.trim() || '—')
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
&__badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.25rem 1rem;
|
||||
border-radius: 0.875rem;
|
||||
font-family: var(--font-family-fa);
|
||||
font-size: 0.7rem;
|
||||
line-height: 1.5;
|
||||
border: none;
|
||||
cursor: default;
|
||||
|
||||
&--pending {
|
||||
background: rgba(0, 255, 68, 6%);
|
||||
color: #009a12;
|
||||
}
|
||||
|
||||
&--rejected {
|
||||
background: rgba(204, 40, 49, 6%);
|
||||
color: var(--color-error);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
&__dot {
|
||||
width: 0.375rem;
|
||||
height: 0.375rem;
|
||||
border-radius: 9999px;
|
||||
background: currentcolor;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
<SvgIcon name="close" color="black" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
|
||||
+1
-3
@@ -11,7 +11,7 @@
|
||||
<div class="reject-reason-details">
|
||||
<div class="reject-reason-details__grid">
|
||||
<div class="reject-reason-details__cell--full">
|
||||
<LineInfoBlock title="توضیحات" :desc="verification(data).adminNote || ''" />
|
||||
<LineInfoBlock title="توضیحات" :desc="data?.user?.blockReason || '—'" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,8 +34,6 @@ import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import LineInfoBlock from '@/components/blocks/LineInfoBlock.vue'
|
||||
|
||||
defineOptions({ name: 'RejectReasonDetailsModal' })
|
||||
|
||||
const verification = (data) => data?.verification || {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -9,31 +9,13 @@
|
||||
>
|
||||
<template #default="{ data, close }">
|
||||
<form class="reject-reason-modal" @submit.prevent="onSubmit(data, close)">
|
||||
<div class="reject-reason-modal__row">
|
||||
<TextField
|
||||
v-model="form.rejectionReason"
|
||||
name="rejectionReason"
|
||||
label="علت رد"
|
||||
:error="errors.rejectionReason"
|
||||
@blur="validateAt('rejectionReason', form.rejectionReason)"
|
||||
/>
|
||||
<SelectField
|
||||
:model-value="form.priority?.id"
|
||||
name="priority"
|
||||
label="وضعیت تیکت"
|
||||
:options="statusOptions"
|
||||
option-label="label"
|
||||
option-value="value"
|
||||
:error="errors.priority"
|
||||
@update:model-value="(e) => handleChange('priority', { id: e })"
|
||||
/>
|
||||
</div>
|
||||
<TextareaField
|
||||
v-model="form.adminNote"
|
||||
name="adminNote"
|
||||
v-model="form.reason"
|
||||
name="reason"
|
||||
label="لطفا علت رد را توضیح دهید"
|
||||
:row="4"
|
||||
:error="errors.adminNote"
|
||||
:error="errors.reason"
|
||||
@blur="validateAt('reason', form.reason)"
|
||||
/>
|
||||
|
||||
<div class="reject-reason-modal__divider" />
|
||||
@@ -68,14 +50,11 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import useYup from '@/composables/useYup'
|
||||
import { PRIORITY_STATUS } from '@/enums'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import TextField from '@/components/form/TextField.vue'
|
||||
import { rejectionReasonSchema } from '../../../schema'
|
||||
import SelectField from '@/components/form/SelectField.vue'
|
||||
import TextareaField from '@/components/form/TextareaField.vue'
|
||||
import { adminUsersKeys, useChangeAdminUserStatusMutation } from '@/services/query/admin-users'
|
||||
|
||||
@@ -84,22 +63,12 @@ defineOptions({ name: 'RejectReasonModal' })
|
||||
const queryClient = useQueryClient()
|
||||
const changeStatusMutation = useChangeAdminUserStatusMutation()
|
||||
|
||||
const DEFAULT_FORM = { rejectionReason: '', adminNote: '' }
|
||||
const DEFAULT_FORM = { reason: '' }
|
||||
|
||||
const { validate, validateAt, errors, resetErrors } = useYup(rejectionReasonSchema)
|
||||
|
||||
const form = ref(structuredClone({ ...DEFAULT_FORM }))
|
||||
|
||||
const statusOptions = Object.entries(PRIORITY_STATUS).map(([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
}))
|
||||
|
||||
const handleChange = (key, value) => {
|
||||
form.value = { ...form.value, [key]: value }
|
||||
validateAt(key, value)
|
||||
}
|
||||
|
||||
const onSubmit = async (data, close) => {
|
||||
const { isValid, payload } = await validate(form.value)
|
||||
if (!isValid) return
|
||||
@@ -107,7 +76,7 @@ const onSubmit = async (data, close) => {
|
||||
if (!id) return
|
||||
await changeStatusMutation.mutateAsync({
|
||||
id,
|
||||
payload: { status: 'blocked', ...payload },
|
||||
payload: { status: 'blocked', reason: payload.reason },
|
||||
})
|
||||
await queryClient.invalidateQueries({ queryKey: adminUsersKeys.all })
|
||||
form.value = structuredClone({ ...DEFAULT_FORM })
|
||||
@@ -122,11 +91,6 @@ const onSubmit = async (data, close) => {
|
||||
text-align: start;
|
||||
padding: 0.5rem;
|
||||
|
||||
&__row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
&__divider {
|
||||
border-block-end: 1px solid var(--color-thd-gray);
|
||||
margin-block: 1rem;
|
||||
|
||||
+1
-4
@@ -21,10 +21,7 @@
|
||||
/>
|
||||
<LineInfoBlock title="شماره تماس" :numeric-desc="personal.phone" />
|
||||
<LineInfoBlock title="کد ملی" :numeric-desc="personal.nationalCode" />
|
||||
<LineInfoBlock
|
||||
title="وضعیت تاهل"
|
||||
:desc="MARITAL_STATUS[personal.maritalStatus] || ''"
|
||||
/>
|
||||
<LineInfoBlock title="وضعیت" :desc="MARITAL_STATUS[personal.maritalStatus] || ''" />
|
||||
<LineInfoBlock title="جنسیت" :desc="GENDER[personal.gender] || ''" />
|
||||
<LineInfoBlock title="استان" :desc="personal.province || '-'" />
|
||||
<LineInfoBlock title="شهر" :desc="personal.city || '-'" />
|
||||
|
||||
@@ -14,16 +14,6 @@
|
||||
|
||||
<form class="user-form__form" @submit.prevent="onSubmit">
|
||||
<div class="user-form__grid">
|
||||
<div class="user-form__avatar-col">
|
||||
<ImageCropper
|
||||
v-model="avatar"
|
||||
name="avatar"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onAvatarCropped"
|
||||
@error="onAvatarError"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="user-form__main-col">
|
||||
<LineTitleBlock title="مشخصات فردی" title-en="Personal Details" />
|
||||
<div class="user-form__row">
|
||||
@@ -200,6 +190,16 @@
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-form__avatar-col">
|
||||
<ImageCropper
|
||||
v-model="avatar"
|
||||
name="avatar"
|
||||
bg-color="#eeeeee"
|
||||
@crop="onAvatarCropped"
|
||||
@error="onAvatarError"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -285,7 +285,7 @@ const avatar = ref(null)
|
||||
|
||||
const schema = isEditMode.value ? userEditSchema : userAddSchema
|
||||
|
||||
const { validate, validateAt, errors } = useYup(schema)
|
||||
const { validate, validateAt, errors } = useYup(schema, () => form.value)
|
||||
|
||||
const onProvinceChange = () => {
|
||||
provinceIdRef.value = form.value.provinceId
|
||||
@@ -336,7 +336,7 @@ const uploadMutation = useUploadMediaMutation()
|
||||
|
||||
const onAvatarCropped = async (file) => {
|
||||
try {
|
||||
const formData = objectToFormData({ file, subType: 'avatar', context: 'user' })
|
||||
const formData = objectToFormData({ file, purpose: 'avatar', context: 'user' })
|
||||
const response = await uploadMutation.mutateAsync(formData)
|
||||
const payload = response?.data ?? response
|
||||
avatar.value = { url: payload?.url, uploadId: payload?.uploadId, ...payload }
|
||||
@@ -411,29 +411,23 @@ const onCancel = () => router.push({ name: 'admin-users' })
|
||||
gap: 1rem;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: 4fr 8fr;
|
||||
grid-template-columns: 8fr 4fr;
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
grid-template-columns: 3fr 9fr;
|
||||
grid-template-columns: 9fr 3fr;
|
||||
}
|
||||
}
|
||||
|
||||
&__avatar-col {
|
||||
order: 2;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 1;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
&__main-col {
|
||||
order: 1;
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
order: 2;
|
||||
padding-inline-start: 1.25rem;
|
||||
padding-inline-end: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ const onFilterReset = () => resetPagination()
|
||||
const changeStatusMutation = useChangeAdminUserStatusMutation()
|
||||
|
||||
const onVerifyUser = ({ id, status }) => {
|
||||
if (status === 'rejected') {
|
||||
if (status === 'blocked') {
|
||||
openModal('RejectReasonModal', { id })
|
||||
return
|
||||
}
|
||||
@@ -106,7 +106,7 @@ const onShowDetails = (id) => {
|
||||
}
|
||||
|
||||
const onShowRejectReason = (user) => {
|
||||
openModal('RejectReasonDetailsModal', { verification: user.verification })
|
||||
openModal('RejectReasonDetailsModal', { user })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</SimpleTitleIconBlock>
|
||||
<BaseButton text="افزودن کاربر جدید" custom-class="users-page__add-btn" @click="onAdd">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="plus" :size="18" color="#fff" />
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
@@ -5,14 +5,7 @@ import { nationalCodeRule } from '@/constants/rules/nationalCodeRule'
|
||||
import { passwordConfirmationRule } from '@/constants/rules/passwordConfirmationRule'
|
||||
|
||||
export const rejectionReasonSchema = object().shape({
|
||||
rejectionReason: string().required(),
|
||||
priority: object()
|
||||
.shape({
|
||||
id: string().required().default(null),
|
||||
})
|
||||
.required()
|
||||
.default(null),
|
||||
adminNote: string().notRequired(),
|
||||
reason: string().required(),
|
||||
})
|
||||
|
||||
const baseUserShape = {
|
||||
|
||||
@@ -41,19 +41,19 @@
|
||||
<SvgIcon name="arrow-left" :size="22" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<div class="login-form__links">
|
||||
<div class="login-form__link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<span>حساب کاربری ندارم</span>
|
||||
<RouterLink :to="{ name: 'signup' }">ثبت نام</RouterLink>
|
||||
</div>
|
||||
<div class="login-form__link">
|
||||
<SvgIcon name="check" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="login-form__link-btn" @click="goLoginWithCode">
|
||||
ورود با کد تایید
|
||||
</button>
|
||||
</div>
|
||||
<div class="login-form__links">
|
||||
<div class="login-form__link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<span>حساب کاربری ندارم</span>
|
||||
<RouterLink :to="{ name: 'signup' }">ثبت نام</RouterLink>
|
||||
</div>
|
||||
<div class="login-form__link">
|
||||
<SvgIcon name="check" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="login-form__link-btn" @click="goLoginWithCode">
|
||||
ورود با کد تایید
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -110,26 +110,30 @@ const goForgotPassword = () => emit('next', { mode: 'forgotPassword' })
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
|
||||
&__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 1rem 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
margin-top: auto;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,16 +166,12 @@ const goForgotPassword = () => emit('next', { mode: 'forgotPassword' })
|
||||
}
|
||||
|
||||
.login-form__links {
|
||||
margin-top: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form__link {
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
<SvgIcon name="arrow-left" :size="22" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<div class="login-otp__links">
|
||||
<button type="button" class="login-otp__back" @click="emit('back')">
|
||||
بازگشت به ورود با رمز عبور
|
||||
</button>
|
||||
</div>
|
||||
<div class="login-otp__links">
|
||||
<button type="button" class="login-otp__back" @click="emit('back')">
|
||||
بازگشت به ورود با رمز عبور
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="auth-form__footer">
|
||||
@@ -98,26 +98,30 @@ const onSubmit = async () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
|
||||
&__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 1rem 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
margin-top: auto;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,14 +131,10 @@ const onSubmit = async () => {
|
||||
}
|
||||
|
||||
.login-otp__links {
|
||||
margin-top: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.login-otp__back {
|
||||
|
||||
@@ -67,12 +67,12 @@
|
||||
<SvgIcon name="arrow-left" :size="22" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<div class="signup-form__login-link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<span>حساب کاربری دارم</span>
|
||||
<RouterLink :to="{ name: 'login' }">ورود</RouterLink>
|
||||
</div>
|
||||
<div class="signup-form__login-link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<span>حساب کاربری دارم</span>
|
||||
<RouterLink :to="{ name: 'login' }">ورود</RouterLink>
|
||||
</div>
|
||||
|
||||
<div class="auth-form__footer">
|
||||
@@ -131,26 +131,30 @@ const onSubmit = async () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
|
||||
&__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 1rem 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
margin-top: auto;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +164,7 @@ const onSubmit = async () => {
|
||||
}
|
||||
|
||||
.signup-form__login-link {
|
||||
margin-top: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
@@ -168,10 +172,6 @@ const onSubmit = async () => {
|
||||
font-size: 0.75rem;
|
||||
color: #a7a7a7;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-sec-gray);
|
||||
text-decoration: underline;
|
||||
|
||||
@@ -28,20 +28,20 @@
|
||||
<SvgIcon name="arrow-left" :size="22" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<div class="verify__links">
|
||||
<div class="verify__link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="verify__link-btn" @click="emit('password-login')">
|
||||
ورود با رمز عبور
|
||||
</button>
|
||||
</div>
|
||||
<div class="verify__link">
|
||||
<SvgIcon name="phone" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="verify__link-btn" @click="emit('back')">
|
||||
تغییر شماره تلفن همراه
|
||||
</button>
|
||||
</div>
|
||||
<div class="verify__links">
|
||||
<div class="verify__link">
|
||||
<SvgIcon name="user" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="verify__link-btn" @click="emit('password-login')">
|
||||
ورود با رمز عبور
|
||||
</button>
|
||||
</div>
|
||||
<div class="verify__link">
|
||||
<SvgIcon name="phone" :size="12" color="#A7A7A7" />
|
||||
<button type="button" class="verify__link-btn" @click="emit('back')">
|
||||
تغییر شماره تلفن همراه
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,7 +137,6 @@ const onSubmit = async () => {
|
||||
const response = await verifySignupMutation.mutateAsync({ phone: props.phoneNumber, code })
|
||||
applySession(response?.data ?? response)
|
||||
emit('verified', { phone: props.phoneNumber, code })
|
||||
redirectAfterLogin()
|
||||
}
|
||||
|
||||
const onResend = async () => {
|
||||
@@ -154,26 +153,30 @@ const onResend = async () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
|
||||
&__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 1rem 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
margin-top: auto;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,16 +204,12 @@ const onResend = async () => {
|
||||
}
|
||||
|
||||
.verify__links {
|
||||
margin-top: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.verify__link {
|
||||
|
||||
@@ -111,11 +111,8 @@ import TextareaField from '@/components/form/TextareaField.vue'
|
||||
import { useSaveRegisterDataMutation } from '@/services/query/auth'
|
||||
import StepActions from '@/features/auth/components/studentRegister/StepActions.vue'
|
||||
import { educationalInformationSchema } from '@/features/auth/schema/student-register'
|
||||
import { useStudentRegistrationStore } from '@/features/auth/store/student-registration'
|
||||
import { EDUCATION_STATUS, SEMINARY_LEVEL, STUDENT_REGISTRATION, UNIVERSITY_LEVEL } from '@/enums'
|
||||
import {
|
||||
toKeyValueList,
|
||||
useStudentRegistrationStore,
|
||||
} from '@/features/auth/store/student-registration'
|
||||
|
||||
const store = useStudentRegistrationStore()
|
||||
|
||||
@@ -148,7 +145,7 @@ const saveRegisterMutation = useSaveRegisterDataMutation()
|
||||
const onSubmit = async () => {
|
||||
const { isValid, payload } = await validate(form.value)
|
||||
if (!isValid) return
|
||||
await saveRegisterMutation.mutateAsync(toKeyValueList(payload))
|
||||
await saveRegisterMutation.mutateAsync(payload)
|
||||
store.educational = { ...store.educational, ...payload }
|
||||
store.markStepAsCompleted(STUDENT_REGISTRATION.EDUCATIONAL_INFORMATION)
|
||||
store.goToNextStep()
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
</div>
|
||||
<div class="personal-info__cell">
|
||||
<DatePickerField
|
||||
v-model="form.birthDate"
|
||||
name="birthDate"
|
||||
v-model="form.birthday"
|
||||
name="birthday"
|
||||
label="تاریخ تولد"
|
||||
:max="maxBirthDate"
|
||||
:error="errors.birthDate"
|
||||
:error="errors.birthday"
|
||||
/>
|
||||
</div>
|
||||
<div class="personal-info__cell">
|
||||
@@ -198,21 +198,25 @@ const maxBirthDate = computed(() => {
|
||||
const initialPhone = ref(user.value?.phone || store.personal.phone || '')
|
||||
const initialNationalCode = ref(user.value?.nationalCode || store.personal.nationalCode || '')
|
||||
|
||||
const initialAvatar =
|
||||
store.personal.avatar || (user.value?.avatarUrl ? { url: user.value.avatarUrl } : null)
|
||||
|
||||
const form = ref({
|
||||
name: user.value?.name || store.personal.name || '',
|
||||
birthDate: store.personal.birthDate || '',
|
||||
birthday: user.value?.birthday || store.personal.birthday || '',
|
||||
nationalCode: initialNationalCode.value,
|
||||
maritalStatus: store.personal.maritalStatus || '',
|
||||
gender: store.personal.gender || '',
|
||||
maritalStatus: user.value?.marriageStatus || store.personal.maritalStatus || '',
|
||||
gender: user.value?.gender || store.personal.gender || '',
|
||||
phone: initialPhone.value,
|
||||
provinceId: store.personal.provinceId || null,
|
||||
cityId: store.personal.cityId || null,
|
||||
address: store.personal.address || '',
|
||||
avatar: store.personal.avatar || null,
|
||||
provinceId: user.value?.provinceId || store.personal.provinceId || null,
|
||||
cityId: user.value?.cityId || store.personal.cityId || null,
|
||||
address:
|
||||
(typeof user.value?.address === 'string' && user.value.address) || store.personal.address || '',
|
||||
avatar: initialAvatar,
|
||||
avatarId: store.personal.avatarId || '',
|
||||
})
|
||||
|
||||
const avatar = ref(store.personal.avatar || null)
|
||||
const avatar = ref(initialAvatar)
|
||||
|
||||
const { validate, validateAt, errors } = useYup(personalInformationSchema)
|
||||
|
||||
@@ -263,7 +267,7 @@ const onSubmit = async () => {
|
||||
// (http auto-converts camelCase → snake_case: birthday, national_code, …)
|
||||
const body = {
|
||||
name: payload.name,
|
||||
birthday: payload.birthDate,
|
||||
birthday: payload.birthday,
|
||||
nationalCode: payload.nationalCode,
|
||||
marriageStatus: payload.maritalStatus,
|
||||
gender: payload.gender,
|
||||
|
||||
@@ -117,10 +117,7 @@ import { useSaveRegisterDataMutation } from '@/services/query/auth'
|
||||
import { PROPAGATION_PLATFORM, STUDENT_REGISTRATION } from '@/enums'
|
||||
import StepActions from '@/features/auth/components/studentRegister/StepActions.vue'
|
||||
import { professionalInformationSchema } from '@/features/auth/schema/student-register'
|
||||
import {
|
||||
toKeyValueList,
|
||||
useStudentRegistrationStore,
|
||||
} from '@/features/auth/store/student-registration'
|
||||
import { useStudentRegistrationStore } from '@/features/auth/store/student-registration'
|
||||
|
||||
const store = useStudentRegistrationStore()
|
||||
|
||||
@@ -193,7 +190,7 @@ const onSubmit = async () => {
|
||||
specializedTopics: payload.specializedTopics,
|
||||
propagationPlatforms,
|
||||
}
|
||||
await saveRegisterMutation.mutateAsync(toKeyValueList(next))
|
||||
await saveRegisterMutation.mutateAsync(next)
|
||||
store.professional = next
|
||||
store.markStepAsCompleted(STUDENT_REGISTRATION.PROFESSIONAL_INFORMATION)
|
||||
store.goToNextStep()
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<SvgIcon :name="tab.icon" :size="22" color="#fff" />
|
||||
</li>
|
||||
</ul>
|
||||
<SidebarLogout color="#fff" stacked />
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
@@ -25,6 +26,7 @@
|
||||
<script setup>
|
||||
import { gallery } from '@/utils/gallery'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import SidebarLogout from '@/layouts/sidebars/SidebarLogout.vue'
|
||||
|
||||
defineProps({
|
||||
tabs: { type: Array, required: true },
|
||||
|
||||
@@ -42,10 +42,7 @@ import { useSaveRegisterDataMutation } from '@/services/query/auth'
|
||||
import StepActions from '@/features/auth/components/studentRegister/StepActions.vue'
|
||||
import { skillAssessmentPart6Schema } from '@/features/auth/schema/student-register'
|
||||
import MediaRecorder from '@/features/auth/components/studentRegister/MediaRecorder.vue'
|
||||
import {
|
||||
toKeyValueList,
|
||||
useStudentRegistrationStore,
|
||||
} from '@/features/auth/store/student-registration'
|
||||
import { useStudentRegistrationStore } from '@/features/auth/store/student-registration'
|
||||
|
||||
const store = useStudentRegistrationStore()
|
||||
|
||||
@@ -70,7 +67,7 @@ const saveRegisterMutation = useSaveRegisterDataMutation()
|
||||
const onSubmit = async () => {
|
||||
const { isValid, payload } = await validate(form.value)
|
||||
if (!isValid) return
|
||||
await saveRegisterMutation.mutateAsync(toKeyValueList(payload))
|
||||
await saveRegisterMutation.mutateAsync(payload)
|
||||
store.skill6 = { ...store.skill6, ...payload }
|
||||
store.markStepAsCompleted(STUDENT_REGISTRATION.SKILL_ASSESSMENT_PART_6)
|
||||
store.goToNextStep()
|
||||
|
||||
@@ -46,10 +46,7 @@ import { useSaveRegisterDataMutation } from '@/services/query/auth'
|
||||
import StepActions from '@/features/auth/components/studentRegister/StepActions.vue'
|
||||
import { skillAssessmentPart7Schema } from '@/features/auth/schema/student-register'
|
||||
import MediaRecorder from '@/features/auth/components/studentRegister/MediaRecorder.vue'
|
||||
import {
|
||||
toKeyValueList,
|
||||
useStudentRegistrationStore,
|
||||
} from '@/features/auth/store/student-registration'
|
||||
import { useStudentRegistrationStore } from '@/features/auth/store/student-registration'
|
||||
|
||||
const store = useStudentRegistrationStore()
|
||||
|
||||
@@ -75,7 +72,7 @@ const onSubmit = async () => {
|
||||
const { isValid, payload } = await validate(form.value)
|
||||
if (!isValid) return
|
||||
try {
|
||||
await saveRegisterMutation.mutateAsync(toKeyValueList(payload))
|
||||
await saveRegisterMutation.mutateAsync(payload)
|
||||
store.skill7 = { ...store.skill7, ...payload }
|
||||
store.markStepAsCompleted(STUDENT_REGISTRATION.SKILL_ASSESSMENT_PART_7)
|
||||
store.isProfileCompleted = true
|
||||
|
||||
@@ -46,10 +46,7 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import TextareaField from '@/components/form/TextareaField.vue'
|
||||
import { useSaveRegisterDataMutation } from '@/services/query/auth'
|
||||
import StepActions from '@/features/auth/components/studentRegister/StepActions.vue'
|
||||
import {
|
||||
toKeyValueList,
|
||||
useStudentRegistrationStore,
|
||||
} from '@/features/auth/store/student-registration'
|
||||
import { useStudentRegistrationStore } from '@/features/auth/store/student-registration'
|
||||
|
||||
const props = defineProps({
|
||||
step: { type: Number, required: true },
|
||||
@@ -89,7 +86,7 @@ const saveRegisterMutation = useSaveRegisterDataMutation()
|
||||
const onSubmit = async () => {
|
||||
const { isValid, payload } = await validate(form.value)
|
||||
if (!isValid) return
|
||||
await saveRegisterMutation.mutateAsync(toKeyValueList(payload))
|
||||
await saveRegisterMutation.mutateAsync(payload)
|
||||
store[props.storeKey] = { ...store[props.storeKey], ...payload }
|
||||
store.markStepAsCompleted(props.step)
|
||||
store.goToNextStep()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ROLE_HOME_ROUTES } from '@/enums'
|
||||
import { useAuthStore } from '@/store/auth'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
@@ -12,8 +13,7 @@ export const useRedirectAfterLogin = () => {
|
||||
router.push(redirect).catch(() => router.push('/'))
|
||||
return
|
||||
}
|
||||
const target =
|
||||
auth.role === 'admin' ? { name: 'admin-dashboard' } : { name: 'student-dashboard' }
|
||||
const target = { name: ROLE_HOME_ROUTES[auth.role] || 'student-dashboard' }
|
||||
router.push(target).catch(() => router.push('/'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ const { isModal, openModal } = useModal()
|
||||
const { data: registerData } = useGetRegisterDataQuery()
|
||||
watch(
|
||||
registerData,
|
||||
(list) => {
|
||||
if (Array.isArray(list) && list.length > 0) store.hydrateFromKeyValueList(list)
|
||||
(value) => {
|
||||
if (value && Object.keys(value).length > 0) store.hydrateFromRegisterData(value)
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ export const personalInformationSchema = object().shape({
|
||||
avatar: mixed().notRequired(),
|
||||
avatarId: mixed().notRequired(),
|
||||
name: requiredString(3),
|
||||
birthDate: string().required(),
|
||||
birthday: string().required(),
|
||||
nationalCode: nationalCodeRule,
|
||||
maritalStatus: string().required(),
|
||||
gender: string().required(),
|
||||
|
||||
@@ -10,7 +10,7 @@ const emptyState = () => ({
|
||||
avatar: null,
|
||||
avatarId: '',
|
||||
name: '',
|
||||
birthDate: '',
|
||||
birthday: '',
|
||||
nationalCode: '',
|
||||
maritalStatus: '',
|
||||
gender: '',
|
||||
@@ -75,7 +75,7 @@ const SECTION_FIELDS = {
|
||||
'avatar',
|
||||
'avatarId',
|
||||
'name',
|
||||
'birthDate',
|
||||
'birthday',
|
||||
'nationalCode',
|
||||
'maritalStatus',
|
||||
'gender',
|
||||
@@ -115,15 +115,16 @@ const FIELD_TO_SECTION = Object.entries(SECTION_FIELDS).reduce((acc, [section, f
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
export const toKeyValueList = (obj = {}) =>
|
||||
Object.entries(obj).map(([key, value]) => ({ key, value }))
|
||||
|
||||
export const fromKeyValueList = (list = []) => {
|
||||
if (!Array.isArray(list)) return {}
|
||||
return list.reduce((acc, item) => {
|
||||
if (item && typeof item === 'object' && 'key' in item) acc[item.key] = item.value
|
||||
return acc
|
||||
}, {})
|
||||
// Register-data travels as a flat `{ field: value }` object. Legacy payloads
|
||||
// were a `[{ key, value }]` list — tolerate both when reading.
|
||||
export const toRegisterDataObject = (input) => {
|
||||
if (Array.isArray(input)) {
|
||||
return input.reduce((acc, item) => {
|
||||
if (item && typeof item === 'object' && 'key' in item) acc[item.key] = item.value
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
return input && typeof input === 'object' ? input : {}
|
||||
}
|
||||
|
||||
const readPersisted = () => {
|
||||
@@ -241,10 +242,11 @@ export const useStudentRegistrationStore = defineStore('studentRegistration', ()
|
||||
: personal.value.avatarId,
|
||||
})
|
||||
|
||||
// Take the flat `{key,value}` list from GET /me/register-data and slot each
|
||||
// value into the right section ref, leaving anything we don't recognise alone.
|
||||
const hydrateFromKeyValueList = (list) => {
|
||||
const flat = fromKeyValueList(list)
|
||||
// Take the flat `{ field: value }` map from GET /me/register-data and slot
|
||||
// each value into the right section ref, leaving anything we don't
|
||||
// recognise alone.
|
||||
const hydrateFromRegisterData = (input) => {
|
||||
const flat = toRegisterDataObject(input)
|
||||
const buckets = {}
|
||||
Object.entries(flat).forEach(([key, value]) => {
|
||||
const section = FIELD_TO_SECTION[key]
|
||||
@@ -301,7 +303,7 @@ export const useStudentRegistrationStore = defineStore('studentRegistration', ()
|
||||
goToPrevStep,
|
||||
canGoToStep,
|
||||
buildCompletePayload,
|
||||
hydrateFromKeyValueList,
|
||||
hydrateFromRegisterData,
|
||||
reset,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,6 +3,11 @@ export default [
|
||||
path: '/counselor/consultations',
|
||||
name: 'counselor-consultations',
|
||||
component: () => import('@/features/counselor/pages/CounselorConsultationsPage.vue'),
|
||||
meta: { layout: 'counselor', role: 'counselor', title: 'مشاوره' },
|
||||
meta: {
|
||||
layout: 'counselor',
|
||||
role: 'counselor',
|
||||
title: 'مرکز مشاوره',
|
||||
subtitle: 'جلسات مشاوره را پیگیری کرده و پاسخگوی نیازهای کاربران باشید.',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="missionary-request" @click="emit('show-details', request)">
|
||||
<div class="missionary-request__heading">
|
||||
<p class="missionary-request__title">{{ request.title }}</p>
|
||||
<p class="missionary-request__subtitle">{{ request.requesterName }}</p>
|
||||
</div>
|
||||
|
||||
<div class="missionary-request__meta">
|
||||
<div class="missionary-request__pill">
|
||||
<span class="missionary-request__pill-label">تاریخ درخواست :</span>
|
||||
<span class="missionary-request__pill-value">
|
||||
{{ formatJalaaliDate(request.requestedDate) || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="missionary-request__pill">
|
||||
<span class="missionary-request__pill-label">مکان :</span>
|
||||
<span class="missionary-request__pill-value missionary-request__pill-value--fa">
|
||||
{{ request.location || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<Badge :variant="statusVariant" :dot="true" :value="statusLabel" />
|
||||
</div>
|
||||
|
||||
<div class="missionary-request__actions" @click.stop>
|
||||
<CircleButton
|
||||
v-if="request.status !== 'accepted'"
|
||||
tooltip="پذیرش درخواست"
|
||||
bg-color="rgba(0, 154, 18, 0.08)"
|
||||
size="2.5rem"
|
||||
@click="emit('change-status', { id: request.id, status: 'accepted' })"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="check" :size="20" color="var(--color-secondary)" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
v-if="request.status !== 'rejected'"
|
||||
tooltip="رد درخواست"
|
||||
bg-color="rgba(204, 40, 49, 0.08)"
|
||||
size="2.5rem"
|
||||
@click="emit('change-status', { id: request.id, status: 'rejected' })"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" color="var(--color-error)" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<BaseButton
|
||||
text="جزئیات درخواست"
|
||||
custom-class="missionary-request__details-btn"
|
||||
@click="emit('show-details', request)"
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="caret-left" :size="16" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import Badge from '@/components/Badge.vue'
|
||||
import { MISSIONARY_REQUEST_STATUS } from '@/enums'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
import CircleButton from '@/components/CircleButton.vue'
|
||||
|
||||
const STATUS_VARIANTS = {
|
||||
pending: 'warning',
|
||||
seen: 'info',
|
||||
accepted: 'success',
|
||||
rejected: 'danger',
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
request: { type: Object, required: true },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['show-details', 'change-status'])
|
||||
|
||||
const statusLabel = computed(() => MISSIONARY_REQUEST_STATUS[props.request.status] || '—')
|
||||
const statusVariant = computed(() => STATUS_VARIANTS[props.request.status] || 'neutral')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.missionary-request {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 1rem;
|
||||
background: rgba(255, 255, 255, 58%);
|
||||
box-shadow: 0 6.75px 19.425px rgba(0, 0, 0, 4%);
|
||||
border-radius: 0.875rem;
|
||||
margin-bottom: 0.625rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 75%);
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
&__heading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
flex: 1 1 33%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 400;
|
||||
font-size: 0.95rem;
|
||||
color: #4b4b4b;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 300;
|
||||
font-size: 0.75rem;
|
||||
color: #848484;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
flex: 1 1 40%;
|
||||
}
|
||||
|
||||
&__pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
background: rgba(107, 107, 107, 5%);
|
||||
padding: 0.25rem 1rem;
|
||||
border-radius: 0.875rem;
|
||||
white-space: nowrap;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&__pill-label {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 300;
|
||||
font-size: 0.75rem;
|
||||
color: #848484;
|
||||
}
|
||||
|
||||
&__pill-value {
|
||||
font-family: var(--font-family-en);
|
||||
font-size: 0.75rem;
|
||||
color: #5d5d5d;
|
||||
|
||||
&--fa {
|
||||
font-family: var(--font-family-fa);
|
||||
}
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
&__details-btn {
|
||||
min-width: 9rem;
|
||||
padding: 0 0.625rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
title="جزئیات درخواست"
|
||||
title-en="Request Details"
|
||||
width="95%"
|
||||
max-width="50rem"
|
||||
min-width="auto"
|
||||
:show-close-button="true"
|
||||
>
|
||||
<template #default="{ close }">
|
||||
<div class="request-details">
|
||||
<SkeletonLoaderBlock v-if="isLoading" :rows="3" :cols-per-row="1" />
|
||||
|
||||
<template v-else-if="request">
|
||||
<div class="request-details__status">
|
||||
<Badge :variant="statusVariant" :dot="true" :value="statusLabel" />
|
||||
</div>
|
||||
|
||||
<div class="request-details__grid">
|
||||
<LineInfoBlock title="عنوان درخواست" :desc="request.title || '—'" />
|
||||
<LineInfoBlock title="نام درخواست کننده" :desc="request.requesterName || '—'" />
|
||||
<LineInfoBlock title="شماره تماس" :numeric-desc="request.requesterPhone || '—'" />
|
||||
<LineInfoBlock title="ایمیل" :numeric-desc="request.requesterEmail || '—'" />
|
||||
<LineInfoBlock title="مکان" :desc="request.location || '—'" />
|
||||
<LineInfoBlock
|
||||
title="تاریخ درخواست"
|
||||
:numeric-desc="formatJalaaliDate(request.requestedDate) || '—'"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="تاریخ ثبت"
|
||||
:numeric-desc="formatJalaaliDateTime(request.createdAt) || '—'"
|
||||
/>
|
||||
<LineInfoBlock title="منبع درخواست" :desc="request.externalSource || '—'" />
|
||||
<div class="request-details__cell--full">
|
||||
<LineInfoBlock title="توضیحات" :desc="request.description || '—'" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<NoItems v-else title="یافت نشد" desc="اطلاعات این درخواست در دسترس نیست." />
|
||||
|
||||
<div class="request-details__actions">
|
||||
<BaseButton text="بسیار خب" custom-class="request-details__btn" @click="close">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import Badge from '@/components/Badge.vue'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { MISSIONARY_REQUEST_STATUS } from '@/enums'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import NoItems from '@/components/blocks/NoItems.vue'
|
||||
import LineInfoBlock from '@/components/blocks/LineInfoBlock.vue'
|
||||
import { formatJalaaliDate, formatJalaaliDateTime } from '@/utils/date-utils'
|
||||
import SkeletonLoaderBlock from '@/components/blocks/SkeletonLoaderBlock.vue'
|
||||
import { useMissionaryRequestQuery } from '@/services/query/missionary-requests'
|
||||
|
||||
defineOptions({ name: 'MissionaryRequestDetailsModal' })
|
||||
|
||||
const STATUS_VARIANTS = {
|
||||
pending: 'warning',
|
||||
seen: 'info',
|
||||
accepted: 'success',
|
||||
rejected: 'danger',
|
||||
}
|
||||
|
||||
const { getModal } = useModal()
|
||||
|
||||
const modalData = computed(() => getModal('MissionaryRequestDetailsModal')?.data ?? {})
|
||||
const requestId = computed(() => modalData.value.id ?? null)
|
||||
|
||||
const { data: request, isLoading } = useMissionaryRequestQuery(requestId, {
|
||||
enabled: () => !!requestId.value,
|
||||
})
|
||||
|
||||
const statusLabel = computed(() => MISSIONARY_REQUEST_STATUS[request.value?.status] || '—')
|
||||
const statusVariant = computed(() => STATUS_VARIANTS[request.value?.status] || 'neutral')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.request-details {
|
||||
width: 100%;
|
||||
text-align: start;
|
||||
|
||||
&__status {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.25rem;
|
||||
|
||||
@media (min-width: 640px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
&__cell--full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
min-width: 12rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1 @@
|
||||
export { default as MissionaryRequestDetailsModal } from './components/modals/MissionaryRequestDetailsModal.vue'
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="missionary-requests-page">
|
||||
<BoxedIconTitleBlock
|
||||
class="missionary-requests-page__heading"
|
||||
title="لیست درخواست ها"
|
||||
desc="در این قسمت میتوانید درخواستهای اعزام خود را مدیریت کنید"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="user-sound" :size="24" color="var(--color-primary)" />
|
||||
</template>
|
||||
</BoxedIconTitleBlock>
|
||||
|
||||
<SimpleTitleIconBlock title="لیست همه درخواستها" class="missionary-requests-page__list-title">
|
||||
<template #header-icon>
|
||||
<SvgIcon name="list-bullets" :size="16" color="#bcbcbc" />
|
||||
</template>
|
||||
</SimpleTitleIconBlock>
|
||||
|
||||
<SkeletonLoaderBlock v-if="isLoading" :rows="6" :cols-per-row="1" />
|
||||
<div v-else-if="requests.length > 0">
|
||||
<MissionaryRequestItem
|
||||
v-for="request in requests"
|
||||
:key="request.id"
|
||||
:request="request"
|
||||
@show-details="onShowDetails"
|
||||
@change-status="onAskChangeStatus"
|
||||
/>
|
||||
</div>
|
||||
<NoItems v-else title="متاسفیم" desc="درخواستی برای نمایش وجود ندارد." />
|
||||
|
||||
<MissionaryRequestDetailsModal v-if="isModal('MissionaryRequestDetailsModal')" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import NoItems from '@/components/blocks/NoItems.vue'
|
||||
import BoxedIconTitleBlock from '@/components/blocks/BoxedIconTitleBlock.vue'
|
||||
import SkeletonLoaderBlock from '@/components/blocks/SkeletonLoaderBlock.vue'
|
||||
import SimpleTitleIconBlock from '@/components/blocks/SimpleTitleIconBlock.vue'
|
||||
import MissionaryRequestItem from '@/features/missionary/components/MissionaryRequestItem.vue'
|
||||
import MissionaryRequestDetailsModal from '@/features/missionary/components/modals/MissionaryRequestDetailsModal.vue'
|
||||
import {
|
||||
missionaryRequestsKeys,
|
||||
useChangeMissionaryRequestStatusMutation,
|
||||
useMissionaryRequestsListQuery,
|
||||
} from '@/services/query/missionary-requests'
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
const { openModal, isModal } = useModal()
|
||||
|
||||
const { data, isLoading } = useMissionaryRequestsListQuery()
|
||||
|
||||
const requests = computed(() => data.value ?? [])
|
||||
|
||||
const invalidate = () =>
|
||||
queryClient.invalidateQueries({ queryKey: missionaryRequestsKeys.all, refetchType: 'all' })
|
||||
|
||||
const statusMutation = useChangeMissionaryRequestStatusMutation()
|
||||
|
||||
const changeStatus = (id, status) =>
|
||||
statusMutation.mutate({ id, payload: { status } }, { onSuccess: invalidate })
|
||||
|
||||
const onShowDetails = (request) => {
|
||||
openModal('MissionaryRequestDetailsModal', { id: request.id })
|
||||
if (request.status === 'pending') changeStatus(request.id, 'seen')
|
||||
}
|
||||
|
||||
const STATUS_CONFIRMS = {
|
||||
accepted: { title: 'پذیرش درخواست', verb: 'پذیرش' },
|
||||
rejected: { title: 'رد درخواست', verb: 'رد' },
|
||||
}
|
||||
|
||||
const onAskChangeStatus = ({ id, status }) => {
|
||||
const config = STATUS_CONFIRMS[status]
|
||||
if (!config) return
|
||||
const request = requests.value.find((r) => r.id === id)
|
||||
openModal('ConfirmModal', {
|
||||
title: config.title,
|
||||
message: `آیا از ${config.verb} درخواست <strong>${request?.title || ''}</strong> مطمئن هستید؟`,
|
||||
onConfirm: () => changeStatus(id, status),
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.missionary-requests-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
|
||||
&__heading {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
&__list-title {
|
||||
margin-bottom: 0.375rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,24 @@
|
||||
export default [
|
||||
{
|
||||
path: '/missionary-panel/requests',
|
||||
name: 'missionary-requests',
|
||||
component: () => import('@/features/missionary/pages/MissionaryRequestsPage.vue'),
|
||||
meta: {
|
||||
layout: 'missionary',
|
||||
role: 'missionary',
|
||||
title: 'سیستم مدیریت اعزام',
|
||||
subtitle: 'سادهترین راه برای برنامهریزی و پایش مأموریتها',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/missionary-panel/tickets',
|
||||
name: 'missionary-tickets',
|
||||
component: () => import('@/features/student/tickets/pages/StudentTicketsPage.vue'),
|
||||
meta: {
|
||||
layout: 'missionary',
|
||||
role: 'missionary',
|
||||
title: 'تیکتهای شما',
|
||||
subtitle: 'اینجا پل ارتباطی شما با پشتیبانی است.',
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -3,90 +3,165 @@ export default [
|
||||
path: '/dashboard',
|
||||
name: 'student-dashboard',
|
||||
component: () => import('@/features/student/pages/StudentDashboardPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'پیشخوان' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'سلام بر شما',
|
||||
subtitle: 'به سامانه موسسه بانو خوش آمدید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/profile',
|
||||
name: 'student-profile',
|
||||
component: () => import('@/features/student/profile/pages/EditProfilePage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'ویرایش پروفایل' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'پروفایل شما',
|
||||
subtitle: 'مشخصاتتان را ویرایش نمایید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-courses',
|
||||
name: 'student-courses',
|
||||
component: () => import('@/features/student/courses/pages/StudentCoursesPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'دورههای من' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-courses/:id',
|
||||
name: 'student-course-details',
|
||||
component: () => import('@/features/student/courses/pages/StudentCourseDetailsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'جزئیات دوره' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-terms',
|
||||
name: 'student-terms',
|
||||
component: () => import('@/features/student/terms/pages/StudentTermsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'ترمهای آموزشی' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-terms/:id',
|
||||
name: 'student-term-details',
|
||||
component: () => import('@/features/student/terms/pages/StudentTermDetailsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'جزئیات دوره' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-lessons/:id',
|
||||
name: 'student-lesson-details',
|
||||
component: () => import('@/features/student/lessons/pages/StudentLessonDetailsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'جزئیات درس' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-sessions/:id',
|
||||
name: 'student-session-details',
|
||||
component: () => import('@/features/student/sessions/pages/StudentSessionDetailsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'جزئیات جلسه' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-exams/:id',
|
||||
name: 'student-exam',
|
||||
component: () => import('@/features/student/exams/pages/StudentExamPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'آزمون' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-exams/:id/take',
|
||||
name: 'student-take-exam',
|
||||
component: () => import('@/features/student/exams/pages/StudentTakeExamPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'شروع آزمون' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'یادگیری شما',
|
||||
subtitle: 'مهارتها و دورههای خود را دنبال کنید.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/missionary',
|
||||
name: 'student-missionary',
|
||||
component: () => import('@/features/student/missionary/pages/StudentMissionaryPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'سامانه اعزام' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'سیستم مدیریت اعزام',
|
||||
subtitle: 'سادهترین راه برای برنامهریزی و پایش مأموریتها',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/user/services',
|
||||
name: 'student-services',
|
||||
component: () => import('@/features/student/services/pages/StudentServicesPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'خدمات' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'درخواست خدمت',
|
||||
subtitle: 'فقط یک مرحله تا شروع کار شما.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/user/consultants',
|
||||
name: 'student-consultants',
|
||||
component: () => import('@/features/student/consultants/pages/StudentConsultantsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'مشاوره' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'مشاوره سریع',
|
||||
subtitle: 'چند ثانیه برای دریافت مشاوره کافیست.',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/user/certificates',
|
||||
name: 'student-certificates',
|
||||
component: () => import('@/features/student/certificates/pages/StudentCertificatesPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'گواهینامه ها' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'گواهینامه معتبر',
|
||||
subtitle: 'نشان اعتماد و تخصص ما در هر حوزه',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/my-tickets',
|
||||
name: 'student-tickets',
|
||||
component: () => import('@/features/student/tickets/pages/StudentTicketsPage.vue'),
|
||||
meta: { layout: 'student', role: 'student', title: 'تیکتهای من' },
|
||||
meta: {
|
||||
layout: 'student',
|
||||
role: 'student',
|
||||
title: 'تیکتهای شما',
|
||||
subtitle: 'اینجا پل ارتباطی شما با پشتیبانی است.',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
</div>
|
||||
|
||||
<SkeletonLoaderBlock v-if="isLoading && !ticket" :rows="3" :cols-per-row="1" />
|
||||
<div v-else-if="messages.length > 0" ref="thread" class="ticket-details__thread">
|
||||
<div
|
||||
v-else-if="messages.length > 0 || ticketMedia.length > 0"
|
||||
ref="thread"
|
||||
class="ticket-details__thread"
|
||||
>
|
||||
<div v-if="ticketMedia.length > 0" class="ticket-details__row ticket-details__row--self">
|
||||
<div class="ticket-details__bubble">
|
||||
<MessageAttachments :media="ticketMedia" />
|
||||
<span class="ticket-details__time">{{ messageTime(ticket) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="message in messages"
|
||||
:key="message.id"
|
||||
@@ -22,6 +32,7 @@
|
||||
:class="`ticket-details__row--${senderClass(message)}`"
|
||||
>
|
||||
<div class="ticket-details__bubble">
|
||||
<MessageAttachments v-if="message.media?.length" :media="message.media" />
|
||||
<p class="ticket-details__text">{{ message.message }}</p>
|
||||
<span class="ticket-details__time">{{ messageTime(message) }}</span>
|
||||
</div>
|
||||
@@ -60,6 +71,7 @@ import BasicModal from '@/components/BasicModal.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import NoItems from '@/components/blocks/NoItems.vue'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
import MessageAttachments from '@/components/blocks/MessageAttachments.vue'
|
||||
import SkeletonLoaderBlock from '@/components/blocks/SkeletonLoaderBlock.vue'
|
||||
import {
|
||||
studentTicketsKeys,
|
||||
@@ -81,6 +93,8 @@ const { data: ticket, isLoading } = useStudentTicketQuery(ticketId, {
|
||||
|
||||
const messages = computed(() => ticket.value?.messages ?? [])
|
||||
|
||||
const ticketMedia = computed(() => ticket.value?.media ?? [])
|
||||
|
||||
const ticketDate = computed(() => formatJalaaliDate(ticket.value?.createdAt) || '—')
|
||||
|
||||
// Student viewing their own ticket — their own messages get the highlighted
|
||||
|
||||
Reference in New Issue
Block a user