create redirect link for dashboard pimpinan

This commit is contained in:
arifal
2025-05-14 20:56:36 +07:00
parent 501a76bc81
commit 99e2c214b6
6 changed files with 160 additions and 46 deletions

View File

@@ -34,11 +34,42 @@ class PbgTasks {
pbgType: "berita_acara",
bindFlag: "uploadHandlerBoundBeritaAcara",
});
this.initTableRequestAssignment();
this.handleFilterDatatable();
this.handleSendNotification();
}
initTableRequestAssignment() {
handleFilterDatatable() {
const form = document.getElementById("filter-form");
const filterSelect = document.getElementById("filter-select");
const urlParams = new URLSearchParams(window.location.search);
const initialFilter = urlParams.get("filter") || "";
this.initTableRequestAssignment(initialFilter); // Initial load with query param
form.addEventListener("submit", (e) => {
e.preventDefault();
const selectedFilter = filterSelect.value;
const params = new URLSearchParams(window.location.search);
params.set("filter", selectedFilter);
// Update the URL without reloading
window.history.replaceState(
{},
"",
`${location.pathname}?${params}`
);
// Call the method again with the selected filter
this.initTableRequestAssignment(selectedFilter);
});
}
initTableRequestAssignment(filterValue = "") {
const urlBase = `${GlobalConfig.apiHost}/api/request-assignments`;
// Ambil token
const token = document
.querySelector('meta[name="api-token"]')
@@ -124,7 +155,10 @@ class PbgTasks {
],
search: {
server: {
url: (prev, keyword) => `${prev}?search=${keyword}`,
url: (prev, keyword) =>
`${prev}${
prev.includes("?") ? "&" : "?"
}search=${keyword}`,
},
debounceTimeout: 1000,
},
@@ -139,7 +173,7 @@ class PbgTasks {
},
sort: true,
server: {
url: `${GlobalConfig.apiHost}/api/request-assignments`,
url: `${urlBase}?filter=${filterValue}`,
credentials: "include",
headers: {
Authorization: `Bearer ${token}`,

View File

@@ -38,7 +38,8 @@
'document_type' => '',
'document_id' => 'chart-target-pad',
'visible_small_circle' => true,
'style' => 'left:200px;'
'style' => 'left:200px;',
'document_url' => route('data-settings.index', ['menu_id' => 12])
])
@endcomponent
@@ -56,7 +57,8 @@
'document_type' => 'Pemohon',
'document_id' => 'chart-total-potensi',
'visible_small_circle' => true,
'style' => 'left:400px;top:150px;'
'style' => 'left:400px;top:150px;',
'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'all'])
])
@endcomponent
@@ -72,7 +74,8 @@
'document_type' => '',
'document_id' => 'chart-potensi-tata-ruang',
'visible_small_circle' => true,
'style' => 'left:600px;'
'style' => 'left:600px;',
'document_url' => route('web-spatial-plannings.index', ['menu_id' => 24])
])
@endcomponent
@@ -85,7 +88,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-non-business',
'visible_small_circle' => true,
'style' => 'left:900px;top:150px;'
'style' => 'left:900px;top:150px;',
'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'non-business'])
])
@endcomponent
@@ -95,7 +99,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-business',
'visible_small_circle' => true,
'style' => 'left:900px;top:400px;'
'style' => 'left:900px;top:400px;',
'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'business'])
])
@endcomponent
@@ -105,7 +110,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-berkas-terverifikasi',
'visible_small_circle' => true,
'style' => 'top:300px;left:200px;'
'style' => 'top:300px;left:200px;',
'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'verified'])
])
@endcomponent
@@ -121,7 +127,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-berkas-belum-terverifikasi',
'visible_small_circle' => true,
'style' => 'top:300px;left:600px;'
'style' => 'top:300px;left:600px;',
'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'non-verified'])
])
@endcomponent
@@ -138,7 +145,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-realisasi-tebit-pbg',
'visible_small_circle' => true,
'style' => 'top:550px;left:100px;'
'style' => 'top:550px;left:100px;',
'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399'
])
@endcomponent
@@ -151,7 +159,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-menunggu-klik-dpmptsp',
'visible_small_circle' => true,
'style' => 'top:550px;left:400px'
'style' => 'top:550px;left:400px',
'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399'
])
@endcomponent
@@ -164,7 +173,8 @@
'document_type' => 'Berkas',
'document_id' => 'chart-proses-dinas-teknis',
'visible_small_circle' => true,
'style' => 'top:550px;left:700px'
'style' => 'top:550px;left:700px',
'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399'
])
@endcomponent
</div>

View File

@@ -42,9 +42,29 @@
<a href="{{ route('pbg-task.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
@endif
</div>
<form id="filter-form">
<div class="row pb-3">
<div class="col-md-4">
<select name="filter" id="filter-select" class="form-select">
@foreach ($filterOptions as $key => $label)
<option value="{{ $key }}" {{ request('filter') == $key ? 'selected' : '' }}>
{{ $label }}
</option>
@endforeach
</select>
<input name="menu_id" value="13" type="hidden" />
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary w-100">Apply</button>
</div>
</div>
</form>
<!-- Table or Data Display Area -->
<div id="table-pbg-tasks"
data-updater="{{ $updater }}"
data-destroyer="{{ $destroyer }}">
data-updater="{{ $updater }}"
data-destroyer="{{ $destroyer }}">
</div>
</div>
</div>