first commit
This commit is contained in:
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<div class="verification-item">
|
||||
<div class="verification-item__user">
|
||||
<div v-if="user.avatarUrl" class="verification-item__avatar">
|
||||
<img :src="user.avatarUrl" :alt="fullName" />
|
||||
</div>
|
||||
<div v-else class="verification-item__avatar verification-item__avatar--placeholder">
|
||||
<SvgIcon name="user" :size="24" color="#bcbcbc" />
|
||||
</div>
|
||||
<div class="verification-item__info">
|
||||
<p class="verification-item__name">{{ fullName }}</p>
|
||||
<p class="verification-item__location">
|
||||
<span>{{ user.address?.province?.name || '—' }}</span>
|
||||
<span class="verification-item__sep">،</span>
|
||||
<span>{{ user.address?.city?.name || '—' }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="verification-item__meta">
|
||||
<div class="verification-item__date">
|
||||
<span class="verification-item__date-label">تاریخ ثبت نام:</span>
|
||||
<span class="verification-item__date-value">
|
||||
{{ user.faSubmittedAt || formatJalaaliDate(user.submittedAt) || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="user.status === 'pending'"
|
||||
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"
|
||||
@click="emit('show-reject-reason', user)"
|
||||
>
|
||||
<span class="verification-item__dot" />
|
||||
<span>رد شده</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="verification-item__actions">
|
||||
<CircleButton
|
||||
tooltip="تایید"
|
||||
bg-color="rgba(0, 154, 18, 0.08)"
|
||||
size="2.5rem"
|
||||
@click="emit('verify-user', { id: user.id, status: 'approved' })"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="check" :size="20" color="var(--color-secondary)" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
v-if="user.status !== 'rejected'"
|
||||
tooltip="عدم تایید"
|
||||
bg-color="rgba(204, 40, 49, 0.08)"
|
||||
size="2.5rem"
|
||||
@click="emit('verify-user', { id: user.id, status: 'rejected' })"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" color="var(--color-error)" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<BaseButton
|
||||
custom-class="verification-item__details-btn"
|
||||
text="جزئیات احراز هویت"
|
||||
:loading="detailsLoading"
|
||||
@click="emit('show-details', user.id)"
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="caret-left" :size="16" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import CircleButton from '@/components/CircleButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
|
||||
const props = defineProps({
|
||||
user: { type: Object, required: true },
|
||||
detailsLoading: { type: Boolean, default: false },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['show-details', 'show-reject-reason', 'verify-user'])
|
||||
|
||||
const fullName = computed(
|
||||
() => `${props.user.firstName || ''} ${props.user.lastName || ''}`.trim() || '—'
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.verification-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.625rem;
|
||||
padding: 0.75rem;
|
||||
background: rgba(255, 255, 255, 50%);
|
||||
box-shadow: 0 4px 10px -6px rgba(241, 241, 241, 70%);
|
||||
border-radius: 0.875rem;
|
||||
margin-bottom: 0.625rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
&__user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
flex: 1 1 33%;
|
||||
}
|
||||
|
||||
&__avatar {
|
||||
height: 3rem;
|
||||
width: 3rem;
|
||||
border-radius: 9999px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #eee;
|
||||
flex-shrink: 0;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&--placeholder {
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 400;
|
||||
font-size: 1rem;
|
||||
color: #4b4b4b;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__location {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-family: var(--font-family-fa);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 300;
|
||||
color: #848484;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__sep {
|
||||
color: #c4c4c4;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
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;
|
||||
}
|
||||
|
||||
&__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;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
flex: 1 1 33%;
|
||||
}
|
||||
|
||||
&__details-btn {
|
||||
min-width: 9rem;
|
||||
padding: 0 0.625rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<form class="verifications-filters" @submit.prevent="onSubmit">
|
||||
<div class="verifications-filters__grid">
|
||||
<TextField v-model="form.name" name="name" label="جستجو اسم کاربر">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="user" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<TextField
|
||||
v-model="form.nationalCode"
|
||||
name="nationalCode"
|
||||
label="کد ملی کاربر"
|
||||
inputmode="numeric"
|
||||
:convert-digits="true"
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="user" :size="20" color="var(--color-thd-gray)" />
|
||||
</template>
|
||||
</TextField>
|
||||
<DatePickerField v-model="form.fromDate" name="fromDate" label="از تاریخ" :max="todayIso" />
|
||||
<DatePickerField v-model="form.toDate" name="toDate" label="تا تاریخ" :max="todayIso" />
|
||||
</div>
|
||||
|
||||
<div class="verifications-filters__actions">
|
||||
<CircleButton
|
||||
v-if="hasFilters"
|
||||
tooltip="حذف فیلتر"
|
||||
bg-color="transparent"
|
||||
size="2.5rem"
|
||||
type="button"
|
||||
@click="onReset"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="close" :size="20" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
<CircleButton
|
||||
tooltip="اعمال فیلتر"
|
||||
bg-color="rgba(104, 104, 104, 0.05)"
|
||||
size="2.5rem"
|
||||
type="submit"
|
||||
>
|
||||
<template #icon>
|
||||
<SvgIcon name="funnel" :size="20" color="var(--color-error)" />
|
||||
</template>
|
||||
</CircleButton>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue'
|
||||
|
||||
import TextField from '@/components/form/TextField.vue'
|
||||
import DatePickerField from '@/components/form/DatePickerField.vue'
|
||||
import CircleButton from '@/components/CircleButton.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default: () => ({ name: '', nationalCode: '', fromDate: '', toDate: '' }),
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'apply', 'reset'])
|
||||
|
||||
const emptyForm = () => ({ name: '', nationalCode: '', fromDate: '', toDate: '' })
|
||||
|
||||
const form = ref({ ...emptyForm(), ...props.modelValue })
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(next) => {
|
||||
form.value = { ...emptyForm(), ...next }
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const todayIso = new Date().toISOString()
|
||||
|
||||
const hasFilters = computed(() =>
|
||||
Object.values(form.value).some((v) => v !== '' && v !== null && v !== undefined)
|
||||
)
|
||||
|
||||
const onSubmit = () => {
|
||||
emit('update:modelValue', { ...form.value })
|
||||
emit('apply', { ...form.value })
|
||||
}
|
||||
|
||||
const onReset = () => {
|
||||
form.value = emptyForm()
|
||||
emit('update:modelValue', { ...form.value })
|
||||
emit('reset')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.verifications-filters {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.625rem;
|
||||
|
||||
&__grid {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding-top: 1.75rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
title="جزئیات رد"
|
||||
title-en="Details for Rejection"
|
||||
width="95%"
|
||||
max-width="50rem"
|
||||
min-width="auto"
|
||||
:show-close-button="true"
|
||||
>
|
||||
<template #default="{ data, close }">
|
||||
<div class="reject-reason-details">
|
||||
<div class="reject-reason-details__grid">
|
||||
<div class="reject-reason-details__cell--full">
|
||||
<LineInfoBlock title="توضیحات" :desc="verification(data).adminNote || ''" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reject-reason-details__actions">
|
||||
<BaseButton text="بسیار خب" custom-class="reject-reason-details__btn" @click="close">
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import LineInfoBlock from '@/components/blocks/LineInfoBlock.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
|
||||
defineOptions({ name: 'RejectReasonDetailsModal' })
|
||||
|
||||
const verification = (data) => data?.verification || {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.reject-reason-details {
|
||||
width: 100%;
|
||||
text-align: start;
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.25rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: repeat(3, 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,154 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
title="علت رد"
|
||||
title-en="Reason for Rejection"
|
||||
width="95%"
|
||||
max-width="50rem"
|
||||
min-width="auto"
|
||||
:show-close-button="true"
|
||||
>
|
||||
<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"
|
||||
label="لطفا علت رد را توضیح دهید"
|
||||
:row="4"
|
||||
:error="errors.adminNote"
|
||||
/>
|
||||
|
||||
<div class="reject-reason-modal__divider" />
|
||||
|
||||
<div class="reject-reason-modal__actions">
|
||||
<BaseButton
|
||||
variant="transparent"
|
||||
text="منصرف شدم"
|
||||
custom-class="reject-reason-modal__btn-cancel"
|
||||
@click="close"
|
||||
>
|
||||
<template #prependIcon>
|
||||
<SvgIcon name="caret-right" :size="14" color="var(--color-sec-gray)" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
text="ارسال"
|
||||
:loading="changeStatusMutation.isPending.value"
|
||||
custom-class="reject-reason-modal__btn-submit"
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import TextField from '@/components/form/TextField.vue'
|
||||
import TextareaField from '@/components/form/TextareaField.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import useYup from '@/composables/useYup'
|
||||
import {
|
||||
adminPendingStudentsKeys,
|
||||
useChangePendingStudentStatusMutation,
|
||||
} from '@/services/query/admin-pending-students'
|
||||
import SelectField from '@/components/form/SelectField.vue'
|
||||
import { PRIORITY_STATUS } from '@/enums'
|
||||
import { rejectionReasonSchema } from '../../../schema'
|
||||
|
||||
defineOptions({ name: 'RejectReasonModal' })
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
const changeStatusMutation = useChangePendingStudentStatusMutation()
|
||||
|
||||
const DEFAULT_FORM = { rejectionReason: '', adminNote: '' }
|
||||
|
||||
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)
|
||||
console.log(errors)
|
||||
|
||||
if (!isValid) return
|
||||
const id = data?.id
|
||||
if (!id) return
|
||||
await changeStatusMutation.mutateAsync({
|
||||
id,
|
||||
payload: { status: 'rejected', ...payload },
|
||||
})
|
||||
await queryClient.invalidateQueries({ queryKey: adminPendingStudentsKeys.all })
|
||||
form.value = structuredClone({ ...DEFAULT_FORM })
|
||||
resetErrors()
|
||||
close()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.reject-reason-modal {
|
||||
width: 100%;
|
||||
text-align: start;
|
||||
padding: 0.5rem;
|
||||
|
||||
&__row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
&__divider {
|
||||
border-block-end: 1px solid var(--color-thd-gray);
|
||||
margin-block: 1rem;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&__btn-cancel {
|
||||
min-width: 9rem;
|
||||
}
|
||||
|
||||
&__btn-submit {
|
||||
min-width: 9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+491
@@ -0,0 +1,491 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
title="اطلاعات شخصی"
|
||||
title-en="Personal information"
|
||||
width="95%"
|
||||
max-width="80rem"
|
||||
min-width="auto"
|
||||
:show-close-button="true"
|
||||
>
|
||||
<template #default="{ data, close }">
|
||||
<div v-if="!user" class="user-verification-details">
|
||||
<p class="user-verification-details__loading">در حال بارگذاری…</p>
|
||||
</div>
|
||||
<div v-else class="user-verification-details">
|
||||
<section class="user-verification-details__section">
|
||||
<div class="user-verification-details__grid user-verification-details__grid--6">
|
||||
<LineInfoBlock title="نام و نام خانوادگی" :numeric-desc="fullName" />
|
||||
<LineInfoBlock
|
||||
title="تاریخ تولد"
|
||||
:numeric-desc="profile.faBirthDate || formatJalaaliDate(profile.birthDate) || ''"
|
||||
/>
|
||||
<LineInfoBlock title="شماره تماس" :numeric-desc="user.phoneNumber" />
|
||||
<LineInfoBlock title="کد ملی" :numeric-desc="user.nationalCode" />
|
||||
<LineInfoBlock
|
||||
title="وضعیت تاهل"
|
||||
:desc="profile.faMaritalStatus || MARITAL_STATUS[profile.maritalStatus] || ''"
|
||||
/>
|
||||
<LineInfoBlock title="جنسیت" :desc="profile.faGender || GENDER[profile.gender] || ''" />
|
||||
<LineInfoBlock title="استان" :desc="user.address?.province?.name || '-'" />
|
||||
<LineInfoBlock title="شهر" :desc="user.address?.city?.name || '-'" />
|
||||
<div class="user-verification-details__cell user-verification-details__cell--span-3">
|
||||
<LineInfoBlock title="آدرس" :desc="user.address?.address || '-'" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="اطلاعات تحصیلی" title-en="Academic information" />
|
||||
<div class="user-verification-details__grid user-verification-details__grid--4">
|
||||
<LineInfoBlock
|
||||
title="وضعیت تحصیلی"
|
||||
:desc="profile.faEducationStatus || EDUCATION_STATUS[profile.educationStatus] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="آخرین مدرک تحصیلی (طلبه)"
|
||||
:desc="profile.faSeminaryLevel || SEMINARY_LEVEL[profile.seminaryLevel] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="آخرین مدرک تحصیلی"
|
||||
:desc="profile.faUniversityLevel || UNIVERSITY_LEVEL[profile.universityLevel] || ''"
|
||||
/>
|
||||
<LineInfoBlock title="نام حوزه علمیه/دانشگاه" :desc="profile.universityName || ''" />
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="گرایش تخصصی حوزوی / رشته تحصیلی دانشگاهی"
|
||||
:desc="profile.fieldOfStudy || ''"
|
||||
/>
|
||||
</div>
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="خلاصهای از سوابق شغلی"
|
||||
:desc="profile.workExperienceSummary || ''"
|
||||
/>
|
||||
</div>
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="خلاصهای از فعالیتها در موقعیتهای شغلی"
|
||||
:desc="profile.activitySummary || ''"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="اطلاعات شغلی" title-en="Job information" />
|
||||
<div class="user-verification-details__grid user-verification-details__grid--4">
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="گرایش تخصصی حوزوی / رشته تحصیلی دانشگاهی"
|
||||
:desc="profile.fieldOfStudy || ''"
|
||||
/>
|
||||
</div>
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="خلاصهای از سوابق شغلی"
|
||||
:desc="profile.workExperienceSummary || ''"
|
||||
/>
|
||||
</div>
|
||||
<div class="user-verification-details__cell user-verification-details__cell--full">
|
||||
<LineInfoBlock
|
||||
title="خلاصهای از فعالیتها در موقعیتهای شغلی"
|
||||
:desc="profile.activitySummary || ''"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock
|
||||
title="اطلاعات فعالیت تبلیغاتی و حرفهای"
|
||||
title-en="Advertising and professional activity information"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="سابقه فعالیت تبلیغی شما چند سال میباشد؟"
|
||||
:numeric-desc="profile.propagationExperienceYears ?? ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="توضیحات مدل فعالیت تبلیغی"
|
||||
:desc="profile.propagationMethodDescription || ''"
|
||||
/>
|
||||
<LineInfoBlock title="موضوعات تخصصی تبلیغی" :desc="profile.specializedTopics || ''" />
|
||||
<LineInfoBlock title="بسترهای فعالیت تبلیغی" :desc="platformsLabel" />
|
||||
<LineInfoBlock
|
||||
v-if="otherPlatformDetails"
|
||||
title="توضیح فعالیت در سایر فضاهای تبلیغی"
|
||||
:desc="otherPlatformDetails"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
v-if="onlinePlatformDetails"
|
||||
title="نام شبکه و مدل فعالیت تبلیغی"
|
||||
:desc="onlinePlatformDetails"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="مهارتها و تخصصها (1)" title-en="Skills and Specialties" />
|
||||
<LineInfoBlock
|
||||
title="عملکرد در شرایط رضایت پایین مخاطبین"
|
||||
:desc="LOW_SATISFACTION_RESPONSE[profile.responseToLowSatisfaction] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
v-if="profile.responseToLowSatisfactionDescription"
|
||||
title="توضیح گزینه «سایر»"
|
||||
:desc="profile.responseToLowSatisfactionDescription"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="مهارتها و تخصصها (2)" title-en="Skills and Specialties" />
|
||||
<LineInfoBlock
|
||||
title="مواجهه با تعطیلی جلسه به دلیل هزینه"
|
||||
:desc="SESSION_CANCELLATION_RESPONSE[profile.responseToSessionCancellation] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
v-if="profile.responseToSessionCancellationDescription"
|
||||
title="توضیح گزینه «سایر»"
|
||||
:desc="profile.responseToSessionCancellationDescription"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="مهارتها و تخصصها (3)" title-en="Skills and Specialties" />
|
||||
<LineInfoBlock
|
||||
title="مواجهه با تناقض درخواست مخاطبین"
|
||||
:desc="AUDIENCE_CONFLICT_RESPONSE[profile.responseToAudienceConflict] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
v-if="profile.responseToAudienceConflictDescription"
|
||||
title="توضیح گزینه «سایر»"
|
||||
:desc="profile.responseToAudienceConflictDescription"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="مهارتها و تخصصها (4)" title-en="Skills and Specialties" />
|
||||
<LineInfoBlock
|
||||
title="مواجهه با مبلغه رقیب"
|
||||
:desc="COMPETING_PROPAGATOR_RESPONSE[profile.responseToCompetingPropagator] || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
v-if="profile.responseToCompetingPropagatorDescription"
|
||||
title="توضیح گزینه «سایر»"
|
||||
:desc="profile.responseToCompetingPropagatorDescription"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="user-verification-details__section">
|
||||
<LineTitleBlock title="مهارتها و تخصصها (5)" title-en="Skills and Specialties" />
|
||||
<LineInfoBlock
|
||||
title="مواجهه با مدعیان نسخههای دینی"
|
||||
:desc="profile.responseToUnqualifiedAdvisors || ''"
|
||||
/>
|
||||
<LineInfoBlock
|
||||
title="مدارک و گواهینامههای مرتبط"
|
||||
:desc="profile.relevantCertificates || ''"
|
||||
/>
|
||||
<LineInfoBlock title="مواجهه با موضوع حجاب" :desc="profile.hijabApproach || ''" />
|
||||
</section>
|
||||
|
||||
<section v-if="faithProduction?.url" class="user-verification-details__section">
|
||||
<LineTitleBlock title="بخش صوت" title-en="Audio section" />
|
||||
<LineInfoBlock title="نظر و تحلیل از ویدئو ارائه شده" />
|
||||
<audio :src="faithProduction.url" controls class="user-verification-details__audio" />
|
||||
</section>
|
||||
|
||||
<section v-if="leaderMessage?.url" class="user-verification-details__section">
|
||||
<LineTitleBlock title="بخش تصویر" title-en="Video section" />
|
||||
<LineInfoBlock title="درک و برداشت از پیام رهبری" />
|
||||
<video
|
||||
:src="leaderMessage.url"
|
||||
controls
|
||||
playsinline
|
||||
class="user-verification-details__video"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<div class="user-verification-details__divider" />
|
||||
|
||||
<div class="user-verification-details__actions">
|
||||
<BaseButton
|
||||
text="ذخیره به صورت PDF"
|
||||
:loading="pdfLoading"
|
||||
custom-class="user-verification-details__pdf-btn"
|
||||
@click="onSaveAsPdf(data, close)"
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
import CircleButton from '@/components/CircleButton.vue'
|
||||
import LineTitleBlock from '@/components/LineTitleBlock.vue'
|
||||
import LineInfoBlock from '@/components/blocks/LineInfoBlock.vue'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import useModal from '@/composables/useModal'
|
||||
import {
|
||||
AUDIENCE_CONFLICT_RESPONSE,
|
||||
COMPETING_PROPAGATOR_RESPONSE,
|
||||
EDUCATION_STATUS,
|
||||
GENDER,
|
||||
LOW_SATISFACTION_RESPONSE,
|
||||
MARITAL_STATUS,
|
||||
PROPAGATION_PLATFORM,
|
||||
SEMINARY_LEVEL,
|
||||
SESSION_CANCELLATION_RESPONSE,
|
||||
UNIVERSITY_LEVEL,
|
||||
USER_STATUS,
|
||||
VERIFICATION_MEDIA_TYPE,
|
||||
} from '@/enums'
|
||||
import { formatJalaaliDate } from '@/utils/date-utils'
|
||||
import {
|
||||
usePendingStudentQuery,
|
||||
useDownloadPendingStudentPdfMutation,
|
||||
} from '@/services/query/admin-pending-students'
|
||||
|
||||
defineOptions({ name: 'UserVerificationDetailsModal' })
|
||||
|
||||
const { getModal } = useModal()
|
||||
|
||||
const modalData = computed(() => getModal('UserVerificationDetailsModal')?.data ?? {})
|
||||
const userId = computed(() => modalData.value.id ?? null)
|
||||
const userIdRef = computed(() => userId.value)
|
||||
|
||||
const { data: fetched } = usePendingStudentQuery(userIdRef, {
|
||||
enabled: () => !!userIdRef.value,
|
||||
})
|
||||
|
||||
const user = computed(() => modalData.value.user || fetched.value || null)
|
||||
const profile = computed(() => user.value?.profile || {})
|
||||
const fullName = computed(
|
||||
() => `${user.value?.firstName || ''} ${user.value?.lastName || ''}`.trim() || '—'
|
||||
)
|
||||
|
||||
const platforms = computed(() =>
|
||||
Array.isArray(profile.value.propagationPlatforms) ? profile.value.propagationPlatforms : []
|
||||
)
|
||||
|
||||
const platformsLabel = computed(() =>
|
||||
platforms.value
|
||||
.map((p) => PROPAGATION_PLATFORM[p.platform] || p.platform)
|
||||
.filter(Boolean)
|
||||
.join(' ، ')
|
||||
)
|
||||
|
||||
const otherPlatformDetails = computed(
|
||||
() => platforms.value.find((p) => p.platform === 'other')?.platformDetails || ''
|
||||
)
|
||||
const onlinePlatformDetails = computed(
|
||||
() => platforms.value.find((p) => p.platform === 'online')?.platformDetails || ''
|
||||
)
|
||||
|
||||
const verificationMedia = computed(() => user.value?.verification?.media || [])
|
||||
const faithProduction = computed(() =>
|
||||
verificationMedia.value.find((m) => m.type === VERIFICATION_MEDIA_TYPE.FAITH_PRODUCTION)
|
||||
)
|
||||
const leaderMessage = computed(() =>
|
||||
verificationMedia.value.find((m) => m.type === VERIFICATION_MEDIA_TYPE.LEADER_MESSAGE)
|
||||
)
|
||||
|
||||
const statusLabel = (status) => {
|
||||
if (status === 'pending') return 'در انتظار تایید'
|
||||
if (status === 'rejected') return 'رد شده'
|
||||
return USER_STATUS[status] || status || ''
|
||||
}
|
||||
|
||||
const pdfLoading = ref(false)
|
||||
const pdfMutation = useDownloadPendingStudentPdfMutation()
|
||||
|
||||
const onSaveAsPdf = async (data, close) => {
|
||||
if (!user.value?.id) return
|
||||
pdfLoading.value = true
|
||||
try {
|
||||
const response = await pdfMutation.mutateAsync(user.value.id)
|
||||
const url = response?.data?.downloadUrl || response?.downloadUrl
|
||||
if (url) {
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.target = '_blank'
|
||||
link.download = 'profile.pdf'
|
||||
document.body.append(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
}
|
||||
close()
|
||||
} finally {
|
||||
pdfLoading.value = false
|
||||
}
|
||||
data
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.user-verification-details {
|
||||
width: 100%;
|
||||
text-align: start;
|
||||
|
||||
&__loading {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: var(--color-prim-gray);
|
||||
}
|
||||
|
||||
&__section {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.25rem;
|
||||
|
||||
&--4 {
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
&--6 {
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__cell {
|
||||
&--span-2 {
|
||||
@media (min-width: 768px) {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
|
||||
&--span-3 {
|
||||
@media (min-width: 768px) {
|
||||
grid-column: span 3;
|
||||
}
|
||||
}
|
||||
|
||||
&--full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
|
||||
&__person {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
&__avatar {
|
||||
height: 6rem;
|
||||
width: 6rem;
|
||||
min-width: 6rem;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&--placeholder {
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__person-info {
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
&__person-label {
|
||||
font-family: var(--font-family-fa);
|
||||
font-size: 0.75rem;
|
||||
color: #b7b7b7;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__person-name {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 500;
|
||||
font-size: 0.875rem;
|
||||
color: #4b4b4b;
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
&__status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
font-size: 0.75rem;
|
||||
margin: 0;
|
||||
|
||||
&--pending {
|
||||
background: rgba(0, 255, 68, 6%);
|
||||
}
|
||||
|
||||
&--rejected {
|
||||
background: rgba(204, 40, 49, 6%);
|
||||
}
|
||||
}
|
||||
|
||||
&__status-label {
|
||||
color: #808080;
|
||||
padding-inline: 0.125rem;
|
||||
}
|
||||
|
||||
&__status-value {
|
||||
font-family: var(--font-family-fa);
|
||||
font-weight: 500;
|
||||
font-size: 0.875rem;
|
||||
padding-inline: 0.125rem;
|
||||
|
||||
/* stylelint-disable-next-line selector-class-pattern */
|
||||
.user-verification-details__status-badge--pending & {
|
||||
color: #009a12;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line selector-class-pattern */
|
||||
.user-verification-details__status-badge--rejected & {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
&__audio,
|
||||
&__video {
|
||||
width: 100%;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
&__divider {
|
||||
border-block-end: 1px solid var(--color-thd-gray);
|
||||
margin-block: 1.5rem;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
&__pdf-btn {
|
||||
min-width: 12rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user