1import{F as xe,r as i,b as H,o as Se,I as P,J as c,K as s,L as l,a0 as W,a1 as b,V as n,a9 as le,O as h,f as _,P as m,T as k,Q as se,a8 as oe,C as V,M as v,N as d,R as $,S as L,aa as re,a3 as ne,ab as ie,a2 as Y}from"./index-DmMWFTlW.js";import{Q as ce}from"./QSelect-Cm7KAHFZ.js";import{Q as Ce}from"./QForm-BUKdhqQe.js";import{Q as Z,a as I}from"./QTable-WY2Tuy1f.js";import{Q as ue}from"./QSpace-DvkoovRP.js";import{Q as y}from"./QChip-Bw_0mvxH.js";import{Q as de}from"./QInnerLoading-dtZQza8j.js";import{Q as fe}from"./QTr-x1IphCbN.js";import{Q as Ae}from"./QPage-B13jEZvj.js";import{C as T}from"./ClosePopup-CqSTItjh.js";import{u as Ne}from"./use-quasar-DqtP9Las.js";import{r as ge}from"./rules-Cmr9vFm7.js";import{t as je}from"./terms-CBE4kpfH.js";import{y as qe}from"./years-C-ru8EGT.js";import"./jspdf.es.min-2MSynss7.js";import"./jspdf.plugin.autotable-BpvYLMb1.js";import"./QItem-RvHevyvj.js";import"./QMenu-B3LFZvpl.js";import"./position-engine-D1Iga1eY.js";import"./selection-9CI4SQ0E.js";import"./rtl-DFPa-2ov.js";import"./format-DyQxkAtJ.js";import"./QList-zMztYSyu.js";import"./QMarkupTable-CvRgMmbQ.js";const ke=n("div",{class:"text-h6"},"Student Academic Report",-1),Qe={class:"row q-col-gutter-md items-end"},Re={class:"col-12 col-sm-6 col-md-3"},Pe={class:"col-12 col-sm-6 col-md-3"},Ve={class:"col-12 col-sm-auto"},$e={key:1,class:"q-pa-lg flex flex-center column"},Le=n("p",{class:"text-h6 text-grey-7 text-center q-mt-md"},' Select filters and click "View Report" to see student data ',-1),Ie=n("div",{class:"text-h6"},"Student Details",-1),Te={class:"q-gutter-sm q-mb-md"},De={key:0,class:"q-my-md"},Fe=n("div",{class:"text-subtitle1 q-mb-sm"},"Action Status Summary",-1),Oe={class:"bar-chart-container student-status-chart"},ze=["title"],Be={class:"bar-track"},Ke={key:1,class:"text-grey text-center q-pa-sm"},Me={class:"q-pa-sm"},Ee={key:2,class:"text-center q-pa-md text-grey"},Ue=n("div",{class:"text-h6"},"Subject Analysis",-1),Je={class:"q-gutter-sm q-mb-md"},Ge={key:0,class:"q-my-md"},He=n("div",{class:"text-subtitle1 q-mb-sm"}," At Risk Percentage Breakdown ",-1),We={class:"bar-chart-container"},Ye=["title"],Ze={class:"bar-track"},Xe={key:1,class:"text-grey text-center q-pa-sm"},et={class:"q-pa-sm"},tt={key:2,class:"text-center q-pa-md text-grey"},jt={__name:"AdminRiskStudentsList",setup(at){const w=Ne(),D=xe();i(""),i("");const x=i(""),S=i(""),j=i(!1),Q=i([]),q=i([{name:"subject",label:"Subject",field:"subject",align:"left",sortable:!0,style:"width: 150px; max-width: 150px"},{name:"insight",label:"Insight",field:()=>null,align:"center",sortable:!1,style:"width: 120px; max-width: 120px"}]),F=i(!1),O=i({}),u=i([]),z=i([]),C=i(!1),X=i(""),B=i(!1),K=i({}),ee=i(""),f=i([]),M=i([]),A=i(!1),me=async t=>{O.value=t,X.value=t.Name_field||t.name||"N/A",u.value=[],z.value=[],C.value=!0,F.value=!0;const a=`api/StudentPerformance/Report/${x.value}/${t.class}/${t.section}/${S.value}/${D.getSchoolCode}`;try{const{data:e}=await Y.get(a);if(e){if(u.value=Array.isArray(e)?e:[e],u.value.length>0){const o=u.value[0];z.value=Object.keys(o).map(g=>({name:g,required:!0,label:E(g),align:"left",field:N=>N[g],sortable:!0,format:N=>R(N)}))}}else w.notify({type:"warning",message:"No detailed data found for this student.",position:"top-right",timeout:1500})}catch(e){console.error("Error fetching student insight:",e),w.notify({type:"negative",message:"Failed to load student details.",position:"top-right",timeout:1500})}finally{C.value=!1}},pe=async t=>{K.value=t,ee.value=t.subject||"Unknown Subject",f.value=[],M.value=[],A.value=!0,B.value=!0;const a=`api/ExamPerfomAdminSubj/Analysis/${x.value}/${t.class}/${t.section}/${S.value}/${D.getSchoolCode}`;try{const{data:e}=await Y.get(a);if(e){if(f.value=Array.isArray(e)?e:[e],f.value.length>0){const o=f.value[0],g=Object.keys(o).map(r=>({name:r,required:!0,label:E(r),align:"left",field:p=>p[r],sortable:!0,format:p=>R(p)})),N=["Subject Code","Full Marks","Pass Marks"];M.value=g.filter(r=>!N.includes(r.label))}}else w.notify({type:"warning",message:"No analysis data found for this subject.",position:"top-right",timeout:1500})}catch(e){console.error("Error fetching subject analysis:",e),w.notify({type:"negative",message:"Failed to load subject analysis.",position:"top-right",timeout:1500})}finally{A.value=!1}},he=t=>{if(!t.actionStatus)return"";const a=t.actionStatus.toString().toLowerCase();return a.includes("urgent contact teacher")?"bg-red-1":a.includes("contact teacher")?"bg-yellow-2":""},ve=t=>{if(!t)return"grey";const a=t.toLowerCase();return a==="very good"?"green":a==="good"?"light-green":a==="needs improvement"?"orange":a==="critical"?"red":"primary"},E=t=>t.replace(/([A-Z])/g," $1").replace(/^./,a=>a.toUpperCase()),R=t=>t==null?"-":typeof t=="object"?JSON.stringify(t):t,be=async()=>{j.value=!0,Q.value=[];const t=[{name:"subject",label:"Subject",field:"subject",align:"left",sortable:!0,style:"width: 150px; max-width: 150px"},{name:"insight",label:"Insight",field:()=>null,align:"center",sortable:!1,style:"width: 120px; max-width: 120px"}];q.value=[...t];const a=`api/PerformanceSummary/WholeSchool/${D.getSchoolCode}/${x.value}/${S.value}`;try{const{data:e}=await Y.get(a);if(e&&e.length>0){Q.value=e;const o=[];if(e.length>0){const g=e[0];Object.keys(g).forEach(r=>{if(r!=="subject"&&r!=="insight"&&r!=="actionStatus"&&!r.toLowerCase().includes("range35")&&!t.some(p=>p.name===r)){let p="100px";r==="studentId"||r==="roll"?p="80px":r==="Name_field"||r==="name"?p="180px":r==="performanceRating"?p="150px":(r.includes("score")||r.includes("percentage"))&&(p="90px"),o.push({name:r,label:E(r),field:G=>G[r],align:["studentId","roll","score","percentage","grade"].some(G=>r.toLowerCase().includes(G.toLowerCase()))?"center":"left",sortable:!0,style:`width: ${p}; max-width: ${p}`,classes:"ellipsis"})}})}q.value.splice(2,0,...o)}else w.notify({type:"warning",message:"No data found for the selected criteria.",position:"top-right",timeout:2e3}),q.value=t}catch(e){console.error("Error fetching report data:",e),w.notify({type:"negative",message:"Failed to load report data.",position:"top-right",timeout:2e3}),q.value=t}finally{j.value=!1}},te=t=>{if(!t.actionStatus)return"";const a=t.actionStatus.toString().toLowerCase();return a.includes("urgent contact teacher")?"bg-red-1":a.includes("contact teacher")?"bg-yellow-2":a.includes("satisfactory")?"bg-green-1":""},_e=t=>{if(!t)return"grey-7";const a=String(t).toLowerCase();return a.includes("urgent contact teacher")?"negative":a.includes("contact teacher")?"warning":a.includes("satisfactory")?"positive":"info"};H(()=>!u.value||u.value.length===0?{}:u.value.reduce((t,a)=>{const e=a.actionStatus||"N/A";return t[e]=(t[e]||0)+1,t},{}));const ye=t=>{if(!t)return"help_outline";const a=String(t).toLowerCase();return a.includes("urgent contact teacher")||a.includes("contact teacher")||a.includes("satisfactory")?"":"o_info"},U=H(()=>
1{if(!u.value||u.value.length===0)return[];const t=u.value.reduce((e,o)=>{const g=o.actionStatus||"N/A";return e[g]=(e[g]||0)+1,e},{}),a=u.value.length;return a===0?[]:Object.entries(t).map(([e,o])=>{const g=_e(e);return{status:e,count:o,percentage:o/a*100,color:`var(--q-${g})`,rawColor:g,icon:ye(e)}}).sort((e,o)=>o.count-e.count)}),ae=t=>{const a=t.At_Risk_Percentage||t.at_risk_percentage||t.atRiskPercentage;if(a==null)return"";const e=parseFloat(String(a).replace("%",""));return isNaN(e)?"":e>50?"bg-red-1":e>30?"bg-orange-1":e>15?"bg-yellow-2":""},J=H(()=>{if(!f.value||f.value.length===0)return[];let t=null;if(f.value.length>0){const a=Object.keys(f.value[0]);t=["name","topicName","assessmentName","skillName","componentName","title"].find(o=>a.includes(o)),t||(t=a.find(o=>typeof f.value[0][o]=="string"&&!o.toLowerCase().includes("id")&&!o.toLowerCase().includes("percentage")&&!o.toLowerCase().includes("risk"))||"label")}return f.value.map(a=>{const e=a.At_Risk_Percentage||a.at_risk_percentage||a.atRiskPercentage||"0%",o=parseFloat(String(e).replace("%",""));return{label:a[t]||a.id||"N/A",percentage:isNaN(o)?0:Math.max(0,Math.min(100,o))}}).filter(a=>a.percentage>0)}),we=t=>t>75?"var(--q-negative)":t>50?"var(--q-warning)":t>25?"var(--q-accent)":"var(--q-positive)";return Se(()=>{}),(t,a)=>(c(),P(Ae,{padding:""},{default:s(()=>[l(W,null,{default:s(()=>[l(b,null,{default:s(()=>[ke]),_:1}),l(b,null,{default:s(()=>[l(Ce,{onSubmit:le(be,["prevent"])},{default:s(()=>[n("div",Qe,[n("div",Re,[l(ce,{label:"Select Term",modelValue:x.value,"onUpdate:modelValue":a[0]||(a[0]=e=>x.value=e),options:h(je),filled:"",dense:"",rules:[h(ge).required],"emit-value":"","map-options":""},null,8,["modelValue","options","rules"])]),n("div",Pe,[l(ce,{label:"Year",modelValue:S.value,"onUpdate:modelValue":a[1]||(a[1]=e=>S.value=e),options:h(qe),filled:"",dense:"",rules:[h(ge).required],"emit-value":"","map-options":""},null,8,["modelValue","options","rules"])]),n("div",Ve,[l(_,{type:"submit",color:"primary",label:"View Report",icon:"search",unelevated:"",loading:j.value},null,8,["loading"])])])]),_:1},8,["onSubmit"])]),_:1}),l(b,{style:{"max-height":"600px"}},{default:s(()=>[Q.value.length>0?(c(),P(Z,{key:0,rows:Q.value,columns:q.value,"row-key":"studentId",loading:j.value,flat:"",bordered:"",separator:"cell","row-class":he,pagination:{rowsPerPage:10,rowsPerPageOptions:[5,10,15,20,0]},"table-style":{"table-layout":"fixed"},class:"full-width"},{"body-cell-subject":s(e=>[l(I,{props:e},{default:s(()=>[l(_,{"no-caps":"",unelevated:"",color:"primary",label:e.value||"Analysis",onClick:le(o=>pe(e.row),["stop"]),class:"full-width"},null,8,["label","onClick"])]),_:2},1032,["props"])]),"body-cell-insight":s(e=>[l(I,{props:e},{default:s(()=>[l(_,{size:"sm",color:ve(e.row.performanceRating),icon:"insights",label:e.row.performanceRating||"View",dense:"","no-caps":"",unelevated:"",class:"full-width",onClick:o=>me(e.row)},null,8,["color","label","onClick"])]),_:2},1032,["props"])]),_:1},8,["rows","columns","loading"])):j.value?k("",!0):(c(),m("div",$e,[l(se,{name:"filter_list",color:"grey-5",size:"4rem"}),Le]))]),_:1})]),_:1}),l(oe,{modelValue:F.value,"onUpdate:modelValue":a[2]||(a[2]=e=>F.value=e),"full-height":""},{default:s(()=>[l(W,{style:{width:"90vw","max-width":"900px",height:"100%"}},{default:s(()=>[l(b,{class:"row items-center q-pb-none"},{default:s(()=>[Ie,l(ue),V(l(_,{icon:"close",flat:"",round:"",dense:""},null,512),[[T]])]),_:1}),l(b,{style:{"flex-grow":"1","overflow-y":"auto"}},{default:s(()=>[n("div",Te,[l(y,{color:"primary","text-color":"white",icon:"person"},{default:s(()=>[v(d(X.value||"N/A"),1)]),_:1}),l(y,{color:"secondary","text-color":"white",icon:"school"},{default:s(()=>[v(" Class: "+d(O.value.class||"N/A"),1)]),_:1}),l(y,{color:"accent","text-color":"white",icon:"class"},{default:s(()=>[v(" Section: "+d(O.value.section||"N/A"),1)]),_:1})]),u.value.length>0&&h(U).length>0?(c(),m("div",De,[Fe,n("div",Oe,[(c(!0),m($,null,L(h(U),e=>(c(),m("div",{key:e.status,class:"bar-item q-mb-xs"},[n("div",{class:"bar-label ellipsis",title:e.status+": "+e.count},[l(se,{name:e.icon,color:e.rawColor,class:"q-mr-xs",size:"xs"},null,8,["name","color"]),v(" "+d(e.status)+" ("+d(e.count)+") ",1)],8,ze),n("div",Be,[n("div",{class:"bar-fill",style:re({width:e.percentage+"%",backgroundColor:e.color})},null,4)])]))),128))])])):u.value.length>0&&h(U).length===0&&!C.value?(c(),m("div",Ke," No action status data available for chart visualization. ")):k("",!0),l(Z,{flat:"",bordered:"",rows:u.value,columns:z.value,"row-key":"id",loading:C.value,class:"sticky-header-table","row-class":te,pagination:{rowsPerPage:0}},{loading:s(()=>[l(de,{showing:C.value},null,8,["showing"])]),body:s(e=>[l(fe,{props:e,class:ne(te(e.row))},{default:s(()=>[(c(!0),m($,null,L(e.cols,o=>(c(),P(I,{key:o.name,props:e},{default:s(()=>[v(d(R(o.value)),1)]),_:2},1032,["props"]))),128))]),_:2},1032,["props","class"])]),bottom:s(()=>[n("div",Me," Total Rows: "+d(u.value.length),1)]),_:1},8,["rows","columns","loading"]),u.value.length===0&&!C.value?(c(),m("div",Ee," No detailed data available for this student. ")):k("",!0)]),_:1}),l(ie,{align:"right"},{default:s(()=>[V(l(_,{flat:"",label:"Close",color:"primary"},null,512),[[T]])]),_:1})]),_:1})]),_:1},8,["modelValue"]),l(oe,{modelValue:B.value,"onUpdate:modelValue":a[3]||(a[3]=e=>B.value=e),"full-height":""},{default:s(()=>[l(W,{style:{width:"90vw","max-width":"900px",height:"100%"}},{default:s(()=>[l(b,{class:"row items-center q-pb-none"},{default:s(()=>[Ue,l(ue),V(l(_,{icon:"close",flat:"",round:"",dense:""},null,512),[[T]])]),_:1}),l(b,{style:{"flex-grow":"1","overflow-y":"auto"}},{default:s(()=>[n("div",Je,[l(y,{color:"primary","text-color":"white",icon:"subject"},{default:s(()=>[v(d(ee.value||"N/A"),1)]),_:1}),l(y,{color:"secondary","text-color":"white",icon:"school"},{default:s(()=>[v(" Class: "+d(K.value.class||"N/A"),1)]),_:1}),l(y,{color:"accent","text-color":"white",icon:"class"},{default:s(()=>[v(" Section: "+d(K.value.section||"N/A"),1)]),_:1}),l(y,{color:"teal","text-color":"white",icon:"calendar_today"},{default:s(()=>[v(" Term: "+d(x.value)+" / "+d(S.value),1)]),_:1})]),f.value.length>0&&h(J).length>0?(c(),m("div",Ge,[He,n("div",We,[(c(!0),m($,null,L(h(J),e=>(c(),m("div",{key:e.label,class:"bar-item q-mb-xs"},[n("div",{class:"bar-label ellipsis",title:e.label},d(e.label)+" ("+d(e.percentage.toFixed(1))+"%) ",9,Ye),n("div",Ze,[n("div",{class:"bar-fill",style:re({width:e.percentage+"%",backgroundColor:we(e.percentage)})},null,4)])]))),128))])])):f.value.length>0&&h(J).length===0&&!A.value?(c(),m("div",Xe,' No "At Risk Percentage" data found or applicable for chart visualization. ')):k("",!0),l(Z,{flat:"",bordered:"",rows:f.value,columns:M.value,"row-key":"id",loading:A.value,class:"sticky-header-table","row-class":ae,pagination:{rowsPerPage:0}},{loading:s(()=>[l(de,{showing:A.value},null,8,["showing"])]),body:s(e=>[l(fe,{props:e,class:ne(ae(e.row))},{default:s(()=>[(c(!0),m($,null,L(e.cols,o=>(c(),P(I,{key:o.name,props:e},{default:s(()=>[v(d(R(o.value)),1)]),_:2},1032,["props"]))),128))]),_:2},1032,["props","class"])]),bottom:s(()=>[n("div",et," Total Rows: "+d(f.value.length),1)]),_:1},8,["rows","columns","loading"]),f.value.length===0&&!A.value?(c(),m("div",tt," No anal
1ysis data available for this subject. ")):k("",!0)]),_:1}),l(ie,{align:"right"},{default:s(()=>[V(l(_,{flat:"",label:"Close",color:"primary"},null,512),[[T]])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}))}};export{jt 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.