Add new exam event, Add support positions
This commit is contained in:
parent
c1711883fc
commit
27b595206f
5 changed files with 48 additions and 15 deletions
|
|
@ -7,12 +7,20 @@ export interface Exam {
|
|||
end?:string;
|
||||
exam_date?:string;
|
||||
announcement_date?:string;
|
||||
announcement_endDate?:string;
|
||||
announcementExam?:boolean;
|
||||
register_startDate?:string;
|
||||
register_endDate?:string;
|
||||
payment_startDate?:string;
|
||||
payment_endDate?:string;
|
||||
category_id?:string
|
||||
category:string
|
||||
category?:string
|
||||
image?:string;
|
||||
images?:{title:string,url:string}[];
|
||||
files?:{title:string,url:string}[];
|
||||
positions?:{id:string,title:string,path:string}[];
|
||||
}
|
||||
|
||||
export interface CalendarEvent {
|
||||
id:string;
|
||||
title:string;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,20 @@
|
|||
"id":"21",
|
||||
"category":"สำนักงาน ก.ก.","category_id":"1",
|
||||
"start":"2023-04-24",
|
||||
"end": "2023-04-26",
|
||||
"exam_date": "2023-04-05",
|
||||
"announcement_date": "2023-03-05",
|
||||
"announcement_endDate": "2023-05-05",
|
||||
"announcementExam": false,
|
||||
"register_startDate": "2023-04-05",
|
||||
"register_endDate": "2023-04-05",
|
||||
"payment_startDate": "2023-04-05",
|
||||
"payment_endDate": "2023-04-05",
|
||||
"title":"ด่วน !! ประกาศวัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"detail":"<p><center><img src='https://webportal.bangkok.go.th/public/user_files_editor/305/bkkgovjob202303_12.jpg'></center></p><br/><center><h2>สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร ประกาศกำหนดวัน เวลา สถานที่คัดเลือก และระเบียบ เกี่ยวกับการคัดเลือกบุคลากรกรุงเทพมหานครหรือผู้ปฏิบัติงานอื่นในกรุงเทพมหานครเพื่อบรรจุและแต่งตั้ง เป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 1 / 2565</h2></center>",
|
||||
"positions":[
|
||||
{"id":"2","title":"ผู้คุมงานทำความสะอาด","path":"2/21"}
|
||||
],
|
||||
"images":[
|
||||
{
|
||||
"title":"topic",
|
||||
|
|
|
|||
|
|
@ -13,23 +13,33 @@ export const load: PageServerLoad = async ({fetch}) => {
|
|||
const events:CalendarEvent[]=[]
|
||||
|
||||
exams.forEach((ex)=>{
|
||||
const {id,title,start,end,category} = ex
|
||||
if(!category)
|
||||
return
|
||||
const backgroundColor = getBgColorDict(category,catColor)
|
||||
|
||||
const {id,category,start} = ex
|
||||
const backgroundColor = category? getBgColorDict(category,catColor):"n/a"
|
||||
const url = "/qualifying/"+id
|
||||
if(start){
|
||||
ex.date = dayjs(start).format("DD MMM BBBB")
|
||||
events.push({id,title,start,end,url,backgroundColor})
|
||||
}
|
||||
if(!ex.announcementExam)
|
||||
return
|
||||
if(ex.exam_date){
|
||||
events.push({id,"title":"วันสอบคัดเลือก","start":ex.exam_date,url,backgroundColor})
|
||||
const start = ex.exam_date
|
||||
events.push({id,"title":"วันสอบคัดเลือก",start,url,backgroundColor})
|
||||
}
|
||||
if(ex.announcement_date){
|
||||
events.push({id,"title":"ผลสอบคัดเลือก","start":ex.announcement_date,url,backgroundColor})
|
||||
const start = ex.announcement_date
|
||||
const end = ex.announcement_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
if(ex.register_startDate){
|
||||
const start = ex.register_startDate
|
||||
const end = ex.register_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
if(ex.payment_startDate){
|
||||
const start = ex.payment_startDate
|
||||
const end = ex.payment_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
|
||||
})
|
||||
return {exams,events}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
import { env } from '$env/dynamic/public'
|
||||
const positions_base_url = env.PUBLIC_URL_REGISTER_QUALIFY_EXAM+"/exam/"
|
||||
</script>
|
||||
<section>
|
||||
<div class="p-one parallax-inner">
|
||||
|
|
@ -39,19 +41,19 @@
|
|||
<div><img src={i.url} alt={i.title}></div>
|
||||
{/each}
|
||||
{/if}
|
||||
{#if data.regi}
|
||||
<div class="{data.regi.length == 0 ? 'display-none': 'w-12/12 text-lg font-medium'}">สมัครสอบ</div>
|
||||
{#each data.regi as regi}
|
||||
{#if data.positions}
|
||||
<div class="w-12/12 text-lg font-medium">สมัครสอบ</div>
|
||||
{#each data.positions as p}
|
||||
<hr class="border-blueGray-200 my-2" />
|
||||
|
||||
<div class="text-lg py-1">
|
||||
<div class="flex flex-wrap items-center">
|
||||
<a class="btn btn-sm btn-outline btn-info cursor-pointe" href={regi.url} target="_blank">
|
||||
<a class="btn btn-sm btn-outline btn-info cursor-pointe" href={positions_base_url+p.path} target="_blank">
|
||||
<i class="fa-solid fa-pen-to-square text-sm pr-2"></i>
|
||||
สมัครสอบ
|
||||
</a>
|
||||
<div class="pl-4">
|
||||
<span>{regi.title}</span>
|
||||
<span>{p.title}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue