PageSourceSearch

https://sara-school.netlify.app/assets/TeacherMessagesTasks-CH2ff1dL.js

js sara-school.netlify.app collected 2026-10-03 11:23:33 UTC 3,906 bytes, 1 lines download raw bytes

1import{Q as b}from"./QSpace-DvkoovRP.js";import{_ as T,F as A,r as m,b as L,o as $,I as k,J as c,K as s,L as e,a0 as g,a1 as d,f as N,U as C,P as _,V as a,R as Q,S as q,O as P,N as l,a8 as R,T as U,C as j,a2 as F,Y as O,Z as z}from"./index-DmMWFTlW.js";import{Q as B}from"./QScrollArea-DGuTiZzk.js";import{Q as G}from"./QInnerLoading-dtZQza8j.js";import{Q as J}from"./QPage-B13jEZvj.js";import{C as E}from"./ClosePopup-CqSTItjh.js";import"./QResizeObserver-DbOjZLhN.js";import"./QScrollObserver-fP4Zahiv.js";import"./TouchPan-uMjdlbEV.js";import"./touch-BjYP5sR0.js";import"./selection-9CI4SQ0E.js";import"./format-DyQxkAtJ.js";const I=p=>(O("data-v-177e3166"),p=p(),z(),p),K=I(()=>a("div",{class:"text-h5"},"Notice Board",-1)),W={key:0,class:"horizontal-scroller"},Y={class:"row no-wrap q-gutter-x-sm"},Z={class:"text-subtitle1 text-primary text-truncate"},H={class:"text-caption text-grey-7 q-mt-xs"},X={key:1,class:"vertical-scroll-box"},ee={class:"row q-col-gutter-md"},te={class:"text-subtitle1 text-primary"},se={class:"text-caption text-grey-7 q-mt-xs"},ae={class:"notice-content text-truncate"},oe=I(()=>a("div",{class:"text-h6"},"Notice Details",-1)),le={class:"text-h6 text-primary q-mb-sm"},re={class:"text-caption text-grey-7 q-mb-md"},ce={class:"notice-content q-mt-md"},ie={__name:"TeacherMessagesTasks",setup(p){const x=A(),u=m([]),y=m(!0),v=m(!1),i=m(null),w=m(!1),V=L(()=>[...u.value].sort((o,r)=>new Date(r.createDate)-new Date(o.createDate)).slice(0,5)),D=o=>o?new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A",S=o=>{i.value=o,w.value=!0},M=async()=>{y.value=!0;const o=x.getUserRole,r=x.getSchoolCode;let t="";o==="Teacher"?t="Teacher":o==="Student"?t=x.getClass:t="All";const f=`api/GetNewsPort/Getnews/${o}/${r}/${t}`;console.log("Requesting URL:",f);try{const{data:n}=await F.get(f);typeof n=="string"&&n.startsWith("[")?u.value=JSON.parse(n):u.value=n||[]}catch(n){console.error("Failed to fetch or parse notices:",n),u.value=[]}finally{y.value=!1}};return $(()=>{M()}),(o,r)=>(c(),k(J,{class:"q-pa-md"},{default:s(()=>[e(g,null,{default:s(()=>[e(d,{class:"flex items-center"},{default:s(()=>[K,e(b),e(N,{flat:"",color:"primary",label:v.value?"Show Latest Only":"View All Messages",onClick:r[0]||(r[0]=t=>v.value=!v.value)},null,8,["label"])]),_:1}),e(C),e(d,null,{default:s(()=>[v.value?(c(),_("div",X,[e(B,{style:{height:"400px"}},{default:s(()=>[a("div",ee,[(c(!0),_(Q,null,q(u.value,(t,h)=>(c(),_("div",{class:"col-12",key:h},[e(g,{class:"notice-card cursor-pointer",onClick:f=>S(t)},{default:s(()=>[e(d,null,{default:s(()=>[a("div",te,l(t.subjectMessage),1),a("div",se,l(D(t.createDate))+" • By: "+l(t.creator_id),1),e(C,{class:"q-my-sm"}),a("div",ae,l(t.messagedetail),1)]),_:2},1024)]),_:2},1032,["onClick"])]))),128))])]),_:1})])):(c(),_("div",W,[e(B,{horizontal:"",style:{height:"120px"},class:"rounded-borders"},{default:s(()=>[a("div",Y,[(c(!0),_(Q,null,q(P(V),(t,h)=>(c(),k(g,{key:h,class:"notice-card cursor-pointer",onClick:f=>S(t)},{default:s(()=>[e(d,null,{default:s(()=>[a("div",Z,l(t.subjectMessage),1),a("div",H,l(D(t.createDate))+" • By: "+l(t.creator_id),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))])]),_:1})]))]),_:1}),e(G,{showing:y.value},null,8,["showing"]),e(R,{modelValue:w.value,"onUpdate:modelValue":r[1]||(r[1]=t=>w.value=t)},{default:s(()=>[e(g,{style:{"min-width":"70vw"}},{default:s(()=>[e(d,{class:"row items-center q-pb-none bg-primary text-white"},{default:s(()=>[oe,e(b),j(e(N,{icon:"close",flat:"",round:"",dense:""},null,512),[[E]])]),_:1}),i.value?(c(),k(d,{key:0,class:"q-pt-none"},{default:s(()=>[a("div",le,l(i.value.subjectMessage),1),a("div",re,l(D(i.value.createDate))+" • By: "+l(i.value.creator_id),1),e(C),a("div",ce,l(i.value.messagedetail),1)]),_:1})):U("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}))}},we=T(ie,[["__scopeId","data-v-177e3166"]]);export{we 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.