fix data and dashboard count and sum
This commit is contained in:
@@ -44,7 +44,7 @@ class BigData {
|
||||
async getBigDataResume(filterByDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}&type=simbg`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -49,7 +49,7 @@ class LackOfPotential {
|
||||
async getDataTotalPotensi(filterDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=leader`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -44,7 +44,7 @@ class BigData {
|
||||
async getBigDataResume(filterByDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}&&type=leader`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -120,7 +120,7 @@ class DashboardPBG {
|
||||
async getResume(filterByDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterByDate}&type=leader`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -15,8 +15,10 @@ class DashboardPotentialInsideSystem {
|
||||
this.reklameCount = this.allCountData.total_reklame ?? 0;
|
||||
this.pdamCount = this.allCountData.total_pdam ?? 0;
|
||||
this.tataRuangCount = this.allCountData.total_tata_ruang ?? 0;
|
||||
this.tataRuangUsahaCount = this.allCountData.total_tata_ruang_usaha ?? 0;
|
||||
this.tataRuangNonUsahaCount = this.allCountData.total_tata_ruang_non_usaha ?? 0;
|
||||
this.tataRuangUsahaCount =
|
||||
this.allCountData.total_tata_ruang_usaha ?? 0;
|
||||
this.tataRuangNonUsahaCount =
|
||||
this.allCountData.total_tata_ruang_non_usaha ?? 0;
|
||||
|
||||
let dataReportTourism = this.allCountData.data_report;
|
||||
|
||||
@@ -51,7 +53,7 @@ class DashboardPotentialInsideSystem {
|
||||
async getDataTotalPotensi(filterDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=leader`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -21,7 +21,7 @@ class DashboardPotentialOutsideSystem {
|
||||
async getBigDataResume(filterDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}`,
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=leader`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
|
||||
@@ -5,7 +5,7 @@ export function addThousandSeparators(value, fractionDigits = 2) {
|
||||
|
||||
// Convert to string first if it's a number
|
||||
if (typeof value === "number") {
|
||||
return new Intl.NumberFormat("en-US", {
|
||||
return new Intl.NumberFormat("id-ID", {
|
||||
minimumFractionDigits: fractionDigits,
|
||||
maximumFractionDigits: fractionDigits,
|
||||
}).format(value);
|
||||
@@ -26,8 +26,8 @@ export function addThousandSeparators(value, fractionDigits = 2) {
|
||||
|
||||
if (isNaN(number)) return null; // Return null if conversion fails
|
||||
|
||||
// Format the number with thousand separators
|
||||
return new Intl.NumberFormat("en-US", {
|
||||
// Format the number with Indonesian format (dot for thousands, comma for decimal)
|
||||
return new Intl.NumberFormat("id-ID", {
|
||||
minimumFractionDigits: fractionDigits,
|
||||
maximumFractionDigits: fractionDigits,
|
||||
}).format(number);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Grid, html } from "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../global-config";
|
||||
import { Dropzone } from "dropzone";
|
||||
import { addThousandSeparators } from "../global-config";
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
class PbgTasks {
|
||||
@@ -87,6 +89,9 @@ class PbgTasks {
|
||||
"Function Type",
|
||||
"Consultation Type",
|
||||
{ name: "Due Date" },
|
||||
{
|
||||
name: "Retribution",
|
||||
},
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) => {
|
||||
@@ -191,6 +196,12 @@ class PbgTasks {
|
||||
item.function_type,
|
||||
item.consultation_type,
|
||||
item.due_date,
|
||||
item.pbg_task_retributions
|
||||
? addThousandSeparators(
|
||||
item.pbg_task_retributions
|
||||
.nilai_retribusi_bangunan
|
||||
)
|
||||
: "-",
|
||||
item,
|
||||
]),
|
||||
total: (data) => data.meta.total,
|
||||
|
||||
Reference in New Issue
Block a user