done next -> testing
This commit is contained in:
parent
de1216c5f5
commit
21012d38c3
@ -25,6 +25,7 @@ class DashboardController extends Controller
|
|||||||
public function index(){
|
public function index(){
|
||||||
$katDok = MasterKategori::where('statusenabled', true)->select('master_kategori_directory_id', 'nama_kategori_directory')->get();
|
$katDok = MasterKategori::where('statusenabled', true)->select('master_kategori_directory_id', 'nama_kategori_directory')->get();
|
||||||
$klasifikasiDok = MasterKlasifikasi::where('statusenabled', true)->select('master_klasifikasi_directory_id', 'nama_klasifikasi_directory')->get();
|
$klasifikasiDok = MasterKlasifikasi::where('statusenabled', true)->select('master_klasifikasi_directory_id', 'nama_klasifikasi_directory')->get();
|
||||||
|
$prefillFilter = session()->pull('dashboard_prefill');
|
||||||
|
|
||||||
$authMapping = auth()->user()?->dataUser?->mappingUnitKerjaPegawai[0];
|
$authMapping = auth()->user()?->dataUser?->mappingUnitKerjaPegawai[0];
|
||||||
$authUnitKerja = $authMapping->objectunitkerjapegawaifk;
|
$authUnitKerja = $authMapping->objectunitkerjapegawaifk;
|
||||||
@ -37,13 +38,37 @@ class DashboardController extends Controller
|
|||||||
'klasifikasiDok' => $klasifikasiDok,
|
'klasifikasiDok' => $klasifikasiDok,
|
||||||
'authUnitKerja' => $authUnitKerja,
|
'authUnitKerja' => $authUnitKerja,
|
||||||
'authSubUnitKerja' => $authSubUnitKerja,
|
'authSubUnitKerja' => $authSubUnitKerja,
|
||||||
'allAkses' => $allAkses ?? null
|
'allAkses' => $allAkses ?? null,
|
||||||
|
'prefillFilter' => $prefillFilter
|
||||||
];
|
];
|
||||||
return view('dashboard.index', $payload);
|
return view('dashboard.index', $payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setDashboardPrefill(Request $request)
|
||||||
|
{
|
||||||
|
$payload = [
|
||||||
|
'unitId' => (string) $request->input('unitId', ''),
|
||||||
|
'subId' => (string) $request->input('subId', ''),
|
||||||
|
'kategoriId' => (string) $request->input('kategoriId', ''),
|
||||||
|
'unitName' => (string) $request->input('unitName', ''),
|
||||||
|
'subName' => (string) $request->input('subName', ''),
|
||||||
|
'kategoriName' => (string) $request->input('kategoriName', ''),
|
||||||
|
];
|
||||||
|
|
||||||
|
session(['dashboard_prefill' => $payload]);
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => true,
|
||||||
|
'message' => 'Prefill disimpan'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function dataUnitKerja(){
|
public function dataUnitKerja(){
|
||||||
$user = auth()->user()?->dataUser;
|
$user = auth()->user()?->dataUser;
|
||||||
|
$entryPegawaiId = auth()->user()?->objectpegawaifk;
|
||||||
|
$authMapping = $user?->mappingUnitKerjaPegawai[0] ?? null;
|
||||||
|
$authUnit = $authMapping?->objectunitkerjapegawaifk;
|
||||||
|
$authSub = $authMapping?->objectsubunitkerjapegawaifk;
|
||||||
$akses = AksesFile::where(['pegawai_id' => $user->id, 'statusenabled' => true])->first();
|
$akses = AksesFile::where(['pegawai_id' => $user->id, 'statusenabled' => true])->first();
|
||||||
$aksesAll = $akses?->akses ?? $akses?->all_akses ?? false;
|
$aksesAll = $akses?->akses ?? $akses?->all_akses ?? false;
|
||||||
$detailUnitIds = collect();
|
$detailUnitIds = collect();
|
||||||
@ -62,6 +87,11 @@ class DashboardController extends Controller
|
|||||||
$allowedUnitIds = collect([$akses->unit_akses]);
|
$allowedUnitIds = collect([$akses->unit_akses]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$limitPrivateToSubUnit = false;
|
||||||
|
if (!$aksesAll && !$allowedUnitIds && $authUnit) {
|
||||||
|
$allowedUnitIds = collect([$authUnit]);
|
||||||
|
$limitPrivateToSubUnit = true;
|
||||||
|
}
|
||||||
|
|
||||||
$kategori = request('kategori');
|
$kategori = request('kategori');
|
||||||
$filterUnit = request('unitKerja');
|
$filterUnit = request('unitKerja');
|
||||||
@ -70,28 +100,61 @@ class DashboardController extends Controller
|
|||||||
$subArray = $subUnit ? explode(',', $subUnit) : [];
|
$subArray = $subUnit ? explode(',', $subUnit) : [];
|
||||||
$katArray = $kategori ? explode(',', $kategori) : [];
|
$katArray = $kategori ? explode(',', $kategori) : [];
|
||||||
$katDok = MasterKategori::when($katArray, fn($q) => $q->whereIn('master_kategori_directory_id', $katArray))->where('statusenabled', true)->select('master_kategori_directory_id', 'nama_kategori_directory')->get();
|
$katDok = MasterKategori::when($katArray, fn($q) => $q->whereIn('master_kategori_directory_id', $katArray))->where('statusenabled', true)->select('master_kategori_directory_id', 'nama_kategori_directory')->get();
|
||||||
|
|
||||||
|
$applyFileFilters = function ($q) use ($keyword, $katArray, $subArray, $entryPegawaiId) {
|
||||||
|
$q->where(function($subQuery) use ($entryPegawaiId){
|
||||||
|
$subQuery->where('status_action', '!=', 'rejected')
|
||||||
|
->orWhere(function ($pending) use ($entryPegawaiId) {
|
||||||
|
$pending->whereNull('status_action')
|
||||||
|
->where('pegawai_id_entry', $entryPegawaiId);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
->when($subArray, fn($sq) => $sq->whereIn('id_sub_unit_kerja', $subArray))
|
||||||
|
->when($katArray, fn($sq) => $sq->whereIn('master_kategori_directory_id', $katArray))
|
||||||
|
->when($keyword, fn($sq) =>
|
||||||
|
$sq->where(function ($query) use ($keyword) {
|
||||||
|
$query->where('file', 'ilike', "%{$keyword}%");
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
$applyAccessFilter = function ($q) use ($aksesAll, $allowedUnitIds, $limitPrivateToSubUnit, $authSub) {
|
||||||
|
if ($aksesAll) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$hasPrivateScope = ($allowedUnitIds && $allowedUnitIds->isNotEmpty())
|
||||||
|
|| ($limitPrivateToSubUnit && $authSub);
|
||||||
|
$q->where(function ($query) use ($allowedUnitIds, $limitPrivateToSubUnit, $authSub, $hasPrivateScope) {
|
||||||
|
$query->where('permission_file', true);
|
||||||
|
if ($hasPrivateScope) {
|
||||||
|
$query->orWhere(function ($sub) use ($allowedUnitIds, $limitPrivateToSubUnit, $authSub) {
|
||||||
|
$sub->where('permission_file', false);
|
||||||
|
if ($allowedUnitIds && $allowedUnitIds->isNotEmpty()) {
|
||||||
|
$sub->whereIn('id_unit_kerja', $allowedUnitIds);
|
||||||
|
}
|
||||||
|
if ($limitPrivateToSubUnit && $authSub) {
|
||||||
|
$sub->where('id_sub_unit_kerja', $authSub);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$applyFileQuery = function ($q) use ($applyFileFilters, $applyAccessFilter) {
|
||||||
|
$applyFileFilters($q);
|
||||||
|
$applyAccessFilter($q);
|
||||||
|
};
|
||||||
|
|
||||||
if ($katArray && $filterUnit && $subArray) {
|
if ($katArray && $filterUnit && $subArray) {
|
||||||
/* mode pencarian lengkap */
|
/* mode pencarian lengkap */
|
||||||
if ($allowedUnitIds && !$allowedUnitIds->contains((int) $filterUnit)) {
|
|
||||||
$unitKerja = collect();
|
|
||||||
} else {
|
|
||||||
$unitKerja = UnitKerja::where('statusenabled', true)
|
$unitKerja = UnitKerja::where('statusenabled', true)
|
||||||
->where('id', $filterUnit)
|
->where('id', $filterUnit)
|
||||||
->with(['subUnitKerja' => fn($q) => $q->whereIn('id', $subArray)
|
->with(['subUnitKerja' => fn($q) => $q->whereIn('id', $subArray)
|
||||||
->with(['fileDirectory' => fn($q) => $q
|
->whereHas('fileDirectory', fn($f) => $applyFileQuery($f))
|
||||||
->where('id_unit_kerja', $filterUnit)->whereNotNull('status_action')
|
->with(['fileDirectory' => fn($f) => $applyFileQuery($f)])
|
||||||
->when($subArray, fn($q) => $q->whereIn('id_sub_unit_kerja', $subArray))
|
|
||||||
->when($katArray, fn($q) => $q->whereIn('master_kategori_directory_id', $katArray))
|
|
||||||
->when($keyword, fn($q) =>
|
|
||||||
$q->where(function($query) use ($keyword) {
|
|
||||||
$query->where('file', 'ilike', "%{$keyword}%");
|
|
||||||
})
|
|
||||||
)
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
->select('id', 'name')
|
->select('id', 'name')
|
||||||
->get();
|
->get();
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ($aksesAll) {
|
} elseif ($aksesAll) {
|
||||||
/* all akses */
|
/* all akses */
|
||||||
@ -107,33 +170,36 @@ class DashboardController extends Controller
|
|||||||
|
|
||||||
} elseif ($allowedUnitIds) {
|
} elseif ($allowedUnitIds) {
|
||||||
$unitKerja = UnitKerja::where('statusenabled', true)
|
$unitKerja = UnitKerja::where('statusenabled', true)
|
||||||
->whereIn('id', $allowedUnitIds)
|
->where(function ($q) use ($allowedUnitIds, $applyFileQuery) {
|
||||||
->with([
|
if ($allowedUnitIds && $allowedUnitIds->isNotEmpty()) {
|
||||||
'subUnitKerja' => fn($q) => $q->with([
|
$q->whereIn('id', $allowedUnitIds);
|
||||||
'fileDirectory' => fn($f) => $f->whereNotNull('status_action')->when($keyword, fn($q) =>
|
}
|
||||||
$q->where(function($query) use ($keyword) {
|
$q->orWhereHas('subUnitKerja.fileDirectory', fn($f) => $applyFileQuery($f));
|
||||||
$query->where('file', 'ilike', "%{$keyword}%");
|
|
||||||
})
|
})
|
||||||
)
|
->with([
|
||||||
])
|
'subUnitKerja' => fn($q) => $q->whereHas('fileDirectory', fn($f) => $applyFileQuery($f))
|
||||||
|
->with(['fileDirectory' => fn($f) => $applyFileQuery($f)])
|
||||||
])
|
])
|
||||||
->select('id', 'name')
|
->select('id', 'name')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$authUnit = $user?->mappingUnitKerjaPegawai[0]?->objectunitkerjapegawaifk;
|
|
||||||
$authSub = $user?->mappingUnitKerjaPegawai[0]?->objectsubunitkerjapegawaifk;
|
|
||||||
|
|
||||||
$unitKerja = UnitKerja::where('statusenabled', true)
|
$unitKerja = UnitKerja::where('statusenabled', true)
|
||||||
->where('id', $authUnit)
|
->where(function ($q) use ($authUnit, $applyFileQuery) {
|
||||||
->with([ // 1. sub-unit milik user
|
if ($authUnit) {
|
||||||
'subUnitKerja' => fn($q) => $q->where('id', $authSub)
|
$q->where('id', $authUnit);
|
||||||
->with([ // 2. file-directory + filter keyword
|
}
|
||||||
'fileDirectory' => fn($f) => $f->whereNotNull('status_action')->when($keyword, fn($q) =>
|
$q->orWhereHas('subUnitKerja.fileDirectory', fn($f) => $applyFileQuery($f));
|
||||||
$q->where(function($query) use ($keyword) {
|
|
||||||
$query->where('file', 'ilike', "%{$keyword}%");
|
|
||||||
})
|
})
|
||||||
)
|
->with([ // 1. sub-unit milik user
|
||||||
|
'subUnitKerja' => fn($q) => $q->where(function ($sq) use ($authSub, $applyFileQuery) {
|
||||||
|
if ($authSub) {
|
||||||
|
$sq->where('id', $authSub);
|
||||||
|
}
|
||||||
|
$sq->orWhereHas('fileDirectory', fn($f) => $applyFileQuery($f));
|
||||||
|
})
|
||||||
|
->with([ // 2. file-directory + filter keyword
|
||||||
|
'fileDirectory' => fn($f) => $applyFileQuery($f)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
->select('id', 'name')
|
->select('id', 'name')
|
||||||
@ -295,7 +361,7 @@ class DashboardController extends Controller
|
|||||||
$paths = [];
|
$paths = [];
|
||||||
foreach ($rows as $r) {
|
foreach ($rows as $r) {
|
||||||
if(!empty($r['sub_unit_id'])){
|
if(!empty($r['sub_unit_id'])){
|
||||||
$files = FileDirectory::where('id_sub_unit_kerja', $r['sub_unit_id'])->where('statusenabled', true)->pluck('file');
|
$files = FileDirectory::where('id_sub_unit_kerja', $r['sub_unit_id'])->where('statusenabled', true)->where('status_action', 'approved')->pluck('file');
|
||||||
|
|
||||||
$paths = array_merge($paths, $files->toArray());
|
$paths = array_merge($paths, $files->toArray());
|
||||||
}
|
}
|
||||||
@ -340,9 +406,9 @@ class DashboardController extends Controller
|
|||||||
$type = request('type');
|
$type = request('type');
|
||||||
|
|
||||||
if($type === "unit"){
|
if($type === "unit"){
|
||||||
$data = FileDirectory::where('id_unit_kerja', $id)->where('statusenabled', true)->pluck('file');
|
$data = FileDirectory::where('id_unit_kerja', $id)->where('statusenabled', true)->where('status_action', 'approved')->pluck('file');
|
||||||
}else{
|
}else{
|
||||||
$data = FileDirectory::where('id_sub_unit_kerja', $id)->where('statusenabled', true)->pluck('file');
|
$data = FileDirectory::where('id_sub_unit_kerja', $id)->where('statusenabled', true)->where('status_action', 'approved')->pluck('file');
|
||||||
}
|
}
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
return response()->json(['message' => 'File tidak ditemukan'], 404);
|
return response()->json(['message' => 'File tidak ditemukan'], 404);
|
||||||
@ -393,11 +459,18 @@ class DashboardController extends Controller
|
|||||||
$perPage = (int) request('per_page', 10);
|
$perPage = (int) request('per_page', 10);
|
||||||
$authUnitId = auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]?->objectunitkerjapegawaifk;
|
$authUnitId = auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]?->objectunitkerjapegawaifk;
|
||||||
$user = auth()->user()?->dataUser;
|
$user = auth()->user()?->dataUser;
|
||||||
|
$entryPegawaiId = auth()->user()?->objectpegawaifk;
|
||||||
$akses = AksesFile::where(['pegawai_id' => $user->id, 'statusenabled' => true])->first();
|
$akses = AksesFile::where(['pegawai_id' => $user->id, 'statusenabled' => true])->first();
|
||||||
$keyword = request('keyword');
|
$keyword = request('keyword');
|
||||||
|
|
||||||
$query = FileDirectory::where('statusenabled', true)->whereNotNull('status_action')
|
$query = FileDirectory::where('statusenabled', true)
|
||||||
->when($keyword, function ($q) use ($keyword) {
|
->where(function($subQuery) use ($entryPegawaiId){
|
||||||
|
$subQuery->where('status_action', '!=', 'rejected')
|
||||||
|
->orWhere(function ($pending) use ($entryPegawaiId) {
|
||||||
|
$pending->whereNull('status_action')
|
||||||
|
->where('pegawai_id_entry', $entryPegawaiId);
|
||||||
|
});
|
||||||
|
})->when($keyword, function ($q) use ($keyword) {
|
||||||
$q->where(function ($sub) use ($keyword) {
|
$q->where(function ($sub) use ($keyword) {
|
||||||
$sub->where('file', 'ILIKE', "%{$keyword}%")
|
$sub->where('file', 'ILIKE', "%{$keyword}%")
|
||||||
->orWhere('no_dokumen', 'ILIKE', "%{$keyword}%");
|
->orWhere('no_dokumen', 'ILIKE', "%{$keyword}%");
|
||||||
@ -749,7 +822,10 @@ class DashboardController extends Controller
|
|||||||
$end = request('end_date');
|
$end = request('end_date');
|
||||||
$authUnit = auth()->user()->masterPersetujuan->details->pluck('unit_pegawai_id')->unique()->toArray();
|
$authUnit = auth()->user()->masterPersetujuan->details->pluck('unit_pegawai_id')->unique()->toArray();
|
||||||
|
|
||||||
$query = FileDirectory::where('statusenabled', true)->whereNull('status_action')->whereIn('id_unit_kerja', $authUnit)->orderBy('entry_at','desc');
|
$query = FileDirectory::where('statusenabled', true)->where(function($q){
|
||||||
|
$q->where('status_action', '!=', 'approved')
|
||||||
|
->orWhereNull('status_action');
|
||||||
|
})->whereIn('id_unit_kerja', $authUnit)->orderBy('entry_at','desc');
|
||||||
if($keyword){
|
if($keyword){
|
||||||
$query->where(function($q) use ($keyword){
|
$query->where(function($q) use ($keyword){
|
||||||
$q->where('file', 'ILIKE', "%{$keyword}%")
|
$q->where('file', 'ILIKE', "%{$keyword}%")
|
||||||
@ -777,6 +853,7 @@ class DashboardController extends Controller
|
|||||||
'entry_at' => $item->entry_at,
|
'entry_at' => $item->entry_at,
|
||||||
'tanggal_terbit' => $item->tanggal_terbit,
|
'tanggal_terbit' => $item->tanggal_terbit,
|
||||||
'permission_file' => $item->permission_file,
|
'permission_file' => $item->permission_file,
|
||||||
|
'status_action' => $item->status_action
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
@ -47,11 +47,16 @@ $(document).ready(function() {
|
|||||||
loadSubUnitKerja(initialUnit);
|
loadSubUnitKerja(initialUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let prefillSubIds = [];
|
||||||
|
let prefillSubMeta = {};
|
||||||
|
|
||||||
// jalankan setiap kali unit_kerja berubah
|
// jalankan setiap kali unit_kerja berubah
|
||||||
$('.unit_kerja').on('change', function(){
|
$('.unit_kerja').on('change', function(){
|
||||||
let idUnit = $(this).val();
|
let idUnit = $(this).val();
|
||||||
if(idUnit){
|
if(idUnit){
|
||||||
loadSubUnitKerja(idUnit);
|
loadSubUnitKerja(idUnit, prefillSubIds, prefillSubMeta);
|
||||||
|
prefillSubIds = [];
|
||||||
|
prefillSubMeta = {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -62,9 +67,67 @@ $(document).ready(function() {
|
|||||||
}else{
|
}else{
|
||||||
selectOptionUnitKerjaV2(0);
|
selectOptionUnitKerjaV2(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.__folderPrefillApplied) return;
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const prefill = window.__prefillFromSession || null;
|
||||||
|
|
||||||
|
const unitId = prefill?.unitId || urlParams.get('unitKerja');
|
||||||
|
const subParam = prefill?.subId || urlParams.get('subUnit');
|
||||||
|
const katParam = prefill?.kategoriId || urlParams.get('kategori');
|
||||||
|
const unitName = prefill?.unitName || urlParams.get('unitName');
|
||||||
|
const subName = prefill?.subName || urlParams.get('subName');
|
||||||
|
const kategoriName = prefill?.kategoriName || urlParams.get('kategoriName');
|
||||||
|
|
||||||
|
let prefillSubIdsFinal = [];
|
||||||
|
let prefillKatIdsFinal = [];
|
||||||
|
|
||||||
|
if (unitId) {
|
||||||
|
window.__folderPrefillApplied = true;
|
||||||
|
window.__prefillFromSession = null;
|
||||||
|
$('.unit_kerja').val(null).trigger('change');
|
||||||
|
$('.sub_unit_kerja').val(null).trigger('change');
|
||||||
|
$('.kategori_dok').val(null).trigger('change');
|
||||||
|
|
||||||
|
const unitLabel = unitName || unitId;
|
||||||
|
const unitOption = new Option(unitLabel, unitId, true, true);
|
||||||
|
const selectedSubIds = subParam ? Array.from(new Set(subParam.split(',').filter(Boolean))) : [];
|
||||||
|
const subNames = subName ? subName.split(',').map(s => s.trim()).filter(Boolean) : [];
|
||||||
|
|
||||||
|
prefillSubIds = selectedSubIds;
|
||||||
|
prefillSubMeta = selectedSubIds.reduce((acc, id, idx) => {
|
||||||
|
let label = subNames[idx] || subNames[0] || id;
|
||||||
|
label = label.replace(/^\d+\s*\/\s*/, '');
|
||||||
|
acc[id] = label;
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
$('.unit_kerja').append(unitOption).trigger('change');
|
||||||
|
|
||||||
|
if (selectedSubIds.length) {
|
||||||
|
$('.sub_unit_kerja').val(selectedSubIds).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
|
prefillSubIdsFinal = selectedSubIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (katParam) {
|
||||||
|
const katIds = Array.from(new Set(katParam.split(',').filter(Boolean)));
|
||||||
|
if (katIds.length) {
|
||||||
|
$('.kategori_dok').val(katIds).trigger('change');
|
||||||
|
prefillKatIdsFinal = katIds;
|
||||||
|
} else if (kategoriName) {
|
||||||
|
const katOption = new Option(kategoriName, katParam, true, true);
|
||||||
|
$('.kategori_dok').append(katOption).trigger('change');
|
||||||
|
prefillKatIdsFinal = katParam ? [katParam] : [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((unitId || subParam || katParam) && typeof index === 'function') {
|
||||||
|
index(prefillKatIdsFinal, unitId, prefillSubIdsFinal, '');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadSubUnitKerja(unitId){
|
function loadSubUnitKerja(unitId, selectedSubIds = [], selectedSubMeta = {}){
|
||||||
$('.sub_unit_kerja').empty().append('<option value="" disabled>-- Pilih Sub Unit Kerja --</option>');
|
$('.sub_unit_kerja').empty().append('<option value="" disabled>-- Pilih Sub Unit Kerja --</option>');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -73,10 +136,24 @@ function loadSubUnitKerja(unitId){
|
|||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (response?.data) {
|
if (response?.data) {
|
||||||
response.data.forEach(unit => {
|
response.data.forEach(unit => {
|
||||||
let selected = (authSubUnitKerja && unit.id === authSubUnitKerja.objectsubunitkerjapegawaifk);
|
let selected = false;
|
||||||
|
if (selectedSubIds.length) {
|
||||||
|
selected = selectedSubIds.includes(String(unit.id));
|
||||||
|
} else if (authSubUnitKerja) {
|
||||||
|
selected = unit.id === authSubUnitKerja.objectsubunitkerjapegawaifk;
|
||||||
|
}
|
||||||
const option = new Option(unit.name, unit.id, false, selected);
|
const option = new Option(unit.name, unit.id, false, selected);
|
||||||
$('.sub_unit_kerja').append(option);
|
$('.sub_unit_kerja').append(option);
|
||||||
});
|
});
|
||||||
|
if (selectedSubIds.length) {
|
||||||
|
selectedSubIds.forEach(id => {
|
||||||
|
if ($(`.sub_unit_kerja option[value="${id}"]`).length === 0) {
|
||||||
|
const label = selectedSubMeta[id] || id;
|
||||||
|
const opt = new Option(label, id, false, true);
|
||||||
|
$('.sub_unit_kerja').append(opt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
$('.sub_unit_kerja').trigger('change');
|
$('.sub_unit_kerja').trigger('change');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,4 +398,3 @@ function selectOptionUnitKerjaV2(colCount) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,9 +10,18 @@ function renderTree(units, katDok, keyword) {
|
|||||||
<li class="file-tree-li folder">
|
<li class="file-tree-li folder">
|
||||||
<input class="form-check-input" type="checkbox" data-select="unit" data-unit_id="${el?.id}">
|
<input class="form-check-input" type="checkbox" data-select="unit" data-unit_id="${el?.id}">
|
||||||
<span class="fw-bolder">📂 ${el.name}</span>
|
<span class="fw-bolder">📂 ${el.name}</span>
|
||||||
<button type="button" class="btn btn-primary btn-sm" onclick="download(this)" data-part="unit" data-id="${el?.id}">
|
<div class="dropdown d-inline ms-1">
|
||||||
<i class="fa-solid fa-download"></i>
|
<button type="button" class="btn btn-sm btn-link text-decoration-none folder-menu-icon dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Menu folder">
|
||||||
|
<i class="fa-solid fa-ellipsis-vertical"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<button type="button" class="dropdown-item folder-download" data-part="unit" data-id="${el?.id}">
|
||||||
|
<i class="fa-solid fa-download me-2"></i>Download
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
${Array.isArray(el.sub_unit_kerja) && el.sub_unit_kerja.length > 0 ? `
|
${Array.isArray(el.sub_unit_kerja) && el.sub_unit_kerja.length > 0 ? `
|
||||||
<ul class="file-tree-ul mt-1 ms-2">
|
<ul class="file-tree-ul mt-1 ms-2">
|
||||||
@ -21,9 +30,18 @@ function renderTree(units, katDok, keyword) {
|
|||||||
\
|
\
|
||||||
<input class="form-check-input" type="checkbox" data-select="sub_unit" data-unit_id="${el.id}" data-sub_unit_id="${sub?.id}" >
|
<input class="form-check-input" type="checkbox" data-select="sub_unit" data-unit_id="${el.id}" data-sub_unit_id="${sub?.id}" >
|
||||||
<span class="fw-semibold">📂 ${sub.name}</span>
|
<span class="fw-semibold">📂 ${sub.name}</span>
|
||||||
<button type="button" class="btn btn-outline-primary btn-sm ms-auto" onclick="download(this)" data-part="sub_unit" data-id="${sub?.id}">
|
<div class="dropdown d-inline ms-1">
|
||||||
<i class="fa-solid fa-download"></i>
|
<button type="button" class="btn btn-sm btn-link text-decoration-none folder-menu-icon dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Menu folder">
|
||||||
|
<i class="fa-solid fa-ellipsis-vertical"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<button type="button" class="dropdown-item folder-download" data-part="sub_unit" data-id="${sub?.id}">
|
||||||
|
<i class="fa-solid fa-download me-2"></i>Download
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
${Array.isArray(katDok) && katDok.length > 0 ? `
|
${Array.isArray(katDok) && katDok.length > 0 ? `
|
||||||
<ul class="file-tree-ul ms-2">
|
<ul class="file-tree-ul ms-2">
|
||||||
@ -41,20 +59,33 @@ function renderTree(units, katDok, keyword) {
|
|||||||
${files.map(file => {
|
${files.map(file => {
|
||||||
let fileName = file.file.split('/').pop();
|
let fileName = file.file.split('/').pop();
|
||||||
const isPublic = String(file.permission_file).toLowerCase() === 'true' || file.permission_file === 1 || file.permission_file === '1';
|
const isPublic = String(file.permission_file).toLowerCase() === 'true' || file.permission_file === 1 || file.permission_file === '1';
|
||||||
|
console.log(file);
|
||||||
|
let statusLabel = '';
|
||||||
|
let statusClass = '';
|
||||||
|
|
||||||
|
if (!file.status_action) {
|
||||||
|
statusLabel = 'Pending';
|
||||||
|
statusClass = 'bg-warning text-dark';
|
||||||
|
} else if (isPublic) {
|
||||||
|
statusLabel = 'Umum';
|
||||||
|
statusClass = 'bg-success';
|
||||||
|
} else {
|
||||||
|
statusLabel = 'Internal Unit';
|
||||||
|
statusClass = 'bg-secondary';
|
||||||
|
}
|
||||||
return `
|
return `
|
||||||
<li class="file-tree-li">
|
<li class="file-tree-li">
|
||||||
<div class="d-flex align-items-center gap-2 flex-wrap">
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
||||||
<span>📄</span>
|
<span>📄</span>
|
||||||
<a href="#" class="file-link"
|
<a href="#" class="file-link ${!file?.status_action ? 'fst-italic' :''}"
|
||||||
data-file="${file?.file}"
|
data-file="${file?.file}"
|
||||||
data-fileName="${fileName || '-'}"
|
data-fileName="${fileName || '-'}"
|
||||||
data-id="${file.file_directory_id}"
|
data-id="${file.file_directory_id}"
|
||||||
data-no_dokumen="${file.no_dokumen || '-'}"
|
data-no_dokumen="${file.no_dokumen || '-'}"
|
||||||
data-tanggal_terbit="${file.tanggal_terbit || '-'}"
|
data-tanggal_terbit="${file.tanggal_terbit || '-'}"
|
||||||
data-permission_file="${file.permission_file || '-'}">${fileName}</a>
|
data-permission_file="${file.permission_file || '-'}">${fileName}</a>
|
||||||
<span class="badge ${isPublic ? 'bg-success' : 'bg-secondary'}">
|
<span class="badge ${statusClass}">
|
||||||
${isPublic ? 'Umum' : 'Internal'}
|
${statusLabel}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -94,6 +125,7 @@ function index(kategori_dok = [], unitKerja = null, subUnitKerja = [], keyword =
|
|||||||
if (Array.isArray(data?.data?.unitKerja)) {
|
if (Array.isArray(data?.data?.unitKerja)) {
|
||||||
file_tree.innerHTML = renderTree(data.data.unitKerja, data.data.katDok, keyword);
|
file_tree.innerHTML = renderTree(data.data.unitKerja, data.data.katDok, keyword);
|
||||||
|
|
||||||
|
// Toggle buka/tutup folder
|
||||||
// Toggle buka/tutup folder
|
// Toggle buka/tutup folder
|
||||||
file_tree.querySelectorAll(".folder > span").forEach(span => {
|
file_tree.querySelectorAll(".folder > span").forEach(span => {
|
||||||
span.addEventListener("click", () => {
|
span.addEventListener("click", () => {
|
||||||
@ -108,6 +140,7 @@ function index(kategori_dok = [], unitKerja = null, subUnitKerja = [], keyword =
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
file_tree.innerHTML = `
|
file_tree.innerHTML = `
|
||||||
<p style="color: primary">
|
<p style="color: primary">
|
||||||
@ -120,7 +153,19 @@ function index(kategori_dok = [], unitKerja = null, subUnitKerja = [], keyword =
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
index();
|
const initialParams = new URLSearchParams(window.location.search);
|
||||||
|
const initialUnit = initialParams.get('unitKerja');
|
||||||
|
const initialSub = initialParams.get('subUnit');
|
||||||
|
const initialKat = initialParams.get('kategori');
|
||||||
|
const initialKeyword = initialParams.get('keyword');
|
||||||
|
const initialSubArr = initialSub ? initialSub.split(',').filter(Boolean) : [];
|
||||||
|
const initialKatArr = initialKat ? initialKat.split(',').filter(Boolean) : [];
|
||||||
|
|
||||||
|
if (initialUnit || initialSubArr.length || initialKatArr.length || initialKeyword) {
|
||||||
|
index(initialKatArr, initialUnit, initialSubArr, initialKeyword || '');
|
||||||
|
} else {
|
||||||
|
index();
|
||||||
|
}
|
||||||
|
|
||||||
function referesh(){
|
function referesh(){
|
||||||
index()
|
index()
|
||||||
@ -280,3 +325,10 @@ function downloadMultiple(){
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Klik menu download dari ikon ⋮
|
||||||
|
document.addEventListener('click', function (e) {
|
||||||
|
const btn = e.target.closest('.folder-download');
|
||||||
|
if (!btn) return;
|
||||||
|
download(btn);
|
||||||
|
});
|
||||||
|
|||||||
@ -54,8 +54,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
`;
|
`;
|
||||||
return `
|
return `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${aksi}</td>
|
<td>${item?.status_action !== "rejected" ? aksi : ''}</td>
|
||||||
<td>${item.no_dokumen || '-'}</td>
|
<td>${item.no_dokumen || '-'}</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm ${item?.status_action !== "rejected" ? 'btn-warning' : 'btn-danger'} btn-warning ">
|
||||||
|
${item?.status_action !== "rejected" ? 'Pending' : 'Rejected'}
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
<td><a href="#" class="file-link"
|
<td><a href="#" class="file-link"
|
||||||
data-file="${item.file}"
|
data-file="${item.file}"
|
||||||
data-fileName="${item.fileName}"
|
data-fileName="${item.fileName}"
|
||||||
@ -115,7 +120,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
if (pageData.length === 0) {
|
if (pageData.length === 0) {
|
||||||
tbody.innerHTML = `
|
tbody.innerHTML = `
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-center text-muted py-4">
|
<td colspan="7" class="text-center text-muted py-4">
|
||||||
Tidak ada data
|
Tidak ada data
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -42,6 +42,22 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.folder-menu-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-tree-li.folder:hover .folder-menu-icon {
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-menu-icon.dropdown-toggle::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.collapsed > .file-tree-ul {
|
.collapsed > .file-tree-ul {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -129,12 +145,11 @@
|
|||||||
<span class="badge bg-secondary">Internal</span>
|
<span class="badge bg-secondary">Internal</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="file_tree"></div>
|
<div id="file_tree" style="max-height: 60vh; overflow-y:auto;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -147,6 +162,7 @@
|
|||||||
const allAkses = @json($allAkses);
|
const allAkses = @json($allAkses);
|
||||||
const authUnitKerja = @json(auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]?->unitKerja);
|
const authUnitKerja = @json(auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]?->unitKerja);
|
||||||
const authSubUnitKerja = @json(auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]);
|
const authSubUnitKerja = @json(auth()->user()->dataUser?->mappingUnitKerjaPegawai[0]);
|
||||||
|
window.__prefillFromSession = @json($prefillFilter ?? null);
|
||||||
function isPublic(permissionVal){
|
function isPublic(permissionVal){
|
||||||
if(permissionVal === null || permissionVal === undefined) return false;
|
if(permissionVal === null || permissionVal === undefined) return false;
|
||||||
const val = String(permissionVal).toLowerCase();
|
const val = String(permissionVal).toLowerCase();
|
||||||
@ -266,10 +282,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="{{ ver('/js/dashboard/_init.js') }}"></script>
|
<script src="{{ ver('/js/dashboard/_init.js') }}"></script>
|
||||||
|
|||||||
@ -1,4 +1,41 @@
|
|||||||
@extends('layout.main')
|
@extends('layout.main')
|
||||||
|
<style>
|
||||||
|
.table-fixed{ table-layout: fixed; width: 100%; }
|
||||||
|
.table-fixed th:nth-child(1), .table-fixed td:nth-child(1){ width: 140px; }
|
||||||
|
.table-fixed th:nth-child(2), .table-fixed td:nth-child(2){ width: 260px; }
|
||||||
|
.table-fixed th:nth-child(3), .table-fixed td:nth-child(3){ width: 220px; }
|
||||||
|
.table-fixed th:nth-child(4), .table-fixed td:nth-child(4){ width: 120px; }
|
||||||
|
.table-fixed th:nth-child(5), .table-fixed td:nth-child(5){ width: 150px; }
|
||||||
|
|
||||||
|
.file-cell{
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-word;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-cell{
|
||||||
|
max-width: 220px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-badge{
|
||||||
|
white-space: normal !important;
|
||||||
|
word-break: break-word;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 1.3;
|
||||||
|
padding: .35rem .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-link-sm{
|
||||||
|
font-size: 13px;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@section('body_main')
|
@section('body_main')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -30,8 +67,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="small text-muted ms-md-auto" id="tableSummary">Memuat data...</div>
|
<div class="small text-muted ms-md-auto" id="tableSummary">Memuat data...</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive" style="max-height: 100vh; overflow-y:auto;">
|
<div class="table-responsive" style="max-height: 70vh; overflow-y:auto;">
|
||||||
<table class="table table-sm table-hover align-middle mb-0" id="lastUpdatedTable">
|
<table class="table table-sm table-hover align-middle mb-0 table-fixed" id="lastUpdatedTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Nomor Surat</th>
|
<th>Nomor Surat</th>
|
||||||
@ -100,12 +137,29 @@
|
|||||||
const fileName = parts.pop() || '-';
|
const fileName = parts.pop() || '-';
|
||||||
const folderPath = parts.join('/') || '-';
|
const folderPath = parts.join('/') || '-';
|
||||||
const publicDoc = isPublic(item.permission_file);
|
const publicDoc = isPublic(item.permission_file);
|
||||||
|
const unitName = parts[0] || '';
|
||||||
|
const subName = parts[1] || '';
|
||||||
|
const kategoriName = parts[2] || '';
|
||||||
|
let statusLabel = '';
|
||||||
|
let statusClass = '';
|
||||||
|
|
||||||
|
if (!item.status_action) {
|
||||||
|
statusLabel = 'Pending';
|
||||||
|
statusClass = 'bg-warning text-dark';
|
||||||
|
} else if (publicDoc) {
|
||||||
|
statusLabel = 'Umum';
|
||||||
|
statusClass = 'bg-success';
|
||||||
|
} else {
|
||||||
|
statusLabel = 'Internal Unit';
|
||||||
|
statusClass = 'bg-secondary';
|
||||||
|
}
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-nowrap">${item.no_dokumen || '-'}</td>
|
<td class="text-nowrap">${item.no_dokumen || '-'}</td>
|
||||||
<td>
|
<td class="file-cell">
|
||||||
<span class="me-1">📄</span>
|
<span class="me-1">📄</span>
|
||||||
<a href="#" class="file-link"
|
<a href="#" class="file-link ${statusLabel === "Pending" ? 'fst-italic' : ''}"
|
||||||
data-file="${item.file}"
|
data-file="${item.file}"
|
||||||
data-fileName="${fileName}"
|
data-fileName="${fileName}"
|
||||||
data-id="${item.file_directory_id}"
|
data-id="${item.file_directory_id}"
|
||||||
@ -113,10 +167,22 @@
|
|||||||
data-tanggal_terbit="${item.tanggal_terbit || '-'}"
|
data-tanggal_terbit="${item.tanggal_terbit || '-'}"
|
||||||
data-permission_file="${item.permission_file || '-'}">${fileName}</a>
|
data-permission_file="${item.permission_file || '-'}">${fileName}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-break"><span class="badge bg-light text-dark fw-semibold">${folderPath}</span></td>
|
<td class="folder-cell">
|
||||||
|
<a href="#"
|
||||||
|
class="text-dark fw-semibold folder-prefill folder-link-sm ${statusLabel === "Pending" ? 'fst-italic' : ''}"
|
||||||
|
title="${folderPath}"
|
||||||
|
data-unit_id="${item.id_unit_kerja || ''}"
|
||||||
|
data-sub_id="${item.id_sub_unit_kerja || ''}"
|
||||||
|
data-kategori_id="${item.master_kategori_directory_id || ''}"
|
||||||
|
data-unit_name="${unitName}"
|
||||||
|
data-sub_name="${subName}"
|
||||||
|
data-kategori_name="${kategoriName}">
|
||||||
|
${folderPath}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge ${publicDoc ? 'bg-success' : 'bg-secondary'}">
|
<span class="badge ${statusClass}">
|
||||||
${publicDoc ? 'Umum' : 'Internal Unit'}
|
${statusLabel}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-nowrap">${formatTanggal(item.entry_at)}</td>
|
<td class="text-nowrap">${formatTanggal(item.entry_at)}</td>
|
||||||
@ -234,6 +300,38 @@
|
|||||||
}
|
}
|
||||||
fetchData()
|
fetchData()
|
||||||
|
|
||||||
|
document.addEventListener('click', function (e) {
|
||||||
|
const btn = e.target.closest('.folder-prefill');
|
||||||
|
if (!btn) return;
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
unitId: btn.getAttribute('data-unit_id') || '',
|
||||||
|
subId: btn.getAttribute('data-sub_id') || '',
|
||||||
|
kategoriId: btn.getAttribute('data-kategori_id') || '',
|
||||||
|
unitName: btn.getAttribute('data-unit_name') || '',
|
||||||
|
subName: btn.getAttribute('data-sub_name') || '',
|
||||||
|
kategoriName: btn.getAttribute('data-kategori_name') || '',
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch('/dashboard/prefill', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(payload)
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
if (!res.ok) throw new Error('Gagal set filter');
|
||||||
|
window.location.href = '/';
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Swal.fire({ icon: 'error', title: 'Gagal', text: 'Tidak bisa buka folder' });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
let colCount = 1;
|
let colCount = 1;
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.unit_kerja').select2({
|
$('.unit_kerja').select2({
|
||||||
|
|||||||
@ -44,8 +44,11 @@
|
|||||||
<table class="table table-sm table-hover align-middle mb-0" id="lastUpdatedTable">
|
<table class="table table-sm table-hover align-middle mb-0" id="lastUpdatedTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@if(auth()->user()->masterPersetujuan)
|
||||||
<th>Aksi</th>
|
<th>Aksi</th>
|
||||||
|
@endif
|
||||||
<th>No Dokumen</th>
|
<th>No Dokumen</th>
|
||||||
|
<th>Status</th>
|
||||||
<th>File</th>
|
<th>File</th>
|
||||||
<th>Folder</th>
|
<th>Folder</th>
|
||||||
<th>Unit/Sub Unit</th>
|
<th>Unit/Sub Unit</th>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ Route::middleware(['auth'])->group(function(){
|
|||||||
Route::get('/file-preview/{id}', [DashboardController::class, 'dataPdf']);
|
Route::get('/file-preview/{id}', [DashboardController::class, 'dataPdf']);
|
||||||
Route::post('/upload', [DashboardController::class, 'store']);
|
Route::post('/upload', [DashboardController::class, 'store']);
|
||||||
Route::get('/data-unit-kerja', [DashboardController::class, 'dataUnitKerja']);
|
Route::get('/data-unit-kerja', [DashboardController::class, 'dataUnitKerja']);
|
||||||
|
Route::post('/dashboard/prefill', [DashboardController::class, 'setDashboardPrefill']);
|
||||||
|
|
||||||
Route::get('/select-pegawai', [AksesFileController::class, 'optionPegawai']);
|
Route::get('/select-pegawai', [AksesFileController::class, 'optionPegawai']);
|
||||||
Route::get('/select-unit-kerja-option', [AksesFileController::class, 'optionUnitKerja']);
|
Route::get('/select-unit-kerja-option', [AksesFileController::class, 'optionUnitKerja']);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user