From 4cf19d1ea750b3a6d5f63b7a702ee66fb3ba6022 Mon Sep 17 00:00:00 2001 From: nugroho Date: Sun, 6 Jul 2025 00:09:26 +0700 Subject: [PATCH] Reports done. Eval rating supported --- assets/js/app.js | 2 +- index.html | 230 ++++++------ modules/dasbor-level2.html | 4 +- modules/kegiatan-proker-new.html | 1 - modules/kegiatan.html | 5 +- modules/laporan-view.html | 585 +++++++++++++++++++++++++++++++ modules/laporan.html | 179 +++++++++- modules/monev-detil.html | 22 +- modules/monev-eval.html | 44 ++- modules/monev.html | 23 +- modules/regulasi.html | 9 +- modules/submission.html | 25 +- 12 files changed, 978 insertions(+), 151 deletions(-) create mode 100644 modules/laporan-view.html diff --git a/assets/js/app.js b/assets/js/app.js index 56957a5..03a8bfc 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,4 +1,4 @@ -vernum = "1.0.250601.1020" +vernum = "1.0.250704.0335" async function getJson(url,headers={}) { try { const response = await fetch(url); diff --git a/index.html b/index.html index a436ad4..5da83ae 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,7 @@ } *::-webkit-scrollbar, .main::-webkit-scrollbar { width: .8ch; + height: .8ch; } /* Scrollbar thumb (the draggable part) */ @@ -28,120 +29,119 @@ background: var(--secondary-background); /* Dark semi-transparent */ border-radius: .2ch; /* Rounded edges */ } - /* body -{ - height: 100%; -} */ - h2, h3, h4 - { - margin: .25em 0; - } -aside -{ - display: block; - position: absolute; - top: 0; - left: 0; - min-height: 100%; - width: 30ch; - background-color: var(--primary-table); - color: var(--primary-background); - padding: .5ch; - padding-top: 3.5em; - box-shadow: var(--primary-foreground) .65ch 0, inset var(--primary-foreground) -13px 0 20px -25px; -} -.logobox -{ - height: 3em; - position: fixed; - top: .5ch; - left: 0; - width: inherit; - padding: 0 .5ch .5ch .5ch; - border-bottom: 1px solid var(--secondary-background); -} -.sidebar -{ - display: block; - position: absolute; - top: calc(3em + 1ch); - left: 0; - width: calc(100% - .25ch); - max-height: calc(100% - (3em + 1.5ch)); - overflow-x: auto; -} -.sidebar::-webkit-scrollbar, .main::-webkit-scrollbar { - width: .8ch; -} + *::-webkit-scrollbar-track, .main::-webkit-scrollbar-track { + background: var(--input-background); + } + h2, h3, h4 + { + margin: .25em 0; + } + aside + { + display: block; + position: absolute; + top: 0; + left: 0; + min-height: 100%; + width: 30ch; + background-color: var(--primary-table); + color: var(--primary-background); + padding: .5ch; + padding-top: 3.5em; + box-shadow: var(--primary-foreground) .65ch 0, inset var(--primary-foreground) -13px 0 20px -25px; + } + .logobox + { + height: 3em; + position: absolute; + top: .5ch; + left: 0; + width: inherit; + padding: 0 .5ch .5ch .5ch; + border-bottom: 1px solid var(--secondary-background); + } + .sidebar + { + display: block; + position: absolute; + top: calc(3em + 1ch); + left: 0; + width: calc(100% - .25ch); + max-height: calc(100% - (3em + 1.5ch)); + overflow-x: auto; + } + .sidebar::-webkit-scrollbar, .main::-webkit-scrollbar { + width: .8ch; + } -/* Scrollbar thumb (the draggable part) */ -.sidebar::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb { - background: var(--secondary-background); /* Dark semi-transparent */ - border-radius: .2ch; /* Rounded edges */ -} -.item -{ - height: 2em; - line-height: 2em; - margin-left: 1ch; - margin-right: 1ch; - background-color: var(--primary-table); - padding-left: 1ch; - padding-right: 1ch; - border-radius: .25ch; - cursor: default; - user-select: none; -} -.item:hover -{ - filter: brightness(1.2); -} -.item[data-active] -{ - filter: brightness(1.4); -} -.sub.item -{ - padding-left: 3ch; -} -#main -{ - display: block; - position: relative; - margin-left: 30ch; - padding: .5ch .5ch .5ch 0; - height: 100%; - overflow: auto; - backdrop-filter: blur(7px); - background-color: var(--semi-background); -} -nav -{ - display: grid; - grid-template-columns: auto 1fr auto; - height: 3em; - padding-left: 2ch; - padding-right: 2ch; - line-height: 3em; - border-bottom: 1px solid var(--input-background); -} -#content -{ - display: block; - width: 100%; - min-height: calc(100% - 6em); - padding: .5ch 1ch; -} -#footer -{ - height: 3em; - padding: .5em; - line-height: 2em; - border-top: 1px solid var(--input-background); - display: grid; - grid-template-columns: auto 1fr auto; - color: var(--secondary-foreground); -} + /* Scrollbar thumb (the draggable part) */ + .sidebar::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb { + background: var(--secondary-background); /* Dark semi-transparent */ + border-radius: .2ch; /* Rounded edges */ + } + .item + { + height: 2em; + line-height: 2em; + margin-left: 1ch; + margin-right: 1ch; + background-color: var(--primary-table); + padding-left: 1ch; + padding-right: 1ch; + border-radius: .25ch; + cursor: default; + user-select: none; + } + .item:hover + { + filter: brightness(1.2); + } + .item[data-active] + { + filter: brightness(1.4); + } + .sub.item + { + padding-left: 3ch; + } + #main + { + display: block; + position: relative; + margin-left: 30ch; + padding: .5ch .5ch .5ch 0; + height: 100%; + overflow: auto; + backdrop-filter: blur(7px); + background-color: var(--semi-background); + } + nav + { + display: grid; + grid-template-columns: auto 1fr auto; + height: 3em; + padding-left: 2ch; + padding-right: 2ch; + line-height: 3em; + border-bottom: 1px solid var(--input-background); + } + #content + { + display: block; + width: 100%; + min-height: calc(100% - 6em); + padding: .5ch 1ch; + } + #footer + { + height: 3em; + padding: .5em; + line-height: 2em; + border-top: 1px solid var(--input-background); + display: grid; + grid-template-columns: auto 1fr auto; + color: var(--secondary-foreground); + } @@ -184,6 +184,7 @@ nav  
User Name +
logout Keluar
@@ -254,7 +255,8 @@ nav }); if(res.status == 200) location = "/login.html"; }); - $('#username').text(loggedInAgent.name) + $('#username').text(loggedInAgent.name); + $('#prof').css("background-image","url("+(loggedInAgent.photoURL ?? "/assets/images/generic-user.webp")+")"); $('.item, .subitem').click(async (e)=>{ if (window.shellnavigating) return; window.dispatchEvent(new Event("viewChange")); diff --git a/modules/dasbor-level2.html b/modules/dasbor-level2.html index 3be2de7..bee999b 100644 --- a/modules/dasbor-level2.html +++ b/modules/dasbor-level2.html @@ -184,7 +184,7 @@ const sortedProkers = [...currProkers].filter(r=>r.journal.at(-1).status >= 1 && r.journal.at(-1).status <=3 ).sort((a,b)=>a.deadline - b.deadline); const closest = sortedProkers.find(p=>p.journal.at(-1).status == 2); µ('#udate').text(closest ? `${closest.deadline.getFullYear()}/${(closest.deadline.getMonth()+1).toString().padStart(2,"0")}/${closest.deadline.getDate().toString().padStart(2,"0")}` : ""); - µ('#utext').text(closest ? closest.sasaran : ""); + µ('#utext').text(closest ? (closest.owner.name + ": " + closest.sasaran) : ""); const todayActs = sortedProkers.filter(p=> { const today = new Date(); @@ -204,7 +204,7 @@ s.append(v.journal.at(-1).status == 1 ? `Ditolak: `: v.journal.at(-1).status == 2 ? `Diajukan: ` : `Disetujui: `); s.style.fontWeight = "600" s.style.color = v.journal.at(-1).status == 1 ? "var(--neutral-p-accent)": v.journal.at(-1).status == 2 ? "var(--neutral-n-accent)" : "var(--positive-accent)" - t.append(v.sasaran) + t.append(v.owner.name +": "+v.sasaran) µ('#htoday').append(d); }); moly.loadScreen.close(loadid); diff --git a/modules/kegiatan-proker-new.html b/modules/kegiatan-proker-new.html index dc4094b..92f4e45 100644 --- a/modules/kegiatan-proker-new.html +++ b/modules/kegiatan-proker-new.html @@ -50,7 +50,6 @@ \ No newline at end of file diff --git a/modules/laporan.html b/modules/laporan.html index f65b6b1..2eac6b1 100644 --- a/modules/laporan.html +++ b/modules/laporan.html @@ -1,3 +1,176 @@ -
- Belum Cukup Data -
\ No newline at end of file +
+ Laporan Aksi Perubahan
+ +
+
+ Tahun  + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
NoNIPNama AgenRating Kinerja
+ Data Kosong +
+
+ \ No newline at end of file diff --git a/modules/monev-detil.html b/modules/monev-detil.html index 73e7781..5afd54e 100644 --- a/modules/monev-detil.html +++ b/modules/monev-detil.html @@ -108,17 +108,33 @@ const ks = JSON.parse(v.notes); no.append("Kendala:"); no.append(moly.newElement("br")); - no.append(ks.kendala.length > 1? ks.kendala : "-"); + no.append(ks.kendala.length > 1? ks.kendala : "(Tidak ada)"); no.append(moly.newElement("br")); no.append("Solusi:"); no.append(moly.newElement("br")); - no.append(ks.solusi.length > 1? ks.solusi : "-"); + no.append(ks.solusi.length > 1? ks.solusi : "(Tidak ada)"); + } + else if(v.status ==8) + { + const rm = JSON.parse(v.notes); + no.append("Nilai: "); + let str = "☆☆☆☆☆"; + for(let s=1;s<=rm.r;s++) + { + str = "★" + str; + str = str.substring(0,5); + } + no.append(str); + no.append(moly.newElement("br")); + no.append("Catatan: "); + no.append(moly.newElement("br")); + no.append(rm.m.length > 1? rm.m : "(Tidak ada)"); } else { no.append("Catatan:"); no.append(moly.newElement("br")); - no.append(v.notes.length > 1? v.notes : "-"); + no.append(v.notes.length > 1? v.notes : "(Tidak ada)"); } // console.log(typeof v.document) if(typeof v.document === "string") diff --git a/modules/monev-eval.html b/modules/monev-eval.html index 8e5ab03..607eecb 100644 --- a/modules/monev-eval.html +++ b/modules/monev-eval.html @@ -1,14 +1,14 @@ -
+
Dokumen Eviden:
-
- Aksi Perubahan - + Aksi Perubahan: + Rencana Mulai Rencana Durasi Selesai Pada @@ -16,15 +16,19 @@ Kendala: - + Solusi: - + + + Nilai: + + Catatan Evaluasi: - +
@@ -40,10 +44,16 @@ } const finJour = data.journal.find(e=>e.status == 4); const prosol = JSON.parse(finJour.notes); - console.log(data) µ('#act').val(data.actions); µ('#pro').val(prosol.kendala); µ('#sol').val(prosol.solusi); + // let str = "☆☆☆☆☆"; + // for(let s=1;s<=Number(µ('#rating').val());s++) + // { + // str = "★" + str; + // str = str.substring(0,5); + // } + // µ('#nilai').text(str); µ('#planStart').text(data.year + "-" + data.startMonth.toString().padStart(2,"0")+ (data.isInMonth ? "" : "-" + data.startDay.toString().padStart(2,"0"))); µ('#planDur').text(data.timeTarget + " " + (data.isInMonth ? "Bulan" : "Hari")); µ('#finishedAt').text(finJour.timeStamp.substring(0,16)); @@ -51,7 +61,13 @@ µ('iframe')[0].src="/uploads/dokumen/" + finJour.document; µ('#submit').click(async()=>{ const loadid = moly.loadScreen.show("Mengirim Evaluasi...","sonar","#"+µ('div[id^="db"]')[0].id) - const evalres = await postJson('/api/eval', {prokerid: data.prokerID, notes: µ('#evalnotes').val().length > 0 ? µ('#evalnotes').val(): "-"}); + const notes = JSON.stringify( + { + r: Number(µ('#rating').val()), + m: (µ('#evalnotes').val().length > 0 ? µ('#evalnotes').val(): "(Tidak ada)") + } + ) + const evalres = await postJson('/api/eval', {prokerid: data.prokerID, notes}); if(evalres.status != 201) { moly.alert.show("Pengiriman Evaluaasi Gagal","Tidak dapat mengirim evaluasi. Silakan ulangi kembali beberapa saat lagi."); @@ -61,4 +77,14 @@ moly.loadScreen.close(loadid); thisDialog.resolve(true); }); + µ('#rating').change(()=>{ + let str = "☆☆☆☆☆"; + for(let s=1;s<=Number(µ('#rating').val());s++) + { + str = "★" + str; + str = str.substring(0,5); + } + µ('#nilai').text(str); + }); + µ('#rating').change(); \ No newline at end of file diff --git a/modules/monev.html b/modules/monev.html index cebbf40..d375580 100644 --- a/modules/monev.html +++ b/modules/monev.html @@ -3,7 +3,7 @@ Daftar Agen Perubahan
-
+
@@ -43,12 +43,12 @@   -
+
- + @@ -208,6 +208,7 @@ no.style.textAlign = "right"; kg.append(kegiatanName[v.kegiatan]); ss.append(v.sasaran); + ss.setAttribute("title",v.sasaran); tw.append(`${v.timeTarget} ${v.isInMonth ? "Bulan" : "Hari"}`); tw.style.textAlign = "center"; wm.append(((v.startDay == null ? "" : v.startDay.toString().padStart(2,"0") + " ") + monthName[v.startMonth] + " " + v.year)); @@ -236,11 +237,20 @@ $('#proker #pkContent').append(ro); }); } - function fillAgents() + async function fillAgents() { const loadid = moly.loadScreen.show("Memuat data agen...","bar","#agWrapper"); $('#agContent').empty(); - $.each(agents.filter(a=>a.agentID != userDetails.info.agentID),(i,v)=>{ + const users = await getJson("/api/getusers"); + if(users.status != 200) + { + moly.alert.show("Gagal Memuat Data","Data pengguna tidak berhasil dimuat. Silakan ulangi kembali beberapa saat lagi.") + moly.loadScreen.close(loadid); + return; + } + let num = 1; + $.each(agents,(_,v)=>{ + if (users.data.find(u=>u.agentID == v.agentID).level != 3) return; const ro = moly.newElement("tr"); const no = moly.newElement("td"); const ni = moly.newElement("td"); @@ -248,7 +258,8 @@ ro.append(no) ro.append(ni) ro.append(na) - no.append((i+1) + "."); + no.append(num + "."); + num++; no.style.textAlign = "right"; ni.append(v.agentID); ni.style.textAlign = "center"; diff --git a/modules/regulasi.html b/modules/regulasi.html index 4331d59..a4f2296 100644 --- a/modules/regulasi.html +++ b/modules/regulasi.html @@ -1,8 +1,12 @@ -
+
+ Daftar Dokumen Regulasi +
+Entri Regulasi Baru +
- + @@ -23,7 +27,6 @@
-Entri Regulasi