Pembaruan tampilan Tri Dharma
This commit is contained in:
@@ -26,6 +26,20 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Lebar kolom dikunci (sama seperti tabel anggota di detail SK) */
|
||||
#pegawai-table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
#pegawai-table th:nth-child(1) { width: 32% !important; }
|
||||
#pegawai-table th:nth-child(2) { width: 30% !important; }
|
||||
#pegawai-table th:nth-child(3) { width: 14% !important; }
|
||||
#pegawai-table th:nth-child(4) { width: 24% !important; }
|
||||
|
||||
#pegawai-table tbody td.nama-col .text-truncate {
|
||||
max-width: 240px;
|
||||
}
|
||||
|
||||
#pegawai-table tbody td.nama-col > div {
|
||||
line-height: 1.3;
|
||||
}
|
||||
@@ -98,6 +112,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Pegawai</th>
|
||||
<th>Jabatan</th>
|
||||
<th class="d-none">NIP</th>
|
||||
<th>Status Aktif</th>
|
||||
<th>Status Pleno</th>
|
||||
@@ -137,8 +152,11 @@
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Skeleton selama data dimuat (kolom terlihat: Pegawai, Jabatan, Status Aktif, Status Pleno)
|
||||
pasangSkeletonSk('#pegawai-table', 5, ['tiga', 'dua', 'pil', 'pendek']);
|
||||
var table = $('#pegawai-table').DataTable({
|
||||
processing: true,
|
||||
autoWidth: false,
|
||||
processing: false,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('tri-dharma.pleno.data') }}",
|
||||
@@ -155,12 +173,30 @@
|
||||
render: function(data, type, row) {
|
||||
if (type !== 'display') { return data; }
|
||||
return '<div>' +
|
||||
'<div class="fw-semibold">' + (data || '-') + '</div>' +
|
||||
'<div class="fw-semibold text-truncate" title="' + $('<div>').text(data || '').html().replace(/"/g, '"') + '">' + (data || '-') + '</div>' +
|
||||
'<div class="text-muted small font-monospace">' + (row.nip || '-') + '</div>' +
|
||||
'<div class="mt-1">' + renderJenisPegawaiTag(row.jenis_pegawai) + '</div>' +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'jabatan_fungsional_nama',
|
||||
name: 'jabatan_fungsional_nama',
|
||||
orderable: false,
|
||||
render: function(data, type, row) {
|
||||
if (type !== 'display') { return data; }
|
||||
var escape = function(v) { return $('<div>').text(v).html().replace(/"/g, '"'); };
|
||||
var baris = function(label, nilai, extraClass) {
|
||||
var teks = nilai ? escape(nilai) : '-';
|
||||
return '<div class="text-muted small ' + extraClass + '">' + label + '</div>' +
|
||||
'<div class="fw-semibold text-truncate" title="' + (nilai ? teks : '') + '">' + teks + '</div>';
|
||||
};
|
||||
return '<div>' +
|
||||
baris('Fungsional', row.jabatan_fungsional_nama, '') +
|
||||
baris('Tambahan', row.jabatan_dtt_nama, 'mt-1') +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'nip',
|
||||
name: 'nip',
|
||||
@@ -295,34 +331,28 @@
|
||||
var url = $(this).attr('data-url');
|
||||
if (!url) { return; }
|
||||
|
||||
@if (Auth::user()->id == 1)
|
||||
$('body').css('cursor', 'wait');
|
||||
$(this).css('cursor', 'wait');
|
||||
window.location.href = url;
|
||||
@else
|
||||
var $row = $(this);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
$('body').css('cursor', 'wait');
|
||||
$row.css('cursor', 'wait');
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showWarning('Peringatan', response.message || 'Periode verifikasi tidak aktif');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
var message = 'Periode verifikasi tidak aktif';
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
showWarning('Peringatan', message);
|
||||
var $row = $(this);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
$('body').css('cursor', 'wait');
|
||||
$row.css('cursor', 'wait');
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showInfo('Info', response.message || 'Periode verifikasi tidak aktif');
|
||||
}
|
||||
});
|
||||
@endif
|
||||
},
|
||||
error: function(xhr) {
|
||||
var message = 'Periode verifikasi tidak aktif';
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
showInfo('Info', message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(window).on('pageshow', function() {
|
||||
|
||||
Reference in New Issue
Block a user