Refine arrival filters and demo date behavior
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
</section>
|
||||
|
||||
<section class="card p-4">
|
||||
<form method="get" action="{{b "/arrival"}}" class="grid gap-3 md:grid-cols-3">
|
||||
<form id="arrival-filter-form" method="get" action="{{b "/arrival"}}" class="grid gap-3 md:grid-cols-3">
|
||||
<input type="hidden" name="date" value="{{.Date}}"/>
|
||||
<div class="md:col-span-2">
|
||||
<label for="search" class="mb-2 block text-sm font-medium text-slate-600">Search Participant</label>
|
||||
@@ -99,7 +99,7 @@
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card overflow-hidden">
|
||||
<section id="arrival-live-list" class="card overflow-hidden">
|
||||
<div class="flex items-center justify-between border-b border-slate-100 px-5 py-3">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-slate-700">Live Arrival List</h2>
|
||||
@@ -206,6 +206,24 @@
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
const arrivalFilterForm = document.getElementById('arrival-filter-form');
|
||||
if (arrivalFilterForm) {
|
||||
arrivalFilterForm.addEventListener('submit', function () {
|
||||
sessionStorage.setItem('arrival-scroll-to-list', '1');
|
||||
});
|
||||
}
|
||||
|
||||
const shouldScrollToList = sessionStorage.getItem('arrival-scroll-to-list') === '1';
|
||||
if (shouldScrollToList) {
|
||||
sessionStorage.removeItem('arrival-scroll-to-list');
|
||||
const listSection = document.getElementById('arrival-live-list');
|
||||
if (listSection) {
|
||||
requestAnimationFrame(function () {
|
||||
listSection.scrollIntoView({ behavior: 'auto', block: 'start' });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const overviewData = {{.OverviewJSON}};
|
||||
const stationData = {{.DepartmentJSON}};
|
||||
const deptColors = ['#f59e0b', '#8b5cf6', '#f97316', '#06b6d4', '#ec4899', '#84cc16', '#14b8a6'];
|
||||
@@ -235,7 +253,8 @@
|
||||
type: 'pie',
|
||||
radius: ['28%', '45%'],
|
||||
center: ['38%', '48%'],
|
||||
label: { color: '#334155', formatter: '{b}' },
|
||||
label: { show: false },
|
||||
labelLine: { show: false },
|
||||
data: [
|
||||
{ value: overviewData.checkedIn || 0, name: 'Checked In' },
|
||||
{ value: overviewData.pending || 0, name: 'Not Check-in Yet' }
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</section>
|
||||
|
||||
<section class="card p-4">
|
||||
<form method="get" action="{{b "/progress"}}" class="grid gap-3 md:grid-cols-3">
|
||||
<form id="progress-filter-form" method="get" action="{{b "/progress"}}" class="grid gap-3 md:grid-cols-3">
|
||||
<div class="md:col-span-2">
|
||||
<label for="search" class="mb-2 block text-sm font-medium text-slate-600">Search Patient</label>
|
||||
<input id="search" name="search" value="{{.Search}}" type="text" placeholder="Nama atau Employee ID"
|
||||
@@ -96,7 +96,7 @@
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card overflow-hidden">
|
||||
<section id="progress-list" class="card overflow-hidden">
|
||||
<div class="flex items-center justify-between border-b border-slate-100 px-5 py-3">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-slate-700">Patient Resume List</h2>
|
||||
@@ -193,4 +193,25 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</section>
|
||||
<script>
|
||||
(function() {
|
||||
const progressFilterForm = document.getElementById('progress-filter-form');
|
||||
if (progressFilterForm) {
|
||||
progressFilterForm.addEventListener('submit', function () {
|
||||
sessionStorage.setItem('progress-scroll-to-list', '1');
|
||||
});
|
||||
}
|
||||
|
||||
const shouldScrollToList = sessionStorage.getItem('progress-scroll-to-list') === '1';
|
||||
if (shouldScrollToList) {
|
||||
sessionStorage.removeItem('progress-scroll-to-list');
|
||||
const listSection = document.getElementById('progress-list');
|
||||
if (listSection) {
|
||||
requestAnimationFrame(function () {
|
||||
listSection.scrollIntoView({ behavior: 'auto', block: 'start' });
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user