PageSourceSearch

https://www.onst.org.tw/ridea/npm/frontend/js/Course-DM0hliP0.js

js onst.org.tw collected 2026-10-07 06:20:45 UTC 4,326 bytes, 1 lines download raw bytes

1import{g as w,C as h,i as Y,p as T,c as F,a as l,o as i,b as s,u as I,d as O,t as c,F as p,r as _,m as S}from"./main-Dg7iIfI7.js";import{u as N}from"./RequestSender-DdwFNzE_.js";import{h as m}from"./moment-C5S46NFB.js";import"./_commonjsHelpers-D6-XlEtG.js";const V={class:"index-courses"},z={class:"main"},A={class:"box-top"},L={class:"more"},P=["href"],W={class:"courses-content-view"},j={class:"courses-calendar"},G={class:"tool"},H={class:"month"},J={class:"en"},K={class:"en"},Q={class:"en"},X={class:"calendar-box"},Z={class:"week"},ss={class:"group"},ts={class:"day"},es={class:"group"},os={class:"view"},as={class:"show"},ns={class:"index-courses-list"},ls={key:0,class:"item notetxt"},is={class:"info"},ds={class:"tag"},cs={class:"type"},rs={key:0},us={key:1},vs={key:2},hs=["href"],ps={class:"des"},ks={__name:"Course",setup(_s){const n=w(m()),C=["周日","周一","周二","周三","周四","周五","周六"],D=()=>{n.value=n.value.clone().subtract(1,"month")},U=()=>{n.value=n.value.clone().add(1,"month")},x=N(),q=`${h.apiUrl}/index/course`,R=`${h.apiUrl}/index/course/calendar`,f=w([]),b=w([]);x.sendRequest({url:q,params:{date:n.value.format("YYYY-MM")}}).then(d=>{const t=Y(d);f.value=t.courses});const $=()=>{x.sendRequest({url:R,params:{date:n.value.format("YYYY-MM")}}).then(d=>{const t=Y(d);b.value=t.dateRanges})};T(()=>n.value,()=>{$()},{immediate:!0});const B=d=>`${h.siteUrl}/academic-activity/course/${d.productId}`,E=F(()=>{const d=n.value.clone().startOf("month"),t=n.value.clone().endOf("month"),o=d.day(),y=m(),a=[];for(let e=o-1;e>=0;e--){const g=d.clone().subtract(e+1,"days");a.push({date:g,isOtherMonth:!0,isToday:!1,css:null})}for(let e=d.clone();e.isSameOrBefore(t,"day");e.add(1,"day"))a.push({date:e.clone(),isOtherMonth:!1,isToday:e.isSame(y,"day"),css:null});for(;a.length<42;){const e=a[a.length-1].date.clone();a.push({date:e.add(1,"day"),isOtherMonth:!0,isToday:!1,css:null})}b.value.forEach(([e,g])=>{const k=m(e).startOf("day"),M=m(g).startOf("day");a.forEach(r=>{if(r.date.isBetween(k,M,"day","[]")){let u="";r.date.isSame(M,"day")&&r.date.isSame(k,"day")?u="end":r.date.isSame(M,"day")?u="end continuous":r.date.isSame(k,"day")?u="star continuous":u="continuous",r.css=u}})});const v=[];for(let e=0;e<a.length;e+=7)v.push(a.slice(e,e+7));return v});return(d,t)=>(i(),l("div",V,[t[9]||(t[9]=s("div",{class:"topbg"},[s("div",{class:"bgshow"})],-1)),s("div",z,[s("div",A,[t[2]||(t[2]=s("div",{class:"index-tit"},[s("h3",null,"學術課程"),s("div",{class:"en"},[s("p",null,"Academic Courses"),s("div",{class:"line"})])],-1)),s("div",L,[s("a",{href:`${I(h).siteUrl}/academic-activity/course`,class:"link"},null,8,P),t[0]||(t[0]=s("p",null,"閱讀更多 ",-1)),t[1]||(t[1]=s("div",{class:"right-btn type1"},[s("div",{class:"icon"}),s("div",{class:"icon hover-type"})],-1))])]),s("div",W,[s("div",j,[s("div",G,[s("div",H,[s("p",null,[s("span",J,c(n.value.format("MMM").toUpperCase()),1),s("span",K,c(n.value.format("MM")),1),t[3]||(t[3]=O("月 "))]),s("p",Q,c(n.value.format("YYYY")),1)]),s("div",{class:"btn-tool"},[s("div",{class:"left-btn",onClick:D},t[4]||(t[4]=[s("div",{class:"icon"},null,-1),s("div",{class:"icon hover-type"},null,-1)])),s("div",{class:"right-btn",onClick:U},t[5]||(t[5]=[s("div",{class:"icon"},null,-1),s("div",{class:"icon hover-type"},null,-1)]))])]),s("div",X,[s("div",Z,[s("div",ss,[(i(),l(p,null,_(C,o=>s("div",ts,c(o),1)),64))])]),(i(!0),l(p,null,_(E.value,(o,y)=>(i(),l("div",{class:"week",key:y},[s("div",es,[(i(!0),l(p,null,_(o,(a,v)=>(i(),l("div",{key:v,class:S(["day",a.css,{now:a.isToday}])},[s("div",os,[s("div",as,[t[6]||(t[6]=s("span",{class:"line-top"},null,-1)),t[7]||(t[7]=s("span",{class:"line-bt"},null,-1)),O(" "+c(a.date.date()),1)])])],2))),128))])]))),128))])]),s("div",ns,[f.value.length===0?(i(),l("div",ls,t[8]||(t[8]=[s("div",{class:"view"},"敬請期待",-1)]))):(i(!0),l(p,{key:1},_(f.value,o=>(i(),l("div",{class:S(["item",{type1:o.registrationEnded||o.quantity<=0}]),key:`session-row-${o.productId}`},[s("div",is,[s("div",ds,c(o.category),1),s("div",cs,[o.registrationEnded?(i(),l("p",rs,"報名截止")):o.quantity<=0?(i(),l("p",us,"名額已滿")):(i(),l("p",vs,"剩餘名額: "+c(o.quantity),1))])]),s("a",{href:B(o),class:"link"},c(o.name),9,hs),s("div",ps,c(o.description),1)],2))),128))])])])]))}};export{ks as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.