@@ -12,12 +12,8 @@
|
|||||||
|
|
||||||
<div class="term-item__dates">
|
<div class="term-item__dates">
|
||||||
<div class="term-item__date">
|
<div class="term-item__date">
|
||||||
<span class="term-item__date-label">تاریخ شروع:</span>
|
<span class="term-item__date-label">تاریخ ایجاد:</span>
|
||||||
<span class="term-item__date-value">{{ startDate || '—' }}</span>
|
<span class="term-item__date-value">{{ createdDate || '—' }}</span>
|
||||||
</div>
|
|
||||||
<div class="term-item__date">
|
|
||||||
<span class="term-item__date-label">تاریخ پایان:</span>
|
|
||||||
<span class="term-item__date-value">{{ endDate || '—' }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -80,8 +76,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits(['edit', 'delete', 'clone', 'change-status', 'show-details'])
|
const emit = defineEmits(['edit', 'delete', 'clone', 'change-status', 'show-details'])
|
||||||
|
|
||||||
const startDate = computed(() => formatJalaaliDate(props.term.startsAt) || '')
|
const createdDate = computed(() => formatJalaaliDate(props.term.createdAt) || '')
|
||||||
const endDate = computed(() => formatJalaaliDate(props.term.endsAt) || '')
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -21,12 +21,8 @@
|
|||||||
<div class="term-details__overview-grid">
|
<div class="term-details__overview-grid">
|
||||||
<LineInfoBlock title="عنوان ترم" :desc="term.title || '-'" />
|
<LineInfoBlock title="عنوان ترم" :desc="term.title || '-'" />
|
||||||
<LineInfoBlock
|
<LineInfoBlock
|
||||||
title="تاریخ شروع"
|
title="تاریخ ایجاد"
|
||||||
:numeric-desc="formatJalaaliDate(term.startsAt) || '-'"
|
:numeric-desc="formatJalaaliDate(term.createdAt) || '-'"
|
||||||
/>
|
|
||||||
<LineInfoBlock
|
|
||||||
title="تاریخ پایان"
|
|
||||||
:numeric-desc="formatJalaaliDate(term.endsAt) || '-'"
|
|
||||||
/>
|
/>
|
||||||
<LineInfoBlock title="تعداد طلبهها" :numeric-desc="term.studentsCount ?? 0" />
|
<LineInfoBlock title="تعداد طلبهها" :numeric-desc="term.studentsCount ?? 0" />
|
||||||
<LineInfoBlock title="تعداد دورهها" :numeric-desc="term.coursesCount ?? 0" />
|
<LineInfoBlock title="تعداد دورهها" :numeric-desc="term.coursesCount ?? 0" />
|
||||||
|
|||||||
@@ -30,24 +30,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</TextField>
|
</TextField>
|
||||||
</div>
|
</div>
|
||||||
<div class="term-form__cell term-form__cell--third">
|
|
||||||
<DatePickerField
|
|
||||||
v-model="form.startsAt"
|
|
||||||
name="startsAt"
|
|
||||||
label="تاریخ شروع"
|
|
||||||
:min="todayIso"
|
|
||||||
:error="errors.startsAt"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="term-form__cell term-form__cell--third">
|
|
||||||
<DatePickerField
|
|
||||||
v-model="form.endsAt"
|
|
||||||
name="endsAt"
|
|
||||||
label="تاریخ پایان"
|
|
||||||
:min="todayIso"
|
|
||||||
:error="errors.endsAt"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="term-form__cell term-form__cell--third">
|
<div class="term-form__cell term-form__cell--third">
|
||||||
<TextField
|
<TextField
|
||||||
v-model="form.minimumScore"
|
v-model="form.minimumScore"
|
||||||
@@ -136,7 +118,6 @@ import ImageCropper from '@/components/form/ImageCropper.vue'
|
|||||||
import { objectToFormData } from '@/utils/object-to-formdata'
|
import { objectToFormData } from '@/utils/object-to-formdata'
|
||||||
import { useUploadMediaMutation } from '@/services/query/auth'
|
import { useUploadMediaMutation } from '@/services/query/auth'
|
||||||
import TextareaField from '@/components/form/TextareaField.vue'
|
import TextareaField from '@/components/form/TextareaField.vue'
|
||||||
import DatePickerField from '@/components/form/DatePickerField.vue'
|
|
||||||
import BoxedIconTitleBlock from '@/components/blocks/BoxedIconTitleBlock.vue'
|
import BoxedIconTitleBlock from '@/components/blocks/BoxedIconTitleBlock.vue'
|
||||||
import {
|
import {
|
||||||
adminTermsKeys,
|
adminTermsKeys,
|
||||||
@@ -152,14 +133,10 @@ const queryClient = useQueryClient()
|
|||||||
const termId = computed(() => (route.params.id ? Number(route.params.id) : null))
|
const termId = computed(() => (route.params.id ? Number(route.params.id) : null))
|
||||||
const isEditMode = computed(() => !!termId.value)
|
const isEditMode = computed(() => !!termId.value)
|
||||||
|
|
||||||
const todayIso = new Date().toISOString()
|
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
title: '',
|
title: '',
|
||||||
description: '',
|
description: '',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
startsAt: '',
|
|
||||||
endsAt: '',
|
|
||||||
minimumScore: '',
|
minimumScore: '',
|
||||||
score: '',
|
score: '',
|
||||||
coverMediaId: null,
|
coverMediaId: null,
|
||||||
@@ -181,8 +158,6 @@ watch(
|
|||||||
title: term.title || '',
|
title: term.title || '',
|
||||||
description: term.description || '',
|
description: term.description || '',
|
||||||
isActive: term.isActive ?? true,
|
isActive: term.isActive ?? true,
|
||||||
startsAt: term.startsAt || '',
|
|
||||||
endsAt: term.endsAt || '',
|
|
||||||
minimumScore: term.minimumScore ?? '',
|
minimumScore: term.minimumScore ?? '',
|
||||||
score: term.score ?? '',
|
score: term.score ?? '',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ export const termSchema = object().shape({
|
|||||||
title: string().required().min(3),
|
title: string().required().min(3),
|
||||||
description: string().nullable().notRequired(),
|
description: string().nullable().notRequired(),
|
||||||
isActive: boolean().default(true),
|
isActive: boolean().default(true),
|
||||||
startsAt: string().required(),
|
|
||||||
endsAt: string().required(),
|
|
||||||
minimumScore: number().typeError('حد نصاب قبولی باید عدد باشد').required(),
|
minimumScore: number().typeError('حد نصاب قبولی باید عدد باشد').required(),
|
||||||
score: number().typeError('کل نمره آزمون باید عدد باشد').required(),
|
score: number().typeError('کل نمره آزمون باید عدد باشد').required(),
|
||||||
coverMediaId: number().nullable().notRequired(),
|
coverMediaId: number().nullable().notRequired(),
|
||||||
|
|||||||
Reference in New Issue
Block a user