คัดเลือก (ระบบแจ้งหมดเขตรับสมัครสอบ)
This commit is contained in:
parent
a2e7add891
commit
dccff8ef5a
2 changed files with 21 additions and 12 deletions
|
|
@ -82,10 +82,10 @@
|
||||||
<q-card :style="$q.screen.gt.xs ? 'min-width: 30vw' : 'min-width: 80vw'" class="q-pa-sm">
|
<q-card :style="$q.screen.gt.xs ? 'min-width: 30vw' : 'min-width: 80vw'" class="q-pa-sm">
|
||||||
<q-card-section class="row items-center col-12">
|
<q-card-section class="row items-center col-12">
|
||||||
<div class="column col-12 text-center">
|
<div class="column col-12 text-center">
|
||||||
<div><q-icon name="mdi-alert-outline" size="50px" color="pink" /></div>
|
<div><q-icon name="mdi-alert-outline" size="50px" :color="isBeforeToday && timeout ? 'amber-7':'pink'" /></div>
|
||||||
|
|
||||||
<div class="text-bold text-pink text-subtitle1 q-mb-md">หมดเขตรับสมัครสอบ !</div>
|
<div :class="isBeforeToday && timeout ? 'text-bold text-amber-7 text-subtitle1 q-mb-md':'text-bold text-pink text-subtitle1 q-mb-md'">{{isBeforeToday && timeout ? 'ยังไม่ถึงรอบรับสมัครสอบ':'หมดเขตรับสมัครสอบ'}} !</div>
|
||||||
ไม่สามารถทำรายการได้ เนื่องจากหมดเขตรับสมัครแล้ว
|
{{`ไม่สามารถทำรายการได้ ${isBeforeToday && timeout ? 'เนื่องจากยังไม่ถึงรอบรับสมัครสอบ':'เนื่องจากหมดเขตรับสมัครแล้ว'}`}}
|
||||||
<!-- {{ dateThaiRange([registerEndDate, registerStartDate]) }} -->
|
<!-- {{ dateThaiRange([registerEndDate, registerStartDate]) }} -->
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
@ -114,11 +114,12 @@ import keycloak from '@/plugins/keycloak'
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const storeExam = useExamDataStore()
|
const storeExam = useExamDataStore()
|
||||||
const mixin = useCounterMixin()
|
const mixin = useCounterMixin()
|
||||||
const { modalError, messageError, dateThaiRange } = mixin
|
const { modalError, messageError, dateThaiRange, dateToISO } = mixin
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const { loaderPage } = dataStore
|
const { loaderPage } = dataStore
|
||||||
const step = ref<number>(1)
|
const step = ref<number>(1)
|
||||||
const stepRaw = ref<number>(1)
|
const stepRaw = ref<number>(1)
|
||||||
|
const isBeforeToday = ref<boolean>(false)
|
||||||
const tittle = ref<string>('')
|
const tittle = ref<string>('')
|
||||||
const position = ref<string>('')
|
const position = ref<string>('')
|
||||||
const positionLevel = ref<string>('')
|
const positionLevel = ref<string>('')
|
||||||
|
|
@ -174,7 +175,9 @@ const candidateCheck = async () => {
|
||||||
modalConsend.value = true
|
modalConsend.value = true
|
||||||
stepRaw.value = 2
|
stepRaw.value = 2
|
||||||
step.value = 2
|
step.value = 2
|
||||||
|
isBeforeToday.value = false
|
||||||
} else {
|
} else {
|
||||||
|
isBeforeToday.value = dateToISO(data.registerEndDate) > dateToISO(new Date())
|
||||||
registerStartDate.value = new Date(data.registerStartDate)
|
registerStartDate.value = new Date(data.registerStartDate)
|
||||||
registerEndDate.value = new Date(data.registerEndDate)
|
registerEndDate.value = new Date(data.registerEndDate)
|
||||||
timeout.value = true
|
timeout.value = true
|
||||||
|
|
|
||||||
|
|
@ -205,16 +205,22 @@ export const useCounterMixin = defineStore('mixin', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function dateToISO(date: Date) {
|
function dateToISO(date: Date) {
|
||||||
return (
|
if (date != null) {
|
||||||
date.getFullYear() +
|
const srcDate = new Date(date)
|
||||||
'-' +
|
|
||||||
appendLeadingZeroes(date.getMonth() + 1) +
|
return (
|
||||||
'-' +
|
srcDate.getFullYear() +
|
||||||
appendLeadingZeroes(date.getDate())
|
'-' +
|
||||||
)
|
appendLeadingZeroes(srcDate.getMonth() + 1) +
|
||||||
|
'-' +
|
||||||
|
appendLeadingZeroes(srcDate.getDate())
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendLeadingZeroes(n: Number) {
|
function appendLeadingZeroes(n: number) {
|
||||||
if (n <= 9) return '0' + n
|
if (n <= 9) return '0' + n
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue