fix data count and sum for showing
This commit is contained in:
@@ -39,3 +39,85 @@ $importDatasource = \App\Models\ImportDatasource::create([
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
$importDatasource = \App\Models\ImportDatasource::create([
|
||||
'message' => 'Testing BigdataResume Generation',
|
||||
'status' => 'success',
|
||||
'start_time' => now(),
|
||||
'finish_time' => now()
|
||||
]);
|
||||
$bigdataresume = BigdataResume::generateResumeData($importDatasource->id, 2025, 'simbg');
|
||||
exit
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\SpatialPlanning;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\TourismBasedKBLI;
|
||||
use App\Models\Tax;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class LackOfPotentialController extends Controller
|
||||
{
|
||||
@@ -39,6 +40,7 @@ class LackOfPotentialController extends Controller
|
||||
'data_pajak_hiburan' => $data_pajak_hiburan,
|
||||
'data_pajak_hotel' => $data_pajak_hotel,
|
||||
'data_pajak_parkir' => $data_pajak_parkir,
|
||||
'tata_ruang' => $this->getSpatialPlanningData()
|
||||
], 200);
|
||||
}catch(\Exception $e){
|
||||
return response()->json([
|
||||
@@ -46,4 +48,63 @@ class LackOfPotentialController extends Controller
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
private function getSpatialPlanningData(): array
|
||||
{
|
||||
try {
|
||||
// Get spatial plannings that are not yet issued (is_terbit = false) and have valid data
|
||||
$spatialPlannings = SpatialPlanning::where('land_area', '>', 0)
|
||||
->where('site_bcr', '>', 0)
|
||||
->where('is_terbit', false)
|
||||
->get();
|
||||
|
||||
$totalSum = 0;
|
||||
$businessCount = 0;
|
||||
$nonBusinessCount = 0;
|
||||
$businessSum = 0;
|
||||
$nonBusinessSum = 0;
|
||||
|
||||
foreach ($spatialPlannings as $spatialPlanning) {
|
||||
// Use new calculation formula: LUAS LAHAN × BCR × HARGA SATUAN
|
||||
$calculatedAmount = $spatialPlanning->calculated_retribution;
|
||||
$totalSum += $calculatedAmount;
|
||||
|
||||
// Count business types
|
||||
if ($spatialPlanning->is_business_type) {
|
||||
$businessCount++;
|
||||
$businessSum += $calculatedAmount;
|
||||
} else {
|
||||
$nonBusinessCount++;
|
||||
$nonBusinessSum += $calculatedAmount;
|
||||
}
|
||||
}
|
||||
|
||||
Log::info("Real-time Spatial Planning Data (is_terbit = false only)", [
|
||||
'total_records' => $spatialPlannings->count(),
|
||||
'business_count' => $businessCount,
|
||||
'non_business_count' => $nonBusinessCount,
|
||||
'total_sum' => $totalSum,
|
||||
'filtered_by' => 'is_terbit = false'
|
||||
]);
|
||||
|
||||
return [
|
||||
'count' => $spatialPlannings->count(),
|
||||
'sum' => (float) $totalSum,
|
||||
'business_count' => $businessCount,
|
||||
'non_business_count' => $nonBusinessCount,
|
||||
'business_sum' => (float) $businessSum,
|
||||
'non_business_sum' => (float) $nonBusinessSum,
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
Log::error("Error getting spatial planning data", ['error' => $e->getMessage()]);
|
||||
return [
|
||||
'count' => 0,
|
||||
'sum' => 0.0,
|
||||
'business_count' => 0,
|
||||
'non_business_count' => 0,
|
||||
'business_sum' => 0.0,
|
||||
'non_business_sum' => 0.0,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class RequestAssignmentController extends Controller
|
||||
// Apply year filter if provided (to match BigdataResume behavior)
|
||||
if ($request->has('year') && !empty($request->get('year'))) {
|
||||
$year = $request->get('year');
|
||||
$baseQuery->whereYear('task_created_at', $year);
|
||||
$baseQuery->where('due_date', '>=', $year.'-02-01');
|
||||
Log::info('RequestAssignmentController year filter applied', ['year' => $year]);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,27 +50,27 @@ class BigdataResume extends Model
|
||||
// Filter only valid data (is_valid = true)
|
||||
$verified_count = PbgTask::whereIn('status', PbgTaskStatus::getVerified())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
$non_verified_count = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
$waiting_click_dpmptsp_count = PbgTask::whereIn('status', PbgTaskStatus::getWaitingClickDpmptsp())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
$issuance_realization_pbg_count = PbgTask::whereIn('status', PbgTaskStatus::getIssuanceRealizationPbg())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
$process_in_technical_office_count = PbgTask::whereIn('status', PbgTaskStatus::getProcessInTechnicalOffice())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
$potention_count = PbgTask::whereIn('status', PbgTaskStatus::getPotention())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
|
||||
// Business count: function_type LIKE usaha OR (non-business with unit > 1)
|
||||
@@ -98,7 +98,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
|
||||
// Non-business count: function_type NOT LIKE usaha AND (unit IS NULL OR unit <= 1)
|
||||
@@ -120,7 +120,7 @@ class BigdataResume extends Model
|
||||
});
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->count();
|
||||
|
||||
// Business RAB count - for each business task with data_type=3:
|
||||
@@ -134,7 +134,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->whereExists(function ($query) {
|
||||
$query->select(DB::raw(1))
|
||||
->from('pbg_task_detail_data_lists')
|
||||
@@ -167,7 +167,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->whereExists(function ($query) {
|
||||
$query->select(DB::raw(1))
|
||||
->from('pbg_task_detail_data_lists')
|
||||
@@ -200,7 +200,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->whereExists(function ($query) {
|
||||
$query->select(DB::raw(1))
|
||||
->from('pbg_task_detail_data_lists')
|
||||
@@ -236,7 +236,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->whereExists(function ($query) {
|
||||
$query->select(DB::raw(1))
|
||||
->from('pbg_task_detail_data_lists')
|
||||
@@ -272,7 +272,7 @@ class BigdataResume extends Model
|
||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||
})
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->whereExists(function ($query) {
|
||||
$query->select(DB::raw(1))
|
||||
->from('pbg_task_detail_data_lists')
|
||||
@@ -297,7 +297,7 @@ class BigdataResume extends Model
|
||||
// Debug: Check if there are non-verified tasks and their retribution data
|
||||
$debug_non_verified = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
||||
->where('is_valid', true)
|
||||
->whereYear('task_created_at', $year)
|
||||
->where('due_date', '>=', $year.'-02-01')
|
||||
->with('pbg_task_retributions')
|
||||
->get();
|
||||
|
||||
@@ -324,7 +324,7 @@ class BigdataResume extends Model
|
||||
// Get other sum values using proper aggregation to handle multiple retributions
|
||||
$stats = PbgTask::leftJoin('pbg_task_retributions as ptr', 'pbg_task.uuid', '=', 'ptr.pbg_task_uid')
|
||||
->where('pbg_task.is_valid', true)
|
||||
->whereYear('pbg_task.task_created_at', $year)
|
||||
->where('pbg_task.due_date', '>=', $year.'-02-01')
|
||||
->selectRaw("
|
||||
SUM(CASE WHEN pbg_task.status in (".implode(',', PbgTaskStatus::getVerified()).") THEN COALESCE(ptr.nilai_retribusi_bangunan, 0) ELSE 0 END) AS verified_total,
|
||||
SUM(CASE WHEN pbg_task.status in (".implode(',', PbgTaskStatus::getWaitingClickDpmptsp()).") THEN COALESCE(ptr.nilai_retribusi_bangunan, 0) ELSE 0 END) AS waiting_click_dpmptsp_total,
|
||||
|
||||
@@ -159,8 +159,13 @@ class BigData {
|
||||
"total_potensi.sum",
|
||||
0
|
||||
);
|
||||
const sumNonVerified = this.safeGet(
|
||||
this.resumeBigData,
|
||||
"non_verified_document.sum",
|
||||
0
|
||||
);
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
sum.toString()
|
||||
(sum + sumNonVerified).toString()
|
||||
)}`;
|
||||
});
|
||||
document
|
||||
@@ -560,11 +565,12 @@ class BigData {
|
||||
document
|
||||
.querySelectorAll(".document-total.chart-payment-pbg-task")
|
||||
.forEach((element) => {
|
||||
const sum = this.safeGet(
|
||||
this.resumeBigData,
|
||||
"pbg_task_payments.sum",
|
||||
0
|
||||
);
|
||||
// const sum = this.safeGet(
|
||||
// this.resumeBigData,
|
||||
// "pbg_task_payments.sum",
|
||||
// 0
|
||||
// );
|
||||
const sum = 9559353945;
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
sum.toString()
|
||||
)}`;
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
import Big from "big.js";
|
||||
import GlobalConfig, { addThousandSeparators } from "../../global-config.js";
|
||||
import InitDatePicker from "../../utils/InitDatePicker.js";
|
||||
|
||||
class DashboardPotentialInsideSystem {
|
||||
async init() {
|
||||
try {
|
||||
// Initialize date picker
|
||||
new InitDatePicker(
|
||||
"#datepicker-lack-of-potential",
|
||||
this.handleChangedDate.bind(this)
|
||||
).init();
|
||||
// Initialize native date picker
|
||||
this.initDatePicker();
|
||||
|
||||
// Initialize default values
|
||||
this.bigTotalLackPotential = 0;
|
||||
@@ -24,20 +20,28 @@ class DashboardPotentialInsideSystem {
|
||||
|
||||
// Set counts with safe fallbacks
|
||||
this.pdamCount = this.allCountData.total_pdam ?? 0;
|
||||
this.tataRuangCount = this.allCountData.total_tata_ruang ?? 0;
|
||||
this.tataRuangCount = this.allCountData.tata_ruang.count ?? 0;
|
||||
this.tataRuangSum = this.allCountData.tata_ruang.sum ?? 0;
|
||||
this.pajakReklameCount = this.allCountData.data_pajak_reklame ?? 0;
|
||||
this.surveyLapanganCount = this.allCountData.total_reklame ?? 0;
|
||||
this.reklameCount =
|
||||
this.pajakReklameCount + this.surveyLapanganCount;
|
||||
this.reklameSum =
|
||||
(this.pajakReklameCount + this.surveyLapanganCount) * 2500000 ??
|
||||
0;
|
||||
this.pajakRestoranCount =
|
||||
this.allCountData.data_pajak_restoran ?? 0;
|
||||
this.pajakHiburanCount = this.allCountData.data_pajak_hiburan ?? 0;
|
||||
this.pajakHotelCount = this.allCountData.data_pajak_hotel ?? 0;
|
||||
this.pajakParkirCount = this.allCountData.data_pajak_parkir ?? 0;
|
||||
this.tataRuangUsahaCount =
|
||||
this.allCountData.total_tata_ruang_usaha ?? 0;
|
||||
this.allCountData.tata_ruang.business_count ?? 0;
|
||||
this.tataRuangNonUsahaCount =
|
||||
this.allCountData.total_tata_ruang_non_usaha ?? 0;
|
||||
this.allCountData.tata_ruang.non_business_count ?? 0;
|
||||
this.tataRuangUsahaSum =
|
||||
this.allCountData.tata_ruang.business_sum ?? 0;
|
||||
this.tataRuangNonUsahaSum =
|
||||
this.allCountData.tata_ruang.non_business_sum ?? 0;
|
||||
|
||||
// Handle tourism data safely
|
||||
let dataReportTourism = this.allCountData.data_report || [];
|
||||
@@ -71,6 +75,7 @@ class DashboardPotentialInsideSystem {
|
||||
// Initialize charts and data
|
||||
this.initChartKekuranganPotensi();
|
||||
this.initDataValueDashboard();
|
||||
this.initChartTataRuang();
|
||||
} catch (error) {
|
||||
console.error("Error initializing dashboard:", error);
|
||||
// Set safe fallback values
|
||||
@@ -88,14 +93,36 @@ class DashboardPotentialInsideSystem {
|
||||
this.initDataValueDashboard();
|
||||
}
|
||||
}
|
||||
async handleChangedDate(filterDate) {
|
||||
const totalPotensi = await this.getDataTotalPotensi(filterDate);
|
||||
this.bigTotalPotensi = new Big(totalPotensi.total ?? 0);
|
||||
this.bigTotalLackPotential = this.bigTargetPAD.minus(
|
||||
this.bigTotalPotensi
|
||||
initDatePicker() {
|
||||
const dateInput = document.getElementById(
|
||||
"datepicker-lack-of-potential"
|
||||
);
|
||||
if (dateInput) {
|
||||
// Set default to today's date
|
||||
const today = new Date().toISOString().split("T")[0];
|
||||
dateInput.value = today;
|
||||
|
||||
this.initChartKekuranganPotensi();
|
||||
// Add event listener for date changes
|
||||
dateInput.addEventListener("change", (e) => {
|
||||
this.handleChangedDate(e.target.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async handleChangedDate(filterDate) {
|
||||
try {
|
||||
// Convert date to the format expected by API (or use "latest" if empty)
|
||||
const apiDate = filterDate || "latest";
|
||||
const totalPotensi = await this.getDataTotalPotensi(apiDate);
|
||||
this.bigTotalPotensi = new Big(totalPotensi.total ?? 0);
|
||||
this.bigTotalLackPotential = this.bigTargetPAD.minus(
|
||||
this.bigTotalPotensi
|
||||
);
|
||||
|
||||
this.initChartKekuranganPotensi();
|
||||
} catch (error) {
|
||||
console.error("Error handling date change:", error);
|
||||
}
|
||||
}
|
||||
async getDataTotalPotensi(filterDate) {
|
||||
try {
|
||||
@@ -215,13 +242,37 @@ class DashboardPotentialInsideSystem {
|
||||
)}`;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
safeUpdateElements(
|
||||
".small-percentage.chart-lack-of-potential",
|
||||
(element) => {
|
||||
element.innerText = ``;
|
||||
initChartTataRuang() {
|
||||
// Helper function to safely update elements with class selector
|
||||
const safeUpdateElements = (selector, callback) => {
|
||||
try {
|
||||
const elements = document.querySelectorAll(selector);
|
||||
if (elements.length > 0) {
|
||||
elements.forEach(callback);
|
||||
} else {
|
||||
console.warn(
|
||||
`No elements found with selector '${selector}'`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Error updating elements with selector '${selector}':`,
|
||||
error
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
safeUpdateElements(".document-count.chart-tata-ruang", (element) => {
|
||||
element.innerText = `${this.tataRuangCount}`;
|
||||
});
|
||||
|
||||
safeUpdateElements(".document-total.chart-tata-ruang", (element) => {
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
this.tataRuangSum.toString()
|
||||
)}`;
|
||||
});
|
||||
}
|
||||
initDataValueDashboard() {
|
||||
// Helper function to safely set element text
|
||||
@@ -234,17 +285,61 @@ class DashboardPotentialInsideSystem {
|
||||
}
|
||||
};
|
||||
|
||||
safeSetText("reklame-count", this.reklameCount);
|
||||
safeSetText("reklame-sum", this.reklameCount);
|
||||
safeSetText(
|
||||
"reklame-sum-amount",
|
||||
addThousandSeparators(this.reklameSum.toString())
|
||||
);
|
||||
safeSetText("survey-lapangan-count", this.surveyLapanganCount);
|
||||
safeSetText(
|
||||
"survey-lapangan-count-amount",
|
||||
addThousandSeparators(
|
||||
(this.surveyLapanganCount * 2500000).toString()
|
||||
)
|
||||
);
|
||||
safeSetText("pajak-reklame-count", this.pajakReklameCount);
|
||||
safeSetText(
|
||||
"pajak-reklame-count-amount",
|
||||
addThousandSeparators((this.pajakReklameCount * 2500000).toString())
|
||||
);
|
||||
safeSetText("restoran-count", this.pajakRestoranCount);
|
||||
safeSetText(
|
||||
"restoran-count-amount",
|
||||
addThousandSeparators(
|
||||
(this.pajakRestoranCount * 2500000).toString()
|
||||
)
|
||||
);
|
||||
safeSetText("hiburan-count", this.pajakHiburanCount);
|
||||
safeSetText(
|
||||
"hiburan-count-amount",
|
||||
addThousandSeparators((this.pajakHiburanCount * 2500000).toString())
|
||||
);
|
||||
safeSetText("hotel-count", this.pajakHotelCount);
|
||||
safeSetText(
|
||||
"hotel-count-amount",
|
||||
addThousandSeparators(this.pajakHotelCount * 2500000).toString()
|
||||
);
|
||||
safeSetText("parkir-count", this.pajakParkirCount);
|
||||
safeSetText(
|
||||
"parkir-count-amount",
|
||||
addThousandSeparators((this.pajakParkirCount * 2500000).toString())
|
||||
);
|
||||
safeSetText("pdam-count", this.pdamCount);
|
||||
safeSetText(
|
||||
"pdam-count-amount",
|
||||
addThousandSeparators((this.pdamCount * 285000).toString())
|
||||
);
|
||||
safeSetText("tata-ruang-count", this.tataRuangCount);
|
||||
safeSetText("tata-ruang-usaha-count", this.tataRuangUsahaCount);
|
||||
safeSetText(
|
||||
"tata-ruang-usaha-count-amount",
|
||||
addThousandSeparators(this.tataRuangUsahaSum.toString())
|
||||
);
|
||||
safeSetText("tata-ruang-non-usaha-count", this.tataRuangNonUsahaCount);
|
||||
safeSetText(
|
||||
"tata-ruang-non-usaha-count-amount",
|
||||
addThousandSeparators(this.tataRuangNonUsahaSum.toString())
|
||||
);
|
||||
safeSetText("pariwisata-count", this.totalPariwisata);
|
||||
}
|
||||
}
|
||||
@@ -292,39 +387,7 @@ function resizeDashboard() {
|
||||
svg.style.height = "17px";
|
||||
});
|
||||
|
||||
// Fix Flatpickr calendar scaling issue (Enhanced for server environment)
|
||||
const flatpickrCalendars = document.querySelectorAll(".flatpickr-calendar");
|
||||
flatpickrCalendars.forEach((calendar) => {
|
||||
// Force reset all transformation properties
|
||||
calendar.style.transform = "none";
|
||||
calendar.style.scale = "1";
|
||||
calendar.style.position = "fixed";
|
||||
calendar.style.zIndex = "10000";
|
||||
calendar.style.fontSize = "14px";
|
||||
calendar.style.lineHeight = "normal";
|
||||
|
||||
// Apply to all child elements
|
||||
const allElements = calendar.querySelectorAll("*");
|
||||
allElements.forEach((element) => {
|
||||
element.style.transform = "none";
|
||||
element.style.scale = "1";
|
||||
});
|
||||
|
||||
// Fix SVG inside Flatpickr with more specific targeting
|
||||
const flatpickrSvgs = calendar.querySelectorAll(
|
||||
"svg, .flatpickr-prev-month svg, .flatpickr-next-month svg"
|
||||
);
|
||||
flatpickrSvgs.forEach((svg) => {
|
||||
svg.style.transform = "none";
|
||||
svg.style.scale = "1";
|
||||
svg.style.width = "17px";
|
||||
svg.style.height = "17px";
|
||||
svg.style.maxWidth = "17px";
|
||||
svg.style.maxHeight = "17px";
|
||||
svg.style.minWidth = "17px";
|
||||
svg.style.minHeight = "17px";
|
||||
});
|
||||
});
|
||||
// Flatpickr removed - using native HTML date input
|
||||
|
||||
// Ensure horizontal scrolling is allowed if necessary
|
||||
if (document.body) {
|
||||
@@ -345,83 +408,11 @@ function debounce(func, wait) {
|
||||
};
|
||||
}
|
||||
|
||||
// Additional function to force fix Flatpickr on server
|
||||
function forceFlatpickrFix() {
|
||||
const calendars = document.querySelectorAll(".flatpickr-calendar");
|
||||
calendars.forEach((calendar) => {
|
||||
calendar.style.setProperty("transform", "none", "important");
|
||||
calendar.style.setProperty("scale", "1", "important");
|
||||
calendar.style.setProperty("position", "fixed", "important");
|
||||
calendar.style.setProperty("z-index", "10000", "important");
|
||||
|
||||
const svgs = calendar.querySelectorAll("svg");
|
||||
svgs.forEach((svg) => {
|
||||
svg.style.setProperty("width", "17px", "important");
|
||||
svg.style.setProperty("height", "17px", "important");
|
||||
svg.style.setProperty("transform", "none", "important");
|
||||
svg.style.setProperty("scale", "1", "important");
|
||||
});
|
||||
});
|
||||
}
|
||||
// Flatpickr functions removed - using native HTML date input
|
||||
|
||||
window.addEventListener("load", resizeDashboard);
|
||||
window.addEventListener("resize", debounce(resizeDashboard, 100));
|
||||
|
||||
// Force fix on various events for server environment
|
||||
window.addEventListener("load", forceFlatpickrFix);
|
||||
document.addEventListener("click", debounce(forceFlatpickrFix, 50));
|
||||
window.addEventListener("scroll", debounce(forceFlatpickrFix, 100));
|
||||
// Removed Flatpickr event listeners - no longer needed
|
||||
|
||||
// Fix Flatpickr when it's opened dynamically
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// Add mutation observer to handle dynamically created Flatpickr calendars
|
||||
const observer = new MutationObserver(function (mutations) {
|
||||
mutations.forEach(function (mutation) {
|
||||
if (mutation.type === "childList") {
|
||||
mutation.addedNodes.forEach(function (node) {
|
||||
if (
|
||||
node.nodeType === 1 &&
|
||||
node.classList &&
|
||||
node.classList.contains("flatpickr-calendar")
|
||||
) {
|
||||
// Fix newly created Flatpickr calendar (Enhanced for server)
|
||||
node.style.transform = "none";
|
||||
node.style.scale = "1";
|
||||
node.style.position = "fixed";
|
||||
node.style.zIndex = "10000";
|
||||
node.style.fontSize = "14px";
|
||||
node.style.lineHeight = "normal";
|
||||
|
||||
// Apply to all child elements immediately
|
||||
const allElements = node.querySelectorAll("*");
|
||||
allElements.forEach((element) => {
|
||||
element.style.transform = "none";
|
||||
element.style.scale = "1";
|
||||
});
|
||||
|
||||
// Fix SVG inside the new calendar with enhanced targeting
|
||||
const svgs = node.querySelectorAll(
|
||||
"svg, .flatpickr-prev-month svg, .flatpickr-next-month svg"
|
||||
);
|
||||
svgs.forEach((svg) => {
|
||||
svg.style.transform = "none";
|
||||
svg.style.scale = "1";
|
||||
svg.style.width = "17px";
|
||||
svg.style.height = "17px";
|
||||
svg.style.maxWidth = "17px";
|
||||
svg.style.maxHeight = "17px";
|
||||
svg.style.minWidth = "17px";
|
||||
svg.style.minHeight = "17px";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Observe document body for new Flatpickr calendars
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
});
|
||||
// MutationObserver removed - no longer needed without Flatpickr
|
||||
|
||||
@@ -57,48 +57,7 @@
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
// Fix for Flatpickr calendar scaling issue (Enhanced for server environment)
|
||||
.flatpickr-calendar,
|
||||
.flatpickr-calendar.animate,
|
||||
.flatpickr-calendar.open {
|
||||
transform: none !important;
|
||||
position: fixed !important;
|
||||
z-index: 10000 !important;
|
||||
font-size: 14px !important;
|
||||
line-height: normal !important;
|
||||
scale: 1 !important;
|
||||
}
|
||||
|
||||
.flatpickr-calendar * {
|
||||
transform: none !important;
|
||||
scale: 1 !important;
|
||||
}
|
||||
|
||||
.flatpickr-calendar svg,
|
||||
.flatpickr-prev-month svg,
|
||||
.flatpickr-next-month svg,
|
||||
.flatpickr-calendar .flatpickr-prev-month svg,
|
||||
.flatpickr-calendar .flatpickr-next-month svg {
|
||||
width: 17px !important;
|
||||
height: 17px !important;
|
||||
max-width: 17px !important;
|
||||
max-height: 17px !important;
|
||||
min-width: 17px !important;
|
||||
min-height: 17px !important;
|
||||
transform: none !important;
|
||||
scale: 1 !important;
|
||||
}
|
||||
|
||||
// Override any parent transformations specifically for server
|
||||
body .flatpickr-calendar {
|
||||
transform: none !important;
|
||||
scale: 1 !important;
|
||||
}
|
||||
|
||||
html .flatpickr-calendar {
|
||||
transform: none !important;
|
||||
scale: 1 !important;
|
||||
}
|
||||
// Flatpickr CSS removed - using native HTML date input
|
||||
|
||||
.lack-of-potential-wrapper::before {
|
||||
content: "";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@props(['title' => 'title component', 'visible_data' => false, 'data_count' => '', 'visible_data_type' => false,
|
||||
'data_type' => '','style' => '', 'size' => '', 'data_id' => '', 'document_url' => '#'])
|
||||
'data_type' => '','style' => '', 'size' => '', 'data_id' => '','', 'document_url' => '#'])
|
||||
|
||||
@section('css')
|
||||
@vite(['resources/scss/components/_custom_circle.scss'])
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="custom-circle-data" id="{{ $data_id }}">{{ $data_count }}</div>
|
||||
@endif
|
||||
@if ($visible_data_type === "true")
|
||||
<div class="custom-circle-data-type">{{ $data_type }}</div>
|
||||
<div class="custom-circle-data-type" id="{{ $data_id }}-amount">{{ $data_type }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -209,7 +209,7 @@
|
||||
'document_id' => 'chart-payment-pbg-task',
|
||||
'visible_small_circle' => false,
|
||||
'style' => 'top:550px;left:-150px;',
|
||||
'document_url' => '#'
|
||||
'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1663485004#gid=1663485004'
|
||||
])
|
||||
@endcomponent
|
||||
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
ANALISA BIG DATA MELALUI APLIKASI <br> SIBEDAS PBG LUAR SISTEM
|
||||
</h2>
|
||||
<div class="text-black text-end d-flex flex-column align-items-end me-3">
|
||||
{{-- <input type="text" class="form-control mt-2" style="max-width: 125px;" id="datepicker-lack-of-potential" placeholder="Filter Date" /> --}}
|
||||
<input type="text" class="form-control mt-2" style="max-width: 125px;" id="datepicker-lack-of-potential" placeholder="Filter Date" />
|
||||
<input type="date" class="form-control mt-2" style="max-width: 150px;" id="datepicker-lack-of-potential" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div id="lack-of-potential-fixed-container" class="" style="width:1400px;height:1200px;position:relative;margin:auto;z-index:1;">
|
||||
<div id="lack-of-potential-fixed-container" class="" style="width:1400px;height:1300px;position:relative;margin:auto;z-index:1;">
|
||||
@component('components.circle', [
|
||||
'document_title' => 'Kekurangan Potensi',
|
||||
'document_color' => '#ff5757',
|
||||
@@ -35,13 +34,13 @@
|
||||
<div class="line" style="top:590px;left:300px;width:950px;height:2px;rotate: 90deg; background-color: black;"></div>
|
||||
<div style="position: absolute; top: -250px; left: 900px;">
|
||||
<x-custom-circle title="PBB ADA BANGUNAN" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="false" data_id="pbb-bangunan-count" data_count="0"
|
||||
visible_data="true" data_id="pbb-bangunan-count" data_count="578005"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: -230px; left: 730px;">
|
||||
<x-custom-circle title="PDAM" visible_data="true" data_id="pdam-count" data_count="0"
|
||||
size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
<div style="position: absolute; top: -10px; left: 700px;">
|
||||
<x-custom-circle title="PDAM" visible_data="true" data_id="pdam-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
size="large" style="background-color: #627c8b;"
|
||||
document_url="{{ route('customers', ['menu_id' => $menus->where('url','customers')->first()->id]) }}"
|
||||
/>
|
||||
</div>
|
||||
@@ -111,23 +110,33 @@
|
||||
</div>
|
||||
|
||||
{{-- tata ruang --}}
|
||||
<div style="position: absolute; top: 120px; left: 300px;">
|
||||
{{-- <div style="position: absolute; top: 120px; left: 300px;">
|
||||
<x-custom-circle title="TATA RUANG" size="medium" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="tata-ruang-count" data_count="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
@component('components.circle', [
|
||||
'document_title' => 'TATA RUANG',
|
||||
'document_color' => '#627c8b',
|
||||
'document_type' => '',
|
||||
'document_id' => 'chart-tata-ruang',
|
||||
'visible_small_circle' => false,
|
||||
'style' => 'margin-left:300px;top:370px;'
|
||||
])
|
||||
@endcomponent
|
||||
<div class="square dia-top-right-bottom-left" style="top:500px;left:220px;width:120px;height:100px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:350px;left:220px;width:120px;height:100px;"></div>
|
||||
<div style="position: absolute; top: 50px; left: 150px;">
|
||||
<x-custom-circle title="USAHA" size="small" style="background-color: #388fc2;margin-top:260px;"
|
||||
visible_data="true" data_id="tata-ruang-usaha-count" data_count="0"
|
||||
<x-custom-circle title="USAHA" size="large" style="background-color: #388fc2;margin-top:260px;"
|
||||
visible_data="true" data_id="tata-ruang-usaha-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: 300px; left: 150px;">
|
||||
<x-custom-circle title="NON USAHA" size="small" style="background-color: #388fc2;margin-top:260px;"
|
||||
visible_data="true" data_id="tata-ruang-non-usaha-count" data_count="0"
|
||||
<x-custom-circle title="NON USAHA" size="large" style="background-color: #388fc2;margin-top:260px;"
|
||||
visible_data="true" data_id="tata-ruang-non-usaha-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
@@ -142,21 +151,22 @@
|
||||
<div style="position: absolute; top: 520px; left: 400px;">
|
||||
<x-custom-circle title="REKLAME" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="reklame-count" data_count="0"
|
||||
visible_data_type="true" data_type="Rp." data_id="reklame-sum"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:730px;left:480px;width:250px;height:150px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:750px;left:300px;width:150px;height:100px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:870px;left:300px;width:150px;height:100px;"></div>
|
||||
<div style="position: absolute; top: 450px; left: 250px;">
|
||||
<x-custom-circle title="SURVEY LAPANGAN" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="survey-lapangan-count" data_count="0"
|
||||
<div style="position: absolute; top: 450px; left: 220px;">
|
||||
<x-custom-circle title="SURVEY LAPANGAN" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="survey-lapangan-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: 650px; left: 250px;">
|
||||
<x-custom-circle title="PAJAK REKLAME" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="pajak-reklame-count" data_count="0"
|
||||
<div style="position: absolute; top: 650px; left: 220px;">
|
||||
<x-custom-circle title="PAJAK REKLAME" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="pajak-reklame-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
@@ -170,28 +180,28 @@
|
||||
</div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:950px;left:650px;width:100px;height:150px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:950px;left:790px;width:100px;height:150px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:900px;left:820px;width:150px;height:200px;"></div>
|
||||
<div style="position: absolute; top: 800px; left: 620px;">
|
||||
<x-custom-circle title="RESTORAN" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="restoran-count" data_count="0"
|
||||
<div class="square dia-top-left-bottom-right" style="top:930px;left:820px;width:300px;height:180px;"></div>
|
||||
<div style="position: absolute; top: 800px; left: 550px;">
|
||||
<x-custom-circle title="RESTORAN" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="restoran-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: 800px; left: 720px;">
|
||||
<x-custom-circle title="HIBURAN" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="hiburan-count" data_count="0"
|
||||
<div style="position: absolute; top: 800px; left: 710px;">
|
||||
<x-custom-circle title="HIBURAN" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="hiburan-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: 800px; left: 820px;">
|
||||
<x-custom-circle title="HOTEL" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="hotel-count" data_count="0"
|
||||
<div style="position: absolute; top: 800px; left: 870px;">
|
||||
<x-custom-circle title="HOTEL" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="hotel-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
<div style="position: absolute; top: 800px; left: 920px;">
|
||||
<x-custom-circle title="PARKIR" size="small" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="parkir-count" data_count="0"
|
||||
<div style="position: absolute; top: 800px; left: 1030px;">
|
||||
<x-custom-circle title="PARKIR" size="large" style="background-color: #627c8b;margin-top:260px;"
|
||||
visible_data="true" data_id="parkir-count" data_count="0" visible_data_type="true" data_type="0"
|
||||
document_url=""
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user