Browse Source

pembatasan pilihan zona

main^2
pecintaseni 7 months ago committed by =
parent
commit
a8152f85a2
  1. 3
      .prettierrc
  2. 72
      app/Controllers/Kewilayahan/Ref.php
  3. 19
      app/Helpers/KpdlHelper_helper.php
  4. 2
      app/Views/kewilayahan/dist/kpdl.js
  5. 252
      app/Views/kewilayahan/kytp/kpdl.js
  6. 1
      app/Views/kewilayahan/kytp/kpdl.php
  7. 18
      webpack.config.js

3
.prettierrc

@ -5,5 +5,6 @@
"trailingComma": "none", "trailingComma": "none",
"comma-dangle": false, "comma-dangle": false,
"printWidth": 160, "printWidth": 160,
"bracketSpacing": true "bracketSpacing": true,
"singleQuote": true
} }

72
app/Controllers/Kewilayahan/Ref.php

@ -135,7 +135,13 @@ class Ref extends Controller
$data = $db->table('KPDL_ZP_NAS_DIFF') $data = $db->table('KPDL_ZP_NAS_DIFF')
->select('KD_KANWIL as value, NM_KANWIL as label') ->select('KD_KANWIL as value, NM_KANWIL as label')
->distinct() ->distinct()
->orderBy('NM_KANWIL')->get()->getResult(); ->orderBy('NM_KANWIL');
if (session('kppadm') !== '000') {
$data->where('KD_KANWIL', session('kwladm'));
}
$data = $data->get()->getResult();
foreach ($data as $key => $val) { foreach ($data as $key => $val) {
$val->value = $Ald->encryptMe($val->value, $username); $val->value = $Ald->encryptMe($val->value, $username);
@ -156,7 +162,19 @@ class Ref extends Controller
->select('KD_KPP as value, NM_KPP as label') ->select('KD_KPP as value, NM_KPP as label')
->distinct() ->distinct()
->where('KD_KANWIL', $kanwil) ->where('KD_KANWIL', $kanwil)
->orderBy('NM_KPP')->get()->getResult(); ->orderBy('NM_KPP');
if (session('kppadm') !== '000') {
if (session('kppadm') != session('kwladm')) {
$data->where('KD_KPP', session('kppadm'));
}
if (session('kppadm') == session('kwladm')) {
$data->where("KD_KPP in (select KD_KPP from REF_KPP where KD_KANWIL ='" . session('kwladm') . "')");
}
}
$data = $data->get()->getResult();
foreach ($data as $key => $val) { foreach ($data as $key => $val) {
$val->value = $Ald->encryptMe($val->value, $username); $val->value = $Ald->encryptMe($val->value, $username);
} }
@ -165,17 +183,45 @@ class Ref extends Controller
public function zpseksi() public function zpseksi()
{ {
$Ald = new AldLibrary; $Ald = new AldLibrary;
$username = session('nip'); $username = session('nip');
$kpp = $Ald->decryptMe($this->request->getPost('kpp'), $username); $kpp = $Ald->decryptMe($this->request->getPost('kpp'), $username);
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$currentPegawai = currentPegawai();
$data = $db->table('KPDL_ZP_NAS_DIFF') $data = $db->table('KPDL_ZP_NAS_DIFF')
->select('KD_UNIT_OR as value, SEKSI as label') ->select('KD_UNIT_OR as value, SEKSI as label')
->distinct() ->distinct()
->where('KD_KPP', $kpp) ->where('KD_KPP', $kpp)
->orderBy('SEKSI')->get()->getResult(); ->orderBy('SEKSI');
//constrain user
if (session('kppadm') !== '000') {
if (session('kppadm') != session('kwladm')) { //kpp
$data->where('KD_KPP', session('kppadm'));
//hanya kasi dan AR seksi was || kepala kantor
if (!((in_array($currentPegawai->KD_JAB_STRUKTURAL, ['602', '401']) && substr($currentPegawai->NAMA_UNIT_ES4, 0, 16) == 'Seksi Pengawasan')
|| (substr($currentPegawai->KD_JAB_STRUKTURAL, 0, 1) == '3'))) {
return $this->respond([], 200);
}
//kasi / AR
if (in_array($currentPegawai->KD_JAB_STRUKTURAL, ['602', '401'])) {
$data->where('KD_UNIT_OR', $currentPegawai->KD_UNIT_ORGANISASI);
}
}
if (session('kppadm') == session('kwladm')) { //kanwil
$data->where("KD_KPP in (select KD_KPP from REF_KPP where KD_KANWIL ='" . session('kwladm') . "')");
}
}
$data = $data->get()->getResult();
foreach ($data as $key => $val) { foreach ($data as $key => $val) {
$val->value = $Ald->encryptKpdl($val->value, $username); $val->value = $Ald->encryptKpdl($val->value, $username);
@ -198,19 +244,39 @@ class Ref extends Controller
} }
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$currentPegawai = currentPegawai();
$data = $db->table('KPDL_ZP_NAS_DIFF') $data = $db->table('KPDL_ZP_NAS_DIFF')
->select('NIP_AR as value, NM_AR as label') ->select('NIP_AR as value, NM_AR as label')
->distinct() ->distinct()
->where('KD_KPP', $kpp) ->where('KD_KPP', $kpp)
->whereIn('KD_UNIT_OR', $seksi) ->whereIn('KD_UNIT_OR', $seksi)
->orderBy('NM_AR'); ->orderBy('NM_AR');
//constrain user
if (session('kppadm') !== '000') {
if (session('kppadm') != session('kwladm')) { //kpp
$data->where('KD_KPP', session('kppadm'));
//hanya kasi dan AR seksi was || kepala kantor
if (!((in_array($currentPegawai->KD_JAB_STRUKTURAL, ['602', '401']) && substr($currentPegawai->NAMA_UNIT_ES4, 0, 16) == 'Seksi Pengawasan')
|| (substr($currentPegawai->KD_JAB_STRUKTURAL, 0, 1) == '3'))) {
return $this->respond([], 200);
}
//kasi
if (in_array($currentPegawai->KD_JAB_STRUKTURAL, ['602'])) {
$data->where('NIP_AR', session('nip'));
}
}
}
$data = $data->get()->getResult(); $data = $data->get()->getResult();
foreach ($data as $key => $val) { foreach ($data as $key => $val) {
$val->value = $Ald->encryptMe($val->value, $username); $val->value = $Ald->encryptMe($val->value, $username);
} }
return json_encode($data); return json_encode($data);
} }
public function zpzp() public function zpzp()
{ {
$Ald = new AldLibrary; $Ald = new AldLibrary;

19
app/Helpers/KpdlHelper_helper.php

@ -1,6 +1,8 @@
<?php <?php
use App\Libraries\AldLibrary; use App\Libraries\AldLibrary;
use SebastianBergmann\Type\ObjectType;
if (!function_exists('currentMonth')) { if (!function_exists('currentMonth')) {
function currentMonth() function currentMonth()
{ {
@ -27,3 +29,20 @@ if (!function_exists('encryptData')) {
return $Ald->encryptMe($text, $username); return $Ald->encryptMe($text, $username);
} }
} }
if (!function_exists('getSession')) {
function getSession()
{
$session = session();
return json_encode($session->get());
}
}
if (!function_exists('currentPegawai')) {
function currentPegawai(): object
{
$db = \Config\Database::connect();
$ret = $db->table('PEGAWAI')->where('NIP9', session('nip'))->get()->getFirstRow();
return $ret;
}
}

2
app/Views/kewilayahan/dist/kpdl.js vendored

File diff suppressed because one or more lines are too long

252
app/Views/kewilayahan/kytp/kpdl.js

@ -1,35 +1,35 @@
import React, { useEffect, useRef, useState } from "react" import React, { useEffect, useRef, useState } from 'react'
import ReactDOM from "react-dom" import ReactDOM from 'react-dom'
import { Button, Card, CardBody, CardHeader, CardText, CardTitle, Col, Label, Nav, NavItem, NavLink, Row, TabContent, TabPane } from "reactstrap" import { Button, Card, CardBody, CardHeader, CardText, CardTitle, Col, Label, Nav, NavItem, NavLink, Row, TabContent, TabPane } from 'reactstrap'
import Select from "react-select" import Select from 'react-select'
import jquery, { data, getJSON } from "jquery" import jquery, { data, getJSON } from 'jquery'
import collect from "collect.js" import collect from 'collect.js'
import { format_angka, isObjEmpty } from "./util" import { format_angka, isObjEmpty } from './util'
import { MultiSelect } from "react-multi-select-component" import { MultiSelect } from 'react-multi-select-component'
import Highcharts from "highcharts" import Highcharts from 'highcharts'
import HighchartsReact from "highcharts-react-official" import HighchartsReact from 'highcharts-react-official'
import { Toast } from "primereact/toast" import { Toast } from 'primereact/toast'
import { Button as ButtonP } from "primereact/button" import { Button as ButtonP } from 'primereact/button'
import "primereact/resources/themes/bootstrap4-light-blue/theme.css" import 'primereact/resources/themes/bootstrap4-light-blue/theme.css'
import "primeflex/primeflex.css" import 'primeflex/primeflex.css'
import TabProgresifitas from "./TabProgresifitas" import TabProgresifitas from './TabProgresifitas'
import TabPenugasan from "./TabPenugasan" import TabPenugasan from './TabPenugasan'
import NipPerekam from "./componentDepan/NipPerekam" import NipPerekam from './componentDepan/NipPerekam'
import NipPengampu from "./componentDepan/NipPengampu" import NipPengampu from './componentDepan/NipPengampu'
import { Provider, useDispatch, useSelector } from "react-redux" import { Provider, useDispatch, useSelector } from 'react-redux'
import { store } from "./store/store" import { store } from './store/store'
import { setSelectedOpsi } from "./store/KpdlStore" import { setSelectedOpsi } from './store/KpdlStore'
// import 'bootstrap/dist/css/bootstrap.m in.css'; // import 'bootstrap/dist/css/bootstrap.m in.css';
// let datasend = {} // let datasend = {}
const Root = () => { const Root = () => {
const base_url = "<?=base_url()?>" const base_url = '<?=base_url()?>'
const refChart1 = useRef(null) const refChart1 = useRef(null)
const toast = useRef(null) const toast = useRef(null)
const dispatch = useDispatch() const dispatch = useDispatch()
const storeKpdl = useSelector((state) => state.kpdl) const storeKpdl = useSelector((state) => state.kpdl)
const [dataOpsi, setDataOpsi] = useState({}) const [dataOpsi, setDataOpsi] = useState({})
const [active, setActive] = useState("wilayah") const [active, setActive] = useState('zona')
const [hiddenGraphMatoa, setHiddenGraphMatoa] = useState(false) const [hiddenGraphMatoa, setHiddenGraphMatoa] = useState(false)
@ -61,34 +61,44 @@ const Root = () => {
const [dataSend, setDataSend] = useState({ opsiWilZona: null, adm4_pcode: [], id_poly_zona: [], nip_ar_perekam: [], nip_ar_pengampu: [] }) const [dataSend, setDataSend] = useState({ opsiWilZona: null, adm4_pcode: [], id_poly_zona: [], nip_ar_perekam: [], nip_ar_pengampu: [] })
const [dataGraphMatoa, setDataGraphMatoa] = useState({ poi_agg: [], kpdl_agg: [] }) const [dataGraphMatoa, setDataGraphMatoa] = useState({ poi_agg: [], kpdl_agg: [] })
// let session = null
useEffect(() => {}, []) const [session, setSession] = useState({})
useEffect(() => { useEffect(() => {
setTimeout(() => {
const session1 = JSON.parse('<?=getSession()?>')
setSession(session1)
if (session1.kppadm === '000') {
toggle('wilayah')
} else {
toggle('zona')
}
}, 2000)
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/propinsi", url: base_url + 'kewilayahan/ref/propinsi',
method: "GET", method: 'GET',
dataType: "json", dataType: 'json',
success: (data) => { success: (data) => {
setProp(data) setProp(data)
} }
}) })
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/zpkanwil", url: base_url + 'kewilayahan/ref/zpkanwil',
method: "GET", method: 'GET',
dataType: "json", dataType: 'json',
success: (data) => { success: (data) => {
setKanwil(data) setKanwil(data)
} }
}) })
jquery.getJSON(base_url + "kewilayahan/ref/opsi").then((response) => { jquery.getJSON(base_url + 'kewilayahan/ref/opsi').then((response) => {
setDataOpsi(response) setDataOpsi(response)
dispatch(setSelectedOpsi(response.default)) dispatch(setSelectedOpsi(response.default))
}) })
let judul = document.getElementById("judul") let judul = document.getElementById('judul')
judul.innerHTML = "<h3><b><strong>E-Geospatial Thematic Tax</strong></b></h3>" judul.innerHTML = '<h3><b><strong>E-Geospatial Thematic Tax</strong></b></h3>'
}, []) }, [])
useEffect(() => { useEffect(() => {
@ -101,9 +111,9 @@ const Root = () => {
if (propSelected && !isObjEmpty(propSelected)) { if (propSelected && !isObjEmpty(propSelected)) {
const prop = propSelected.value const prop = propSelected.value
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/kota", url: base_url + 'kewilayahan/ref/kota',
method: "GET", method: 'GET',
dataType: "json", dataType: 'json',
data: { prop }, data: { prop },
success: (data) => { success: (data) => {
setKota(data) setKota(data)
@ -120,9 +130,9 @@ const Root = () => {
if (kotaSelected && !isObjEmpty(kotaSelected)) { if (kotaSelected && !isObjEmpty(kotaSelected)) {
const kota = kotaSelected.value const kota = kotaSelected.value
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/kecamatan", url: base_url + 'kewilayahan/ref/kecamatan',
method: "GET", method: 'GET',
dataType: "json", dataType: 'json',
data: { kota }, data: { kota },
success: (data) => { success: (data) => {
setKec(data) setKec(data)
@ -135,11 +145,11 @@ const Root = () => {
setKel([]) setKel([])
setKelSelected([]) setKelSelected([])
if (kecSelected.length && !isObjEmpty(kecSelected)) { if (kecSelected.length && !isObjEmpty(kecSelected)) {
const kec = collect(kecSelected).pluck("value").all() const kec = collect(kecSelected).pluck('value').all()
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/kelurahan", url: base_url + 'kewilayahan/ref/kelurahan',
method: "POST", method: 'POST',
dataType: "json", dataType: 'json',
data: { kec }, data: { kec },
success: (data) => { success: (data) => {
setKel(data) setKel(data)
@ -160,9 +170,9 @@ const Root = () => {
if (kanwilSelected && !isObjEmpty(kanwilSelected)) { if (kanwilSelected && !isObjEmpty(kanwilSelected)) {
const kanwil = kanwilSelected.value const kanwil = kanwilSelected.value
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/zpkpp", url: base_url + 'kewilayahan/ref/zpkpp',
method: "POST", method: 'POST',
dataType: "json", dataType: 'json',
data: { kanwil }, data: { kanwil },
success: (data) => { success: (data) => {
setKpp(data) setKpp(data)
@ -181,9 +191,9 @@ const Root = () => {
if (kppSelected && !isObjEmpty(kppSelected)) { if (kppSelected && !isObjEmpty(kppSelected)) {
const kpp = kppSelected.value const kpp = kppSelected.value
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/zpseksi", url: base_url + 'kewilayahan/ref/zpseksi',
method: "POST", method: 'POST',
dataType: "json", dataType: 'json',
data: { kpp }, data: { kpp },
success: (data) => { success: (data) => {
setSeksi(data) setSeksi(data)
@ -199,12 +209,12 @@ const Root = () => {
setZpSelected([]) setZpSelected([])
if (seksiSelected && !isObjEmpty(seksiSelected)) { if (seksiSelected && !isObjEmpty(seksiSelected)) {
const kpp = kppSelected.value const kpp = kppSelected.value
const seksi = collect(seksiSelected).pluck("value").all() const seksi = collect(seksiSelected).pluck('value').all()
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/zpar", url: base_url + 'kewilayahan/ref/zpar',
method: "POST", method: 'POST',
dataType: "json", dataType: 'json',
data: { kpp, seksi }, data: { kpp, seksi },
success: (data) => { success: (data) => {
setAr(data) setAr(data)
@ -218,12 +228,12 @@ const Root = () => {
setZpSelected([]) setZpSelected([])
if (arSelected && !isObjEmpty(arSelected)) { if (arSelected && !isObjEmpty(arSelected)) {
const kpp = kppSelected.value const kpp = kppSelected.value
const seksi = collect(seksiSelected).pluck("value").all() const seksi = collect(seksiSelected).pluck('value').all()
const ar = collect(arSelected).pluck("value").all() const ar = collect(arSelected).pluck('value').all()
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/ref/zpzp", url: base_url + 'kewilayahan/ref/zpzp',
method: "POST", method: 'POST',
dataType: "json", dataType: 'json',
data: { kpp, seksi, ar }, data: { kpp, seksi, ar },
success: (data) => { success: (data) => {
setZp(data) setZp(data)
@ -234,27 +244,27 @@ const Root = () => {
const buttonProsesOnClick = () => { const buttonProsesOnClick = () => {
const opsiWilZona = active const opsiWilZona = active
const adm4_pcode = collect(kelSelected).pluck("value").all() const adm4_pcode = collect(kelSelected).pluck('value').all()
const id_poly_zona = collect(zpSelected).pluck("value").all() const id_poly_zona = collect(zpSelected).pluck('value').all()
const nip_ar_pengampu = collect().pluck("value").all() const nip_ar_pengampu = collect().pluck('value').all()
console.log(dataOpsi) console.log(dataOpsi)
switch (opsiWilZona) { switch (opsiWilZona) {
case "wilayah": case 'wilayah':
if (adm4_pcode.length) { if (adm4_pcode.length) {
dispatch(setSelectedOpsi(dataOpsi.wilayah)) dispatch(setSelectedOpsi(dataOpsi.wilayah))
setDataSend({ opsiWilZona: dataOpsi.wilayah.key, adm4_pcode, id_poly_zona: [] }) setDataSend({ opsiWilZona: dataOpsi.wilayah.key, adm4_pcode, id_poly_zona: [] })
setHiddenGraphMatoa(false) setHiddenGraphMatoa(false)
} else { } else {
toast.current.show({ severity: "info", summary: "Info", detail: "Kelurahan harus dipilih" }) toast.current.show({ severity: 'info', summary: 'Info', detail: 'Kelurahan harus dipilih' })
} }
break break
case "zona": case 'zona':
if (id_poly_zona.length) { if (id_poly_zona.length) {
dispatch(setSelectedOpsi(dataOpsi.zona)) dispatch(setSelectedOpsi(dataOpsi.zona))
setDataSend({ opsiWilZona: dataOpsi.zona.key, adm4_pcode: [], id_poly_zona }) setDataSend({ opsiWilZona: dataOpsi.zona.key, adm4_pcode: [], id_poly_zona })
setHiddenGraphMatoa(false) setHiddenGraphMatoa(false)
} else { } else {
toast.current.show({ severity: "info", summary: "Info", detail: "Zona harus dipilih" }) toast.current.show({ severity: 'info', summary: 'Info', detail: 'Zona harus dipilih' })
} }
break break
@ -271,9 +281,9 @@ const Root = () => {
Highcharts.setOptions({ Highcharts.setOptions({
accessibility: false, accessibility: false,
lang: { lang: {
decimalPoint: ",", decimalPoint: ',',
thousandsSep: ".", thousandsSep: '.',
numericSymbols: ["rb", "jt", "M", "T", "P", "E"] numericSymbols: ['rb', 'jt', 'M', 'T', 'P', 'E']
}, },
tooltip: { tooltip: {
@ -281,9 +291,9 @@ const Root = () => {
} }
}) })
jquery.ajax({ jquery.ajax({
url: base_url + "kewilayahan/kytp/graph_matoa", url: base_url + 'kewilayahan/kytp/graph_matoa',
dataType: "json", dataType: 'json',
type: "POST", type: 'POST',
data: { ...dataSend }, data: { ...dataSend },
success: (data) => { success: (data) => {
setDataGraphMatoa(data) setDataGraphMatoa(data)
@ -293,17 +303,17 @@ const Root = () => {
const optionsGraphMatoaAgg = { const optionsGraphMatoaAgg = {
chart: { chart: {
zoomType: "xy", zoomType: 'xy',
height: "320" height: '320'
}, },
title: { title: {
text: "Poi Google Vs Matoa", text: 'Poi Google Vs Matoa',
style: { fontSize: "14px" } style: { fontSize: '14px' }
}, },
xAxis: [ xAxis: [
{ {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
crosshair: true crosshair: true
} }
], ],
@ -311,7 +321,7 @@ const Root = () => {
{ {
gridLineWidth: 0, gridLineWidth: 0,
title: { title: {
text: "", text: '',
style: { style: {
color: Highcharts.getOptions().colors[0] color: Highcharts.getOptions().colors[0]
} }
@ -332,7 +342,7 @@ const Root = () => {
} }
}, },
title: { title: {
text: "NPWP Work True", text: 'NPWP Work True',
style: { style: {
color: Highcharts.getOptions().colors[1] color: Highcharts.getOptions().colors[1]
} }
@ -343,7 +353,7 @@ const Root = () => {
{ {
gridLineWidth: 0, gridLineWidth: 0,
title: { title: {
text: "Rupiah", text: 'Rupiah',
style: { style: {
color: Highcharts.getOptions().colors[2] color: Highcharts.getOptions().colors[2]
} }
@ -360,15 +370,15 @@ const Root = () => {
{ {
gridLineWidth: 0, gridLineWidth: 0,
title: { title: {
text: "", text: '',
style: { style: {
color: "#FF0000" color: '#FF0000'
} }
}, },
labels: { labels: {
//format: '{value}', //format: '{value}',
style: { style: {
color: "##FF0000" color: '##FF0000'
} }
}, },
opposite: true opposite: true
@ -378,33 +388,33 @@ const Root = () => {
shared: true shared: true
}, },
legend: { legend: {
layout: "horizontal", layout: 'horizontal',
align: "center", align: 'center',
//x: 80, //x: 80,
verticalAlign: "top", verticalAlign: 'top',
//y: 55, //y: 55,
//floating: true, //floating: true,
backgroundColor: backgroundColor:
Highcharts.defaultOptions.legend.backgroundColor || // theme Highcharts.defaultOptions.legend.backgroundColor || // theme
"rgba(255,255,255,0.25)" 'rgba(255,255,255,0.25)'
}, },
series: [ series: [
{ {
color: "#FF0000", color: '#FF0000',
name: "Jml PoI", name: 'Jml PoI',
type: "column", type: 'column',
yAxis: 3, yAxis: 3,
data: dataGraphMatoa.poi_agg, data: dataGraphMatoa.poi_agg,
marker: { marker: {
enabled: true enabled: true
}, },
tooltip: { tooltip: {
valueSuffix: " PoI" valueSuffix: ' PoI'
} }
}, },
{ {
name: "Matoa", name: 'Matoa',
type: "spline", type: 'spline',
yAxis: 3, yAxis: 3,
data: dataGraphMatoa.kpdl_agg, data: dataGraphMatoa.kpdl_agg,
marker: { marker: {
@ -416,7 +426,7 @@ const Root = () => {
let pct_coverage let pct_coverage
const jml_poi_agg = dataGraphMatoa.poi_agg const jml_poi_agg = dataGraphMatoa.poi_agg
if (jml_poi_agg[idx] && jml_poi_agg[idx] !== 0) { if (jml_poi_agg[idx] && jml_poi_agg[idx] !== 0) {
pct_coverage = format_angka(parseFloat((parseFloat(this.y) / jml_poi_agg[idx]) * 100).toFixed(2)) + "%" pct_coverage = format_angka(parseFloat((parseFloat(this.y) / jml_poi_agg[idx]) * 100).toFixed(2)) + '%'
} }
let s = let s =
@ -424,16 +434,16 @@ const Root = () => {
this.color + this.color +
'">\u25CF</span> ' + '">\u25CF</span> ' +
this.series.name + this.series.name +
": <b>" + ': <b>' +
format_angka(this.y) + format_angka(this.y) +
" lokasi kpdl</b> " + ' lokasi kpdl</b> ' +
(pct_coverage ? "(" + pct_coverage + ")<br>\n" : "<br>") (pct_coverage ? '(' + pct_coverage + ')<br>\n' : '<br>')
return s return s
}, },
shared: false shared: false
}, },
visible: true, visible: true,
color: "#8000ff" color: '#8000ff'
} }
] ]
} }
@ -445,23 +455,25 @@ const Root = () => {
<Card> <Card>
<CardBody> <CardBody>
<Nav tabs> <Nav tabs>
{session.kppadm === '000' ? (
<NavItem> <NavItem>
<NavLink <NavLink
style={{ cursor: "pointer" }} style={{ cursor: 'pointer' }}
active={active === "wilayah"} active={active === 'wilayah'}
onClick={() => { onClick={() => {
toggle("wilayah") toggle('wilayah')
}} }}
> >
Wilayah Adm. Wilayah Adm.
</NavLink> </NavLink>
</NavItem> </NavItem>
) : null}
<NavItem> <NavItem>
<NavLink <NavLink
style={{ cursor: "pointer" }} style={{ cursor: 'pointer' }}
active={active === "zona"} active={active === 'zona'}
onClick={() => { onClick={() => {
toggle("zona") toggle('zona')
}} }}
> >
Zona Pengawasan Zona Pengawasan
@ -469,10 +481,10 @@ const Root = () => {
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink <NavLink
style={{ cursor: "pointer" }} style={{ cursor: 'pointer' }}
active={active === "perekam"} active={active === 'perekam'}
onClick={() => { onClick={() => {
toggle("perekam") toggle('perekam')
}} }}
> >
Perekam Perekam
@ -480,17 +492,17 @@ const Root = () => {
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink <NavLink
style={{ cursor: "pointer" }} style={{ cursor: 'pointer' }}
active={active === "pengampu"} active={active === 'pengampu'}
onClick={() => { onClick={() => {
toggle("pengampu") toggle('pengampu')
}} }}
> >
Pengampu Pengampu
</NavLink> </NavLink>
</NavItem> </NavItem>
</Nav> </Nav>
<TabContent className="py-3" activeTab={active}> <TabContent className="py-3" activeTab={session.kppadm === '000' ? active : 'zona'}>
<TabPane tabId="wilayah"> <TabPane tabId="wilayah">
<Row> <Row>
<Col md="3"> <Col md="3">
@ -541,7 +553,7 @@ const Root = () => {
setKecSelected(e) setKecSelected(e)
}} }}
labelledBy="Pilih Kecamatan" labelledBy="Pilih Kecamatan"
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih Kecamatan" }} overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Kecamatan' }}
/> />
</Col> </Col>
<Col md="3"> <Col md="3">
@ -558,7 +570,7 @@ const Root = () => {
setKelSelected(e) setKelSelected(e)
}} }}
labelledBy="Pilih Kelurahan" labelledBy="Pilih Kelurahan"
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih Kelurahan" }} overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Kelurahan' }}
/> />
</Col> </Col>
</Row> </Row>
@ -618,7 +630,7 @@ const Root = () => {
setSeksiSelected(e) setSeksiSelected(e)
}} }}
labelledBy="Pilih Seksi" labelledBy="Pilih Seksi"
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih Seksi" }} overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Seksi' }}
/> />
</Col> </Col>
<Col md="3"> <Col md="3">
@ -635,7 +647,7 @@ const Root = () => {
setArSelected(e) setArSelected(e)
}} }}
labelledBy="Pilih AR" labelledBy="Pilih AR"
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih AR" }} overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih AR' }}
/> />
</Col> </Col>
</Row> </Row>
@ -654,7 +666,7 @@ const Root = () => {
setZpSelected(e) setZpSelected(e)
}} }}
labelledBy="Pilih Zona" labelledBy="Pilih Zona"
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih Zona" }} overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Zona' }}
/> />
</Col> </Col>
<Col md="3" className="pt-4"> <Col md="3" className="pt-4">
@ -688,11 +700,11 @@ const Root = () => {
</Col> </Col>
</Row> </Row>
<Row hidden={["pengampu", "perekam"].includes(storeKpdl.selectedOpsi?.name)}> <Row hidden={['pengampu', 'perekam'].includes(storeKpdl.selectedOpsi?.name)}>
<Col sm="12"> <Col sm="12">
<Card> <Card>
<CardHeader className="d-flex justify-content-center p-2"> <CardHeader className="d-flex justify-content-center p-2">
<CardTitle tag={"h1"} className="font-weight-bold"> <CardTitle tag={'h1'} className="font-weight-bold">
Statistik Penguasaan Wilayah Statistik Penguasaan Wilayah
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
@ -708,7 +720,7 @@ const Root = () => {
<Col sm="12"> <Col sm="12">
<Card> <Card>
<CardHeader className="d-flex justify-content-center p-2"> <CardHeader className="d-flex justify-content-center p-2">
<CardTitle tag={"h1"} className="font-weight-bold"> <CardTitle tag={'h1'} className="font-weight-bold">
Statistik Progresifitas & Sebaran Data Hasil Kegiatan Matoa Statistik Progresifitas & Sebaran Data Hasil Kegiatan Matoa
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
@ -728,7 +740,7 @@ const Root = () => {
) )
} }
const container = document.getElementById("app") const container = document.getElementById('app')
const component = ( const component = (
<Provider store={store}> <Provider store={store}>
<Root /> <Root />

1
app/Views/kewilayahan/kytp/kpdl.php

@ -5,7 +5,6 @@
} }
</style> </style>
<?php <?php
helper('Kpdl'); helper('Kpdl');
?> ?>

18
webpack.config.js

@ -1,13 +1,13 @@
const path = require("path") const path = require('path')
//__dirname, //__dirname,
module.exports = { module.exports = {
// entry: "./App.js", // entry: "./App.js",
entry: { entry: {
kpdl: "./app/Views/kewilayahan/kytp/kpdl.js" kpdl: './app/Views/kewilayahan/kytp/kpdl.js'
}, },
output: { output: {
path: path.resolve("./app/Views/kewilayahan/dist"), path: path.resolve('./app/Views/kewilayahan/dist'),
filename: "[name].js" filename: '[name].js'
}, },
optimization: { optimization: {
minimize: true minimize: true
@ -17,19 +17,19 @@ module.exports = {
{ {
exclude: /node_modules/, exclude: /node_modules/,
use: { use: {
loader: "babel-loader", loader: 'babel-loader',
options: { options: {
presets: ["@babel/preset-react"], presets: ['@babel/preset-react'],
plugins: ["@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator"] plugins: ['@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator']
} }
} }
}, },
{ {
test: /\.css$/i, test: /\.css$/i,
// type: "asset" // type: "asset"
use: ["style-loader", "css-loader"] use: ['style-loader', 'css-loader']
} }
] ]
}, },
mode: "production" mode: 'production'
} }

Loading…
Cancel
Save