72 changed files with 5296 additions and 65574 deletions
@ -1,130 +0,0 @@
|
||||
DROP MATERIALIZED VIEW GENAPP.KPDL_MV_PETUGAS_REKAM; |
||||
|
||||
CREATE MATERIALIZED VIEW GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(KODE_SEKSI_PEREKAM,KODE_PEG_PEREKAM,ID_KPDL_SUBJEK,KPPADM_PEREKAM,NIP_PEREKAM, |
||||
CREATION_DATE,ORG_APPROVAL_KASI,NIP_APPROVAL_KASI,TGL_APPROVAL_KASI,STS_APPROVAL_KASI, |
||||
TGL_APPROVAL_PKD,STS_APPROVAL_PKD) |
||||
TABLESPACE TS_KPDL |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
) |
||||
NOCACHE |
||||
NOLOGGING |
||||
NOCOMPRESS |
||||
PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT ) |
||||
BUILD IMMEDIATE |
||||
REFRESH FORCE ON DEMAND |
||||
WITH PRIMARY KEY |
||||
AS |
||||
SELECT |
||||
COALESCE(a.KPP_ADM_PEREKAM, '') || '-' || COALESCE (ORG_APPROVAL_KASI,'') KODE_SEKSI_PEREKAM, |
||||
COALESCE(a.KPP_ADM_PEREKAM, '') || '-' || COALESCE (ORG_APPROVAL_KASI, |
||||
'') || '-' || COALESCE (a.CREATED_BY, |
||||
'') KODE_PEG_PEREKAM, |
||||
a.ID_KPDL_SUBJEK, |
||||
a.KPP_ADM_PEREKAM KPPADM_PEREKAM, |
||||
a.CREATED_BY NIP_PEREKAM, |
||||
a.CREATION_DATE, |
||||
b.ORG_APPROVAL_KASI, |
||||
b.NIP_APPROVAL_KASI, |
||||
b.TGL_APPROVAL_KASI, |
||||
b.STS_APPROVAL_KASI, |
||||
b.TGL_APPROVAL_PKD, |
||||
b.STS_APPROVAL_PKD |
||||
FROM |
||||
KPDL_SUBJEK a |
||||
LEFT JOIN KPDL_TRX b ON |
||||
(a.ID_KPDL_SUBJEK = b.ID_KPDL_SUBJEK) |
||||
WHERE |
||||
a.FG_SUMBER = 'MATOA'; |
||||
|
||||
|
||||
COMMENT ON MATERIALIZED VIEW GENAPP.KPDL_MV_PETUGAS_REKAM IS 'snapshot table for snapshot GENAPP.KPDL_MV_PETUGAS_REKAM'; |
||||
|
||||
CREATE INDEX GENAPP.KPDL_MV_PETUGAS_REKAM_CREATION_DATE_IDX ON GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(CREATION_DATE) |
||||
LOGGING |
||||
TABLESPACE USERS |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
); |
||||
|
||||
CREATE INDEX GENAPP.KPDL_MV_PETUGAS_REKAM_ID_KPDL_SUBJEK_IDX ON GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(ID_KPDL_SUBJEK) |
||||
LOGGING |
||||
TABLESPACE USERS |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
); |
||||
|
||||
CREATE INDEX GENAPP.KPDL_MV_PETUGAS_REKAM_KODE_PEG_PEREKAM_IDX ON GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(KODE_PEG_PEREKAM) |
||||
LOGGING |
||||
TABLESPACE USERS |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
); |
||||
|
||||
CREATE INDEX GENAPP.KPDL_MV_PETUGAS_REKAM_KODE_SEKSI_PEREKAM_IDX ON GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(KODE_SEKSI_PEREKAM) |
||||
LOGGING |
||||
TABLESPACE USERS |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
); |
||||
|
||||
CREATE INDEX GENAPP.KPDL_MV_PETUGAS_REKAM_NIP_PEREKAM_IDX ON GENAPP.KPDL_MV_PETUGAS_REKAM |
||||
(NIP_PEREKAM) |
||||
LOGGING |
||||
TABLESPACE USERS |
||||
PCTFREE 10 |
||||
INITRANS 2 |
||||
MAXTRANS 255 |
||||
STORAGE ( |
||||
INITIAL 64K |
||||
NEXT 1M |
||||
MINEXTENTS 1 |
||||
MAXEXTENTS UNLIMITED |
||||
PCTINCREASE 0 |
||||
BUFFER_POOL DEFAULT |
||||
); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,66 @@
|
||||
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit' |
||||
import jquery from 'jquery' |
||||
|
||||
export const getStatusSPT = createAsyncThunk('peta/getStatusSPT', async () => { |
||||
const response = await jquery.get(`/engineN/kewilayahan/ref/statusspt`) |
||||
return response |
||||
}) |
||||
|
||||
export const petaSlice = createSlice({ |
||||
name: 'peta', |
||||
initialState: { |
||||
selectedOpsi: null, |
||||
user: {}, |
||||
warnaBayar: { |
||||
black: { |
||||
wb: 'black', |
||||
info: 'di bawah Rp0', |
||||
warna: '#202020' |
||||
}, |
||||
BLACK: { |
||||
wb: 'BLACK', |
||||
info: 'Rp0', |
||||
warna: '#685f62' |
||||
}, |
||||
red: { |
||||
wb: 'red', |
||||
info: 'di bawah 5juta', |
||||
warna: '#ff0000' |
||||
}, |
||||
yellow: { |
||||
wb: 'yellow', |
||||
info: '5 jt s.d. 48 jt', |
||||
warna: '#aba210' |
||||
}, |
||||
green: { |
||||
wb: 'green', |
||||
info: '48 jt s.d. 100 jt', |
||||
warna: '#00a800' |
||||
}, |
||||
blue: { |
||||
wb: 'blue', |
||||
info: 'di atas 100 jt', |
||||
warna: '#0000e1' |
||||
} |
||||
}, |
||||
statusSPT: {}, |
||||
cqlFilterWilayah: '(1=1)' |
||||
}, |
||||
reducers: { |
||||
setSelectedOpsi: (state, action) => { |
||||
state.selectedOpsi = action.payload |
||||
}, |
||||
setCqlFilterWilayah: (state, action) => { |
||||
state.cqlFilterWilayah = action.payload |
||||
} |
||||
}, |
||||
extraReducers: (builder) => { |
||||
builder.addCase(getStatusSPT.fulfilled, (state, action) => { |
||||
state.statusSPT = action.payload |
||||
}) |
||||
} |
||||
}) |
||||
|
||||
export const { setSelectedOpsi, setDataMonitoring, setDataUrut, setCqlFilterWilayah } = petaSlice.actions |
||||
|
||||
export default petaSlice.reducer |
@ -0,0 +1,195 @@
|
||||
/* eslint-disable no-unused-vars */ |
||||
import React, { useRef } from 'react' |
||||
import { register } from 'swiper/element/bundle' |
||||
register() |
||||
import Swiper from 'swiper' |
||||
import { Navigation, Pagination } from 'swiper/modules' |
||||
// import Swiper and modules styles
|
||||
import 'swiper/css' |
||||
import 'swiper/css/navigation' |
||||
import 'swiper/css/pagination' |
||||
import { Button, Card, CardBody } from 'reactstrap' |
||||
import { useEffect, useState } from 'react' |
||||
import { Category, Filter, Filter2, FilterAlt, Layers, Money, PointOfSale, RateReview, UploadFile } from '@mui/icons-material' |
||||
// import 'primereact/resources/themes/lara-light-cyan/theme.css'
|
||||
// import PoiInRadiusCenter from "./PoiInRadiusCenter"
|
||||
// import PopUpWilayah from "./PopUpFilter/PoUpWilayah"
|
||||
// import { GeoJSON } from 'react-leaflet'
|
||||
import { useDispatch, useSelector } from 'react-redux' |
||||
import PopUpWilayah from './PoUpWilayah' |
||||
import jquery from 'jquery' |
||||
import { matoaLayers } from './layers/overlayLayers' |
||||
import PopUPTematikPembayaran from './PopUPTematikPembayaran' |
||||
import PopUpRatingGoogle from './PopUpRatingGoogle' |
||||
// import PoiInRadiusCenter from "./PoiInRadiusCenter"
|
||||
const MenuBawah = (props) => { |
||||
const { wmsRef, refFeatureBawah, zonaRef, dataSend, setDataSend } = props |
||||
const [isOpenPopUpWilayah, setIsOpenPopUpWilayah] = useState(false) |
||||
const [isOpenPopUpPembayaran, setIsOpenPopUpPembayaran] = useState(false) |
||||
const [isOpenPopUpRating, setIsOpenPopUpRating] = useState(false) |
||||
// const storeMap = useSelector((state) => state.crmmap)
|
||||
const [dataOpsi, setDataOpsi] = useState({}) |
||||
const [filterWilayah, setFilterWilayah] = useState('(1=1)') |
||||
useEffect(() => { |
||||
new Swiper('.swiper', { |
||||
slidesPerView: 4, |
||||
|
||||
grid: { |
||||
rows: 0 |
||||
}, |
||||
mousewheel: { |
||||
forceToAxis: false |
||||
}, |
||||
focusableElements: true, |
||||
allowTouchMove: true |
||||
}) |
||||
}, []) |
||||
const onClickWilayah = (e) => { |
||||
// console.log(e.target)
|
||||
setIsOpenPopUpWilayah(true) |
||||
} |
||||
const onClickRatingUlasan = (e) => { |
||||
// console.log(e)
|
||||
setIsOpenPopUpRating(true) |
||||
} |
||||
const dispatch = useDispatch() |
||||
useEffect(() => { |
||||
jquery.getJSON('/engineN/kewilayahan/ref/opsi').then((response) => { |
||||
setDataOpsi(response) |
||||
dispatch(setSelectedOpsi(response.default)) |
||||
}) |
||||
}, []) |
||||
|
||||
const onClick = () => {} |
||||
return ( |
||||
<> |
||||
<Card className="p-0 m-0" color="primary" style={{ borderRadius: 0, minWidth: '400px', zIndex: 300 }}> |
||||
<CardBody className="p-0" style={{ width: '100vw' }}> |
||||
<div className="swiper" style={{ minWidth: '400px' }}> |
||||
<div className="swiper-wrapper" onClick={(e) => onClick(e)}> |
||||
<swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
onClick={(e) => onClickWilayah(e)} |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<FilterAlt fontSize="medium" className="align-self-center" /> |
||||
<span className="text-xs align-self-center">Filter</span> |
||||
</Button> |
||||
</swiper-slide> |
||||
|
||||
{/* <swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<Category fontSize="medium" className="align-self-center" /> |
||||
<span className="text-xs align-self-center">Kategori</span> |
||||
</Button> |
||||
</swiper-slide> */} |
||||
<swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
onClick={(e) => { |
||||
// console.log(matoaLayers.poiMatoaNpwpLayer.wmsParams.cql_filter)
|
||||
setIsOpenPopUpPembayaran(true) |
||||
}} |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<div className="flex justify-content-around"> |
||||
<Money fontSize="medium" className="align-self-center" /> <UploadFile fontSize="medium" className="align-self-center" /> |
||||
</div> |
||||
<span className="text-xs align-self-center">Pembayaran & SPT</span> |
||||
</Button> |
||||
</swiper-slide> |
||||
<swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
onClick={(e) => onClickRatingUlasan(e)} |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<RateReview fontSize="medium" className="align-self-center" /> |
||||
<span className="text-xs align-self-center text-nowrap">Rating & Ulasan Google</span> |
||||
</Button> |
||||
</swiper-slide> |
||||
{/* <swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
onClick={(e) => onClick(e)} |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<UploadFile fontSize="medium" className="align-self-center" /> |
||||
<span className="text-xs align-self-center">SPT</span> |
||||
</Button> |
||||
</swiper-slide> */} |
||||
{/* <swiper-slide class="d-flex justify-content-center"> |
||||
<Button |
||||
onClick={(e) => onClick(e)} |
||||
style={{ borderRadius: 0 }} |
||||
tag={'button'} |
||||
className="py-50 d-flex flex-column justify-content-center align-content-center" |
||||
color="primary" |
||||
size="lg" |
||||
> |
||||
<PointOfSale fontSize="medium" className="align-self-center" /> |
||||
<span className="text-xs align-self-center">Potensi</span> |
||||
</Button> |
||||
</swiper-slide> */} |
||||
</div> |
||||
</div> |
||||
<div className="swiper-scrollbar"></div> |
||||
</CardBody> |
||||
</Card> |
||||
<div id="aaa" style={{ zIndex: 200 }}></div> |
||||
<PopUpWilayah |
||||
dataSend={dataSend} |
||||
setDataSend={setDataSend} |
||||
dataOpsi={dataOpsi} |
||||
setDataOpsi={setDataOpsi} |
||||
isOpenPopUpWilayah={isOpenPopUpWilayah} |
||||
setIsOpenPopUpWilayah={setIsOpenPopUpWilayah} |
||||
wmsRef={wmsRef} |
||||
zonaRef={zonaRef} |
||||
refFeatureBawah={refFeatureBawah} |
||||
/> |
||||
<PopUPTematikPembayaran |
||||
dataSend={dataSend} |
||||
setDataSend={setDataSend} |
||||
dataOpsi={dataOpsi} |
||||
setDataOpsi={setDataOpsi} |
||||
isOpenPopUpPembayaran={isOpenPopUpPembayaran} |
||||
setIsOpenPopUpPembayaran={setIsOpenPopUpPembayaran} |
||||
wmsRef={wmsRef} |
||||
zonaRef={zonaRef} |
||||
refFeatureBawah={refFeatureBawah} |
||||
/> |
||||
<PopUpRatingGoogle |
||||
dataSend={dataSend} |
||||
setDataSend={setDataSend} |
||||
dataOpsi={dataOpsi} |
||||
setDataOpsi={setDataOpsi} |
||||
isOpenPopUpRating={isOpenPopUpRating} |
||||
setIsOpenPopUpRating={setIsOpenPopUpRating} |
||||
wmsRef={wmsRef} |
||||
zonaRef={zonaRef} |
||||
refFeatureBawah={refFeatureBawah} |
||||
/> |
||||
</> |
||||
) |
||||
} |
||||
export default MenuBawah |
@ -0,0 +1,678 @@
|
||||
import React from 'react' |
||||
import { BottomNavigation, BottomNavigationAction, Box, Paper, Skeleton, SwipeableDrawer, styled } from '@mui/material' |
||||
import { useEffect, useRef, useState } from 'react' |
||||
import { Col, Label, Nav, NavItem, NavLink, Row, TabContent, TabPane } from 'reactstrap' |
||||
import { AutorenewOutlined, CloseOutlined } from '@mui/icons-material' |
||||
import { red } from '@mui/material/colors' |
||||
import { useDispatch } from 'react-redux' |
||||
import collect from 'collect.js' |
||||
import { useMap } from 'react-leaflet' |
||||
import L from 'leaflet' |
||||
import { Button as ButtonP } from 'primereact/button' |
||||
|
||||
const anchor = 'bottom' |
||||
const StyledBox = styled('div')(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'light' ? '#fff' : grey[800] |
||||
})) |
||||
const Item = styled(Paper)(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff', |
||||
...theme.typography.body2, |
||||
padding: theme.spacing(1), |
||||
textAlign: 'center', |
||||
color: theme.palette.text.secondary |
||||
})) |
||||
import { MultiSelect } from 'react-multi-select-component' |
||||
import Select from 'react-select' |
||||
import jquery from 'jquery' |
||||
import { isObjEmpty } from '../kytp/util' |
||||
|
||||
import { setCqlFilterWilayah, setSelectedOpsi } from '../kytp/store/PetaStore' |
||||
import { Toast } from 'primereact/toast' |
||||
import NipPerekam from './components/NipPerekam' |
||||
import NipPengampu from './components/NipPengampu' |
||||
import { matoaLayers } from './layers/overlayLayers' |
||||
|
||||
const PopUpWilayah = (props) => { |
||||
const { isOpenPopUpWilayah, setIsOpenPopUpWilayah, wmsRef, refFeatureBawah, zonaRef, dataSend, setDataSend, dataOpsi, setDataOpsi } = props |
||||
const toast = useRef() |
||||
const map = useMap() |
||||
const dispatch = useDispatch() |
||||
|
||||
const [tabActive, setTabActive] = useState('zona') |
||||
const [isTerapkan, setIsTerapkan] = useState(false) |
||||
|
||||
const [prop, setProp] = useState([]) |
||||
const [kota, setKota] = useState([]) |
||||
const [kec, setKec] = useState([]) |
||||
const [kel, setKel] = useState([]) |
||||
|
||||
const [propSelected, setPropSelected] = useState([]) |
||||
const [kotaSelected, setKotaSelected] = useState([]) |
||||
const [kecSelected, setKecSelected] = useState([]) |
||||
const [kelSelected, setKelSelected] = useState([]) |
||||
|
||||
const [kanwil, setKanwil] = useState([]) |
||||
const [kpp, setKpp] = useState([]) |
||||
const [seksi, setSeksi] = useState([]) |
||||
const [ar, setAr] = useState([]) |
||||
const [zp, setZp] = useState([]) |
||||
|
||||
const [kanwilSelected, setKanwilSelected] = useState([]) |
||||
const [kppSelected, setKppSelected] = useState([]) |
||||
const [seksiSelected, setSeksiSelected] = useState([]) |
||||
const [arSelected, setArSelected] = useState([]) |
||||
const [zpSelected, setZpSelected] = useState([]) |
||||
const toggle = (tab) => { |
||||
setTabActive(tab) |
||||
} |
||||
useEffect(() => { |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/propinsi', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
success: (data) => { |
||||
setProp(data) |
||||
} |
||||
}) |
||||
|
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/zpkanwil', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
success: (data) => { |
||||
setKanwil(data) |
||||
} |
||||
}) |
||||
}, []) |
||||
useEffect(() => { |
||||
setKota([]) |
||||
setKec([]) |
||||
setKel([]) |
||||
setKotaSelected([]) |
||||
setKecSelected([]) |
||||
setKelSelected([]) |
||||
if (propSelected && !isObjEmpty(propSelected)) { |
||||
const prop = propSelected.value |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/kota', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { prop }, |
||||
success: (data) => { |
||||
setKota(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [propSelected]) |
||||
|
||||
useEffect(() => { |
||||
setKec([]) |
||||
setKel([]) |
||||
setKecSelected([]) |
||||
setKelSelected([]) |
||||
if (kotaSelected && !isObjEmpty(kotaSelected)) { |
||||
const kota = kotaSelected.value |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/kecamatan', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { kota }, |
||||
success: (data) => { |
||||
setKec(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kotaSelected]) |
||||
|
||||
useEffect(() => { |
||||
setKel([]) |
||||
setKelSelected([]) |
||||
if (kecSelected.length && !isObjEmpty(kecSelected)) { |
||||
const kec = collect(kecSelected).pluck('value').all() |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/kelurahan', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kec }, |
||||
success: (data) => { |
||||
setKel(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kecSelected]) |
||||
|
||||
useEffect(() => { |
||||
setKpp([]) |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setZp([]) |
||||
setKppSelected(null) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
setZpSelected([]) |
||||
if (kanwilSelected && !isObjEmpty(kanwilSelected)) { |
||||
const kanwil = kanwilSelected.value |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/zpkpp', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kanwil }, |
||||
success: (data) => { |
||||
setKpp(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kanwilSelected]) |
||||
|
||||
useEffect(() => { |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setZp([]) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
setZpSelected([]) |
||||
if (kppSelected && !isObjEmpty(kppSelected)) { |
||||
const kpp = kppSelected.value |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/zpseksi', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kpp }, |
||||
success: (data) => { |
||||
setSeksi(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kppSelected]) |
||||
|
||||
useEffect(() => { |
||||
setAr([]) |
||||
setZp([]) |
||||
setArSelected([]) |
||||
setZpSelected([]) |
||||
if (seksiSelected && !isObjEmpty(seksiSelected)) { |
||||
const kpp = kppSelected.value |
||||
const seksi = collect(seksiSelected).pluck('value').all() |
||||
|
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/zpar', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kpp, seksi }, |
||||
success: (data) => { |
||||
setAr(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [seksiSelected]) |
||||
|
||||
useEffect(() => { |
||||
setZp([]) |
||||
setZpSelected([]) |
||||
if (arSelected && !isObjEmpty(arSelected)) { |
||||
const kpp = kppSelected.value |
||||
const seksi = collect(seksiSelected).pluck('value').all() |
||||
const ar = collect(arSelected).pluck('value').all() |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/ref/zpzp', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kpp, seksi, ar }, |
||||
success: (data) => { |
||||
setZp(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [arSelected]) |
||||
|
||||
const toggleDrawer = (anchor, open) => (event) => { |
||||
if (event && event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { |
||||
return |
||||
} |
||||
setIsOpenPopUpWilayah(open) |
||||
} |
||||
const toggleTab = (newVal) => { |
||||
setTabActive(newVal) |
||||
} |
||||
|
||||
const onClickReset = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
|
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
styles: 'poi_google', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
setIsOpenPopUpWilayah(false) |
||||
} |
||||
const buttonProsesOnClick = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
const opsiWilZona = tabActive |
||||
const adm4_pcode = collect(kelSelected).pluck('value').all() |
||||
const adm4_pcode2 = collect(kelSelected).pluck('value2').all() |
||||
const id_poly_zona = collect(zpSelected).pluck('value').all() |
||||
const id_poly_zona2 = collect(zpSelected).pluck('value2').all() |
||||
|
||||
switch (opsiWilZona) { |
||||
case 'wilayah': |
||||
if (adm4_pcode.length) { |
||||
dispatch(setSelectedOpsi(dataOpsi.wilayah)) |
||||
setDataSend({ opsiWilZona: dataOpsi.wilayah.key, adm4_pcode, id_poly_zona: [] }) |
||||
//ID_POLY_ZONA
|
||||
const par_kelurahan = adm4_pcode2.join("','") |
||||
const cq_filter_poi = "ADM4_PCODE in ('" + par_kelurahan + "')" |
||||
dispatch(setCqlFilterWilayah(cq_filter_poi)) |
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
style: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
style: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
|
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
style: 'poi_google', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
|
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/peta/kelurahanpoly', |
||||
type: 'post', |
||||
dataType: 'json', |
||||
data: { |
||||
adm4_pcode |
||||
}, |
||||
success: (response) => { |
||||
if (response) { |
||||
const lyr_kota = L.geoJSON(response, { |
||||
style: function (feature) { |
||||
return { |
||||
color: 'blue', |
||||
fillOpacity: 0, |
||||
weight: 2, |
||||
dashArray: '30 10', |
||||
interactive: false |
||||
} |
||||
} |
||||
}).addTo(refFeatureBawah.current) |
||||
map.fitBounds(lyr_kota.getBounds()).setZoom(map.getZoom() - 1) |
||||
setIsOpenPopUpWilayah(false) |
||||
} |
||||
} |
||||
}) |
||||
} else { |
||||
toast.current.show({ severity: 'info', summary: 'Info', detail: 'Kelurahan harus dipilih' }) |
||||
} |
||||
break |
||||
case 'zona': |
||||
if (id_poly_zona.length) { |
||||
dispatch(setSelectedOpsi(dataOpsi.zona)) |
||||
setDataSend({ opsiWilZona: dataOpsi.zona.key, adm4_pcode: [], id_poly_zona }) |
||||
//ID_POLY_ZONA
|
||||
const par_zona = id_poly_zona2.join("','") |
||||
const cq_filter_poi = "ID_POLY_ZONA in ('" + par_zona + "')" |
||||
dispatch(setCqlFilterWilayah(cq_filter_poi)) |
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
|
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
|
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
styles: 'poi_google', |
||||
cql_filter: cq_filter_poi |
||||
}) |
||||
jquery.ajax({ |
||||
url: '/engineN/kewilayahan/peta/zonapoly', |
||||
type: 'post', |
||||
dataType: 'json', |
||||
data: { |
||||
id_poly_zona |
||||
}, |
||||
success: (response) => { |
||||
if (response) { |
||||
const lyr_kota = L.geoJSON(response, { |
||||
style: function (feature) { |
||||
return { |
||||
color: 'blue', |
||||
fillOpacity: 0, |
||||
weight: 2, |
||||
dashArray: '30 10', |
||||
interactive: false |
||||
} |
||||
} |
||||
}).addTo(refFeatureBawah.current) |
||||
map.fitBounds(lyr_kota.getBounds()).setZoom(map.getZoom() - 1) |
||||
setIsOpenPopUpWilayah(false) |
||||
} |
||||
} |
||||
}) |
||||
} else { |
||||
toast.current.show({ severity: 'info', summary: 'Info', detail: 'Zona harus dipilih' }) |
||||
} |
||||
break |
||||
|
||||
default: |
||||
break |
||||
} |
||||
} |
||||
|
||||
return ( |
||||
<> |
||||
<SwipeableDrawer anchor={anchor} open={isOpenPopUpWilayah} onClose={toggleDrawer(anchor, false)} onOpen={toggleDrawer(anchor, true)}> |
||||
<Box |
||||
sx={{ |
||||
flexGrow: 1, |
||||
height: 'calc(100vh - 100px)', |
||||
width: '100%', |
||||
px: 2, |
||||
py: 2 |
||||
// height: "100%",
|
||||
// overflow: "auto"
|
||||
}} |
||||
> |
||||
<Nav tabs> |
||||
<NavItem> |
||||
<NavLink |
||||
active={tabActive === 'zona'} |
||||
onClick={() => { |
||||
toggleTab('zona') |
||||
}} |
||||
> |
||||
Zona Pengawasan |
||||
</NavLink> |
||||
</NavItem> |
||||
<NavItem> |
||||
<NavLink |
||||
active={tabActive === 'wilayah'} |
||||
onClick={() => { |
||||
toggleTab('wilayah') |
||||
}} |
||||
> |
||||
Wil. Administratif |
||||
</NavLink> |
||||
</NavItem> |
||||
|
||||
<NavItem> |
||||
<NavLink |
||||
active={tabActive === 'pengampu'} |
||||
onClick={() => { |
||||
toggleTab('pengampu') |
||||
}} |
||||
> |
||||
Pengampu |
||||
</NavLink> |
||||
</NavItem> |
||||
<NavItem> |
||||
<NavLink |
||||
active={tabActive === 'perekam'} |
||||
onClick={() => { |
||||
toggleTab('perekam') |
||||
}} |
||||
> |
||||
Perekam |
||||
</NavLink> |
||||
</NavItem> |
||||
</Nav> |
||||
<hr /> |
||||
|
||||
<TabContent className="py-50" activeTab={tabActive}> |
||||
{isTerapkan ? ( |
||||
<Row> |
||||
<Col xs="12"> |
||||
<Skeleton width={'100%'} height={'50px'} variant="rectangular" /> |
||||
</Col> |
||||
</Row> |
||||
) : ( |
||||
<> |
||||
<TabPane tabId="zona"> |
||||
<Row> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="basicInput"> |
||||
Kanwil |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih Kanwil" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKanwilSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
// defaultValue={kanwilSelected}
|
||||
value={kanwilSelected} |
||||
isClearable={false} |
||||
options={kanwil} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih KPP"> |
||||
KPP |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih KPP" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKppSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
// defaultValue={kanwilSelected}
|
||||
value={kppSelected} |
||||
isClearable={false} |
||||
options={kpp} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Seksi"> |
||||
Seksi |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={seksi} |
||||
value={seksiSelected} |
||||
onChange={(e) => { |
||||
setSeksiSelected(e) |
||||
}} |
||||
labelledBy="Pilih Seksi" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Seksi' }} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih AR"> |
||||
AR |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={ar} |
||||
value={arSelected} |
||||
onChange={(e) => { |
||||
setArSelected(e) |
||||
}} |
||||
labelledBy="Pilih AR" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih AR' }} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
<Row className="mt-2"> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Zona"> |
||||
Zona Pengawasan |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={zp} |
||||
value={zpSelected} |
||||
onChange={(e) => { |
||||
setZpSelected(e) |
||||
}} |
||||
labelledBy="Pilih Zona" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Zona' }} |
||||
/> |
||||
</Col> |
||||
<Col md="3" className="pt-2"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
</TabPane> |
||||
<TabPane tabId="wilayah"> |
||||
<Row> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="basicInput"> |
||||
Propinsi |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih Propinsi" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setPropSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
defaultValue={propSelected} |
||||
value={propSelected} |
||||
isClearable={false} |
||||
options={prop} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="basicInput"> |
||||
Kota/Kab |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih Kota/Kab" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKotaSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
defaultValue={kotaSelected} |
||||
value={kotaSelected} |
||||
isClearable={false} |
||||
options={kota} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Kecamatan"> |
||||
Kecamatan |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={kec} |
||||
value={kecSelected} |
||||
onChange={(e) => { |
||||
setKecSelected(e) |
||||
}} |
||||
labelledBy="Pilih Kecamatan" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Kecamatan' }} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Kelurahan"> |
||||
Kelurahan |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={kel} |
||||
value={kelSelected} |
||||
onChange={(e) => { |
||||
setKelSelected(e) |
||||
}} |
||||
labelledBy="Pilih Kelurahan" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Kelurahan' }} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
<Row className="mt-2"> |
||||
<Col sm="12"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
</TabPane> |
||||
<TabPane tabId="perekam"> |
||||
<NipPerekam |
||||
dataSend={dataSend} |
||||
setDataSend={setDataSend} |
||||
activeTab={tabActive} |
||||
toast={toast} |
||||
setHiddenGraphMatoa={false} |
||||
dataOpsi={dataOpsi} |
||||
setIsOpenPopUpWilayah={setIsOpenPopUpWilayah} |
||||
refFeatureBawah={refFeatureBawah} |
||||
/> |
||||
</TabPane> |
||||
<TabPane tabId="pengampu"> |
||||
<NipPengampu |
||||
dataSend={dataSend} |
||||
setDataSend={setDataSend} |
||||
activeTab={tabActive} |
||||
toast={toast} |
||||
setHiddenGraphMatoa={false} |
||||
dataOpsi={dataOpsi} |
||||
setIsOpenPopUpWilayah={setIsOpenPopUpWilayah} |
||||
refFeatureBawah={refFeatureBawah} |
||||
/> |
||||
</TabPane> |
||||
</> |
||||
)} |
||||
</TabContent> |
||||
{/* <div style={{ marginBottom: "80px" }}> |
||||
{isTerapkan ? <Skeleton height={"200px"} width={"100%"} variant="rectangular" /> : <TabelHasil setOpen={setIsOpenPopUpWilayah} />} |
||||
</div> */} |
||||
<Paper sx={{ position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 2002 }} elevation={1}> |
||||
<BottomNavigation className="justify-content-between" sx={{ width: '100%', height: '65px' }} showLabels> |
||||
{/* <BottomNavigationAction |
||||
onClick={() => btnBawahProsesOnClick()} |
||||
className="text-primary text-xl" |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Terapkan" |
||||
value="proses" |
||||
icon={<CheckCircle />} |
||||
/> */} |
||||
<BottomNavigationAction |
||||
onClick={() => onClickReset()} |
||||
className=" text-xl" |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Reset Filter" |
||||
value="clear" |
||||
icon={<AutorenewOutlined color="info" />} |
||||
/> |
||||
<BottomNavigationAction |
||||
onClick={() => setIsOpenPopUpWilayah(false)} |
||||
color={red[700]} |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Tutup" |
||||
value="close" |
||||
icon={<CloseOutlined color="warning" />} |
||||
/> |
||||
</BottomNavigation> |
||||
</Paper> |
||||
<Toast ref={toast} position="center" /> |
||||
</Box> |
||||
</SwipeableDrawer> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
export default PopUpWilayah |
@ -0,0 +1,244 @@
|
||||
import React from 'react' |
||||
import { BottomNavigation, BottomNavigationAction, Box, Paper, Skeleton, SwipeableDrawer, styled } from '@mui/material' |
||||
import { lazy, useEffect, useMemo, useRef, useState } from 'react' |
||||
import { Card, CardHeader, CardTitle, CardBody, CardText, Input, Label, Row, Col } from 'reactstrap' |
||||
|
||||
import { AutorenewOutlined, CheckCircle, Close, CloseFullscreenRounded, CloseOutlined, CloseRounded, RefreshOutlined } from '@mui/icons-material' |
||||
|
||||
import { red } from '@mui/material/colors' |
||||
import { useDispatch, useSelector } from 'react-redux' |
||||
import collect from 'collect.js' |
||||
|
||||
import { useMap } from 'react-leaflet' |
||||
|
||||
import L from 'leaflet' |
||||
import { Button as ButtonP } from 'primereact/button' |
||||
|
||||
import { MultiSelect } from 'react-multi-select-component' |
||||
import Select from 'react-select' |
||||
import jquery from 'jquery' |
||||
import { isObjEmpty } from '../kytp/util' |
||||
|
||||
import { setSelectedOpsi } from '../kytp/store/PetaStore' |
||||
import { Toast } from 'primereact/toast' |
||||
import NipPerekam from './components/NipPerekam' |
||||
import NipPengampu from './components/NipPengampu' |
||||
import { matoaLayers } from './layers/overlayLayers' |
||||
|
||||
const anchor = 'bottom' |
||||
const StyledBox = styled('div')(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'light' ? '#fff' : grey[800] |
||||
})) |
||||
const Item = styled(Paper)(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff', |
||||
...theme.typography.body2, |
||||
padding: theme.spacing(1), |
||||
textAlign: 'center', |
||||
color: theme.palette.text.secondary |
||||
})) |
||||
const PopUPTematikPembayaran = (props) => { |
||||
const { isOpenPopUpPembayaran, setIsOpenPopUpPembayaran, wmsRef, refFeatureBawah, zonaRef, dataSend, setDataSend, dataOpsi, setDataOpsi } = props |
||||
const toast = useRef() |
||||
const map = useMap() |
||||
const dispatch = useDispatch() |
||||
const storePeta = useSelector((state) => state.peta) |
||||
|
||||
const toggleDrawer = (anchor, open) => (event) => { |
||||
if (event && event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { |
||||
return |
||||
} |
||||
setIsOpenPopUpPembayaran(open) |
||||
} |
||||
|
||||
const onClickReset = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
|
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
styles: 'poi_google', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
setIsOpenPopUpPembayaran(false) |
||||
} |
||||
const buttonProsesOnClick = () => { |
||||
const warna_byr = [] |
||||
const warna_spt = [] |
||||
const bayarchecked = document.querySelectorAll('.tematik_pembayaran_checkbox:checked') |
||||
const sptchecked = document.querySelectorAll('.tematik_spt_checkbox:checked') |
||||
|
||||
bayarchecked.forEach((val, idx) => { |
||||
warna_byr.push(val.value) |
||||
}) |
||||
|
||||
sptchecked.forEach((val, idx) => { |
||||
warna_spt.push(val.value) |
||||
}) |
||||
|
||||
// STATUS_SPT_TAHUNAN_TERAKHIR
|
||||
if (bayarchecked.length) { |
||||
const par_bayar = warna_byr.join("','") |
||||
const par_spt = warna_spt.join("','") |
||||
const cq_filter_poi_bayar = "WARNA_PEMBAYARAN_THN_TERAKHIR in ('" + par_bayar + "')" |
||||
const cq_filter_poi_spt = "STATUS_SPT_TAHUNAN_TERAKHIR in ('" + par_spt + "')" |
||||
const paramExisting = storePeta.cqlFilterWilayah |
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp_bayar', |
||||
cql_filter: paramExisting + ' AND ' + cq_filter_poi_bayar + ' AND ' + cq_filter_poi_spt |
||||
// minZoom: 4
|
||||
}) |
||||
|
||||
// matoaLayers.poiMatoaNpwpNullLayer.setParams({
|
||||
// style: 'poi_matoa_npwp_bayar',
|
||||
// cql_filter: paramExisting + ' AND ' + cq_filter_poi,
|
||||
// minZoom: 4
|
||||
// })
|
||||
|
||||
// map.setZoom(8)
|
||||
setIsOpenPopUpPembayaran(false) |
||||
} else { |
||||
toast.current.show({ severity: 'info', summary: 'Info', detail: 'Rentang Pembayaran harus dipilih ' }) |
||||
} |
||||
} |
||||
return ( |
||||
<> |
||||
<SwipeableDrawer anchor={anchor} open={isOpenPopUpPembayaran} onClose={toggleDrawer(anchor, false)} onOpen={toggleDrawer(anchor, true)}> |
||||
<Box |
||||
sx={{ |
||||
flexGrow: 1, |
||||
height: '400px', |
||||
width: '100%', |
||||
overflow: 'auto', |
||||
marginBottom: '80px', |
||||
px: 2, |
||||
py: 2 |
||||
}} |
||||
> |
||||
<CardHeader className="mb-0 pb-0"> |
||||
<CardTitle className="mb-0 pb-0" tag="h4"> |
||||
Tematik Pembayaran |
||||
</CardTitle> |
||||
</CardHeader> |
||||
<CardBody> |
||||
<CardText className="mb-0 pb-0">Pilih rentang pembayaran :</CardText> |
||||
<Row className=""> |
||||
<Col sm="12"> |
||||
<div className="demo-inline-spacing border pt-25 pb-2 pl-3 "> |
||||
{Object.values(storePeta.warnaBayar).map((val, idx) => { |
||||
return ( |
||||
<div className="form-check form-check-primary " key={idx} style={{ cursor: 'pointer' }}> |
||||
<Input |
||||
style={{ cursor: 'pointer' }} |
||||
type="checkbox" |
||||
id={`primary-checkbox-${idx}`} |
||||
className="tematik_pembayaran_checkbox" |
||||
value={val.wb} |
||||
defaultChecked |
||||
/> |
||||
<Label className="form-check-label" for={`primary-checkbox-${idx}`} style={{ color: val.warna, cursor: 'pointer' }}> |
||||
{val.info} |
||||
</Label> |
||||
</div> |
||||
) |
||||
})} |
||||
</div> |
||||
</Col> |
||||
</Row> |
||||
<hr /> |
||||
<Row className=""> |
||||
<Col sm="12"> |
||||
<CardText className="mb-0 pb-0">Pilih Status SPT :</CardText> |
||||
<div className="demo-inline-spacing border pt-25 pb-2 pl-3 "> |
||||
{Object.values(storePeta.statusSPT).map((val, idx) => { |
||||
return ( |
||||
<div className="form-check form-check-primary " key={idx} style={{ cursor: 'pointer' }}> |
||||
<Input |
||||
style={{ cursor: 'pointer' }} |
||||
type="checkbox" |
||||
id={`spt-${idx}`} |
||||
className="tematik_spt_checkbox" |
||||
value={val[0].ID_STATUS_SPT} |
||||
defaultChecked |
||||
/> |
||||
<Label className="form-check-label" for={`spt-${idx}`} style={{ cursor: 'pointer' }}> |
||||
{val[0].KETERANGAN} |
||||
</Label> |
||||
</div> |
||||
) |
||||
})} |
||||
</div> |
||||
</Col> |
||||
</Row> |
||||
<Row className="mt-2"> |
||||
<Col sm="12"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
{/* <div className="form-check form-check-secondary"> |
||||
<Input type="checkbox" id="tematik_pembayaran_checkbox" defaultChecked /> |
||||
<Label className="form-check-label" for="secondary-checkbox"> |
||||
Secondary |
||||
</Label> |
||||
</div> |
||||
<div className="form-check form-check-success"> |
||||
<Input type="checkbox" id="tematik_pembayaran_checkbox" defaultChecked /> |
||||
<Label className="form-check-label" for="success-checkbox"> |
||||
Success |
||||
</Label> |
||||
</div> |
||||
<div className="form-check form-check-danger"> |
||||
<Input type="checkbox" id="tematik_pembayaran_checkbox" defaultChecked /> |
||||
<Label className="form-check-label" for="danger-checkbox"> |
||||
Danger |
||||
</Label> |
||||
</div> |
||||
<div className="form-check form-check-warning"> |
||||
<Input type="checkbox" id="warning-checkbox" defaultChecked /> |
||||
<Label className="form-check-label" for="warning-checkbox"> |
||||
Warning |
||||
</Label> |
||||
</div> |
||||
<div className="form-check form-check-info"> |
||||
<Input type="checkbox" id="info-checkbox" defaultChecked /> |
||||
<Label className="form-check-label" for="info-checkbox"> |
||||
Info |
||||
</Label> |
||||
</div> */} |
||||
</CardBody> |
||||
|
||||
<Paper sx={{ position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 2002 }} elevation={1}> |
||||
<BottomNavigation className="justify-content-between" sx={{ width: '100%', height: '65px' }} showLabels> |
||||
<BottomNavigationAction |
||||
onClick={() => onClickReset()} |
||||
className=" text-xl" |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Reset Filter" |
||||
value="clear" |
||||
icon={<AutorenewOutlined color="info" />} |
||||
/> |
||||
<BottomNavigationAction |
||||
onClick={() => setIsOpenPopUpPembayaran(false)} |
||||
color={red[700]} |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Tutup" |
||||
value="close" |
||||
icon={<CloseOutlined color="warning" />} |
||||
/> |
||||
</BottomNavigation> |
||||
</Paper> |
||||
<Toast ref={toast} position="center" /> |
||||
</Box> |
||||
</SwipeableDrawer> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
export default PopUPTematikPembayaran |
@ -0,0 +1,170 @@
|
||||
import React from 'react' |
||||
import { BottomNavigation, BottomNavigationAction, Box, Paper, Skeleton, Slider, SwipeableDrawer, styled } from '@mui/material' |
||||
import { lazy, useEffect, useMemo, useRef, useState } from 'react' |
||||
import { Card, CardHeader, CardTitle, CardBody, CardText, Input, Label, Row, Col } from 'reactstrap' |
||||
|
||||
import { AutorenewOutlined, CheckCircle, Close, CloseFullscreenRounded, CloseOutlined, CloseRounded, RefreshOutlined } from '@mui/icons-material' |
||||
|
||||
import { red } from '@mui/material/colors' |
||||
import { useDispatch, useSelector } from 'react-redux' |
||||
import collect from 'collect.js' |
||||
|
||||
import { useMap } from 'react-leaflet' |
||||
|
||||
import L from 'leaflet' |
||||
import { Button as ButtonP } from 'primereact/button' |
||||
|
||||
import { MultiSelect } from 'react-multi-select-component' |
||||
import Select from 'react-select' |
||||
import jquery from 'jquery' |
||||
import { isObjEmpty } from '../kytp/util' |
||||
|
||||
import { setSelectedOpsi } from '../kytp/store/PetaStore' |
||||
import { Toast } from 'primereact/toast' |
||||
import NipPerekam from './components/NipPerekam' |
||||
import NipPengampu from './components/NipPengampu' |
||||
import { matoaLayers } from './layers/overlayLayers' |
||||
|
||||
const anchor = 'bottom' |
||||
const StyledBox = styled('div')(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'light' ? '#fff' : grey[800] |
||||
})) |
||||
const Item = styled(Paper)(({ theme }) => ({ |
||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff', |
||||
...theme.typography.body2, |
||||
padding: theme.spacing(1), |
||||
textAlign: 'center', |
||||
color: theme.palette.text.secondary |
||||
})) |
||||
function valuetext(value) { |
||||
return `${value}` |
||||
} |
||||
const PopUpRatingGoogle = (props) => { |
||||
const { isOpenPopUpRating, setIsOpenPopUpRating, wmsRef, refFeatureBawah, zonaRef, dataSend, setDataSend, dataOpsi, setDataOpsi } = props |
||||
const toast = useRef() |
||||
const map = useMap() |
||||
const dispatch = useDispatch() |
||||
const storePeta = useSelector((state) => state.peta) |
||||
const [value, setValue] = React.useState(50) |
||||
|
||||
const handleChange = (event, newValue) => { |
||||
setValue(newValue) |
||||
} |
||||
|
||||
const toggleDrawer = (anchor, open) => (event) => { |
||||
if (event && event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { |
||||
return |
||||
} |
||||
setIsOpenPopUpRating(open) |
||||
} |
||||
|
||||
const onClickReset = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
|
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
styles: 'poi_google', |
||||
cql_filter: '(1=1)' |
||||
}) |
||||
|
||||
setIsOpenPopUpPembayaran(false) |
||||
} |
||||
const buttonProsesOnClick = () => { |
||||
const cq_filter_poi = "REVIEW >= '" + value + "'" |
||||
const paramExisting = storePeta.cqlFilterWilayah |
||||
matoaLayers.poiGoogleLayer.setParams({ |
||||
styles: 'poi_google', |
||||
cql_filter: paramExisting + ' AND ' + cq_filter_poi |
||||
// minZoom: 4
|
||||
}) |
||||
|
||||
// matoaLayers.poiMatoaNpwpNullLayer.setParams({
|
||||
// style: 'poi_matoa_npwp_bayar',
|
||||
// cql_filter: paramExisting + ' AND ' + cq_filter_poi,
|
||||
// minZoom: 4
|
||||
// })
|
||||
|
||||
// map.setZoom(8)
|
||||
setIsOpenPopUpRating(false) |
||||
} |
||||
return ( |
||||
<> |
||||
<SwipeableDrawer anchor={anchor} open={isOpenPopUpRating} onClose={toggleDrawer(anchor, false)} onOpen={toggleDrawer(anchor, true)}> |
||||
<Box |
||||
sx={{ |
||||
flexGrow: 1, |
||||
height: '400px', |
||||
width: '100%', |
||||
overflow: 'auto', |
||||
marginBottom: '80px', |
||||
px: 2, |
||||
py: 2 |
||||
}} |
||||
> |
||||
<CardHeader className="mb-0 pb-0"> |
||||
<CardTitle className="mb-0 pb-0" tag="h4"> |
||||
Filter Jumlah Ulasan Poi Google |
||||
</CardTitle> |
||||
</CardHeader> |
||||
<hr /> |
||||
<CardBody> |
||||
<CardText className="mb-0 pb-0">Seret ke kanan/kiri minimal jumlah ulasan :</CardText> |
||||
<Row className=""> |
||||
<Col sm="12" className="mt-3"> |
||||
<Slider |
||||
aria-label="Small steps" |
||||
defaultValue={100} |
||||
getAriaValueText={valuetext} |
||||
step={100} |
||||
marks |
||||
min={0} |
||||
max={10000} |
||||
valueLabelDisplay="auto" |
||||
onChange={handleChange} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
|
||||
<Row className="mt-2"> |
||||
<Col sm="12"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
</CardBody> |
||||
|
||||
<Paper sx={{ position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 2002 }} elevation={1}> |
||||
<BottomNavigation className="justify-content-between" sx={{ width: '100%', height: '65px' }} showLabels> |
||||
<BottomNavigationAction |
||||
onClick={() => onClickReset()} |
||||
className=" text-xl" |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Reset Filter" |
||||
value="clear" |
||||
icon={<AutorenewOutlined color="info" />} |
||||
/> |
||||
<BottomNavigationAction |
||||
onClick={() => setIsOpenPopUpRating(false)} |
||||
color={red[700]} |
||||
sx={{ width: '50%', maxWidth: '50% !important' }} |
||||
label="Tutup" |
||||
value="close" |
||||
icon={<CloseOutlined color="warning" />} |
||||
/> |
||||
</BottomNavigation> |
||||
</Paper> |
||||
<Toast ref={toast} position="center" /> |
||||
</Box> |
||||
</SwipeableDrawer> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
export default PopUpRatingGoogle |
@ -0,0 +1,206 @@
|
||||
import React, { useEffect, useRef, useState } from 'react' |
||||
import { MultiSelect } from 'react-multi-select-component' |
||||
import { Col, Label, Row } from 'reactstrap' |
||||
import Select from 'react-select' |
||||
import { Button as ButtonP } from 'primereact/button' |
||||
import { isObjEmpty } from '../../kytp/util' |
||||
import jquery from 'jquery' |
||||
import collect from 'collect.js' |
||||
|
||||
import { useDispatch, useSelector } from 'react-redux' |
||||
import { setSelectedOpsi } from '../../kytp/store/PetaStore' |
||||
import { matoaLayers } from '../layers/overlayLayers' |
||||
import { useMap } from 'react-leaflet' |
||||
const NipPengampu = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMatoa, dataOpsi, setIsOpenPopUpWilayah, refFeatureBawah }) => { |
||||
const map = useMap() |
||||
const dispatch = useDispatch() |
||||
const storeKpdl = useSelector((state) => state.kpdl) |
||||
|
||||
const [kanwil, setKanwil] = useState([]) |
||||
const [kpp, setKpp] = useState({}) |
||||
const [seksi, setSeksi] = useState([]) |
||||
const [ar, setAr] = useState([]) |
||||
|
||||
const [kanwilSelected, setKanwilSelected] = useState(null) |
||||
const [kppSelected, setKppSelected] = useState({}) |
||||
const [seksiSelected, setSeksiSelected] = useState([]) |
||||
const [arSelected, setArSelected] = useState([]) |
||||
const base_url = '/engineN/' |
||||
useEffect(() => { |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/kanwil', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
success: (data) => { |
||||
setKanwil(data) |
||||
} |
||||
}) |
||||
}, []) |
||||
|
||||
useEffect(() => { |
||||
setKpp([]) |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setKppSelected(null) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
if (kanwilSelected && !isObjEmpty(kanwilSelected)) { |
||||
const kanwil = kanwilSelected.value |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/kpp', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { kanwil }, |
||||
success: (data) => { |
||||
setKpp(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kanwilSelected]) |
||||
|
||||
useEffect(() => { |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
if (kppSelected && !isObjEmpty(kppSelected)) { |
||||
const kpp = kppSelected.value |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/seksi', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { kpp }, |
||||
success: (data) => { |
||||
setSeksi(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kppSelected]) |
||||
|
||||
useEffect(() => { |
||||
setAr([]) |
||||
setArSelected([]) |
||||
const seksi = collect(seksiSelected).pluck('value').all() |
||||
if (seksi.length && !isObjEmpty(seksiSelected)) { |
||||
const kpp = kppSelected.value |
||||
|
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/ar', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kpp, seksi }, |
||||
success: (data) => { |
||||
setAr(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [seksiSelected]) |
||||
const buttonProsesOnClick = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
const nip_ar_pengampu = collect(arSelected).pluck('value').all() |
||||
const nip_ar_pengampu2 = collect(arSelected).pluck('value2').all() |
||||
if (nip_ar_pengampu.length) { |
||||
dispatch(setSelectedOpsi(dataOpsi.pengampu)) |
||||
setDataSend({ opsiWilZona: dataOpsi.pengampu.key, nip_ar_pengampu }) |
||||
const par_pengampu = nip_ar_pengampu2.join("','") |
||||
const cq_filter_poi = "NIP_AR_PENGAMPU in ('" + par_pengampu + "')" |
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi, |
||||
minZoom: 4 |
||||
}) |
||||
|
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi, |
||||
minZoom: 4 |
||||
}) |
||||
|
||||
map.setZoom(8) |
||||
setIsOpenPopUpWilayah(false) |
||||
} else { |
||||
toast.current.show({ severity: 'info', summary: 'Info', detail: 'AR Pengampu harus dipilih' }) |
||||
} |
||||
} |
||||
return ( |
||||
<> |
||||
<Row> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="basicInput"> |
||||
Kanwil |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih Kanwil" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKanwilSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
// defaultValue={kanwilSelected}
|
||||
value={kanwilSelected} |
||||
isClearable={false} |
||||
options={kanwil} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih KPP"> |
||||
KPP |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih KPP" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKppSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
// defaultValue={kanwilSelected}
|
||||
value={kppSelected} |
||||
isClearable={false} |
||||
options={kpp} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Seksi"> |
||||
Seksi |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={seksi} |
||||
value={seksiSelected} |
||||
onChange={(e) => { |
||||
setSeksiSelected(e) |
||||
}} |
||||
labelledBy="Pilih Seksi" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Seksi' }} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih AR"> |
||||
AR |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={ar} |
||||
value={arSelected} |
||||
onChange={(e) => { |
||||
setArSelected(e) |
||||
}} |
||||
labelledBy="Pilih AR" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih AR' }} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
<Row className="mt-2"> |
||||
<Col sm="12"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
export default NipPengampu |
@ -0,0 +1,220 @@
|
||||
import React, { useEffect, useRef, useState } from 'react' |
||||
import { MultiSelect } from 'react-multi-select-component' |
||||
import { Col, Label, Row } from 'reactstrap' |
||||
import Select from 'react-select' |
||||
import { Button as ButtonP } from 'primereact/button' |
||||
import { isObjEmpty } from '../../kytp/util' |
||||
import jquery from 'jquery' |
||||
import collect from 'collect.js' |
||||
import { useDispatch, useSelector } from 'react-redux' |
||||
import { setSelectedOpsi } from '../../kytp/store/PetaStore' |
||||
import { matoaLayers } from '../layers/overlayLayers' |
||||
import { useMap } from 'react-leaflet' |
||||
|
||||
const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMatoa, dataOpsi, setIsOpenPopUpWilayah, refFeatureBawah }) => { |
||||
const map = useMap() |
||||
const dispatch = useDispatch() |
||||
const storeKpdl = useSelector((state) => state.kpdl) |
||||
|
||||
const base_url = '/engineN/' |
||||
|
||||
const [kanwil, setKanwil] = useState([]) |
||||
const [kpp, setKpp] = useState([]) |
||||
const [seksi, setSeksi] = useState([]) |
||||
const [ar, setAr] = useState([]) |
||||
|
||||
const [kanwilSelected, setKanwilSelected] = useState(null) |
||||
const [kppSelected, setKppSelected] = useState() |
||||
const [seksiSelected, setSeksiSelected] = useState([]) |
||||
const [arSelected, setArSelected] = useState([]) |
||||
|
||||
useEffect(() => { |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/kanwilPratama', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
success: (data) => { |
||||
setKanwil(data) |
||||
} |
||||
}) |
||||
}, []) |
||||
|
||||
useEffect(() => { |
||||
setKpp([]) |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setKppSelected(null) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
if (kanwilSelected && !isObjEmpty(kanwilSelected)) { |
||||
const kanwil = kanwilSelected.value |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/kppPratama', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { kanwil }, |
||||
success: (data) => { |
||||
setKpp(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kanwilSelected]) |
||||
|
||||
useEffect(() => { |
||||
setSeksi([]) |
||||
setAr([]) |
||||
setSeksiSelected([]) |
||||
setArSelected([]) |
||||
if (kppSelected && !isObjEmpty(kppSelected)) { |
||||
const kpp = kppSelected.value |
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/seksi', |
||||
method: 'GET', |
||||
dataType: 'json', |
||||
data: { kpp }, |
||||
success: (data) => { |
||||
setSeksi(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [kppSelected]) |
||||
|
||||
useEffect(() => { |
||||
setAr([]) |
||||
setArSelected([]) |
||||
const seksi = collect(seksiSelected).pluck('value').all() |
||||
if (seksi.length && !isObjEmpty(seksiSelected)) { |
||||
const kpp = kppSelected.value |
||||
// const seksi = collect(seksiSelected).pluck("value").all()
|
||||
|
||||
jquery.ajax({ |
||||
url: base_url + 'kewilayahan/ref/ar', |
||||
method: 'POST', |
||||
dataType: 'json', |
||||
data: { kpp, seksi }, |
||||
success: (data) => { |
||||
setAr(data) |
||||
} |
||||
}) |
||||
} |
||||
}, [seksiSelected]) |
||||
|
||||
const buttonProsesOnClick = () => { |
||||
refFeatureBawah.current.clearLayers() |
||||
const nip_ar_perekam = collect(arSelected).pluck('value').all() |
||||
const nip_ar_perekam2 = collect(arSelected).pluck('value2').all() |
||||
if (nip_ar_perekam.length) { |
||||
dispatch(setSelectedOpsi(dataOpsi.perekam)) |
||||
setDataSend({ opsiWilZona: dataOpsi.perekam.key, nip_ar_perekam }) |
||||
|
||||
const par_perekam = nip_ar_perekam2.join("','") |
||||
const cq_filter_poi = "CREATED_BY in ('" + par_perekam + "')" |
||||
matoaLayers.poiMatoaNpwpLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi, |
||||
minZoom: 4 |
||||
}) |
||||
|
||||
matoaLayers.poiMatoaNpwpNullLayer.setParams({ |
||||
styles: 'poi_matoa_npwp', |
||||
cql_filter: cq_filter_poi, |
||||
minZoom: 4 |
||||
}) |
||||
|
||||
map.setZoom(8) |
||||
setIsOpenPopUpWilayah(false) |
||||
} else { |
||||
toast.current.show({ severity: 'info', summary: 'Info', detail: 'AR Perekam harus dipilih' }) |
||||
} |
||||
} |
||||
return ( |
||||
<> |
||||
<Row> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="basicInput"> |
||||
Kanwil |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih Kanwil" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKanwilSelected(e) |
||||
}} |
||||
classNamePrefix="select" |
||||
value={kanwilSelected} |
||||
isClearable={false} |
||||
options={kanwil} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih KPP"> |
||||
KPP |
||||
</Label> |
||||
<Select |
||||
placeholder="Pilih KPP" |
||||
className="basic-single w-100" |
||||
onChange={(e) => { |
||||
setKppSelected(e) |
||||
}} |
||||
onMenuOpen={() => { |
||||
if (!kpp.length) { |
||||
return |
||||
} |
||||
}} |
||||
openMenuOnClick={() => { |
||||
if (!kpp.length) { |
||||
return |
||||
} |
||||
}} |
||||
classNamePrefix="select" |
||||
// defaultValue={kanwilSelected}
|
||||
value={kppSelected} |
||||
isClearable={false} |
||||
options={kpp} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih Seksi"> |
||||
Seksi |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={seksi} |
||||
value={seksiSelected} |
||||
onChange={(e) => { |
||||
setSeksiSelected(e) |
||||
}} |
||||
labelledBy="Pilih Seksi" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Seksi' }} |
||||
/> |
||||
</Col> |
||||
<Col md="3"> |
||||
<Label className="form-label" for="Pilih AR"> |
||||
AR Perekam |
||||
</Label> |
||||
<MultiSelect |
||||
className="me-1 w-full" |
||||
hasSelectAll={true} |
||||
debounceDuration={300} |
||||
options={ar} |
||||
value={arSelected} |
||||
onChange={(e) => { |
||||
setArSelected(e) |
||||
}} |
||||
labelledBy="Pilih AR" |
||||
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih AR' }} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
<Row className="mt-2"> |
||||
<Col sm="12"> |
||||
<ButtonP onClick={() => buttonProsesOnClick()} label="Proses" severity="" rounded className="w-10rem text-white text-base" /> |
||||
</Col> |
||||
</Row> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
export default NipPerekam |
@ -0,0 +1,164 @@
|
||||
import React from 'react' |
||||
import ReactDOMServer from 'react-dom/server' |
||||
import { Card, CardBody, CardText, Button, Label, UncontrolledTooltip, Tooltip, CardFooter } from 'reactstrap' |
||||
// import { Button as Button2 } from 'primereact/button'
|
||||
// import { Skeleton } from 'primereact/skeleton'
|
||||
import { Bookmark, Circle, CornerUpRight, Star } from 'react-feather' |
||||
import { Divider } from 'primereact/divider' |
||||
// import Rating from 'react-rating'
|
||||
// import { numberFormat } from '@utils'
|
||||
// import { Shortcut } from '@mui/icons-material'
|
||||
|
||||
import 'primereact/resources/themes/lara-light-indigo/theme.css' // theme
|
||||
import 'primereact/resources/primereact.css' // core css
|
||||
// import "primeicons/primeicons.css" // icons
|
||||
import 'primeflex/primeflex.css' |
||||
import noImage from './noImage.png' |
||||
import dayjs from 'dayjs' |
||||
import { store } from '../../kytp/store/store' |
||||
export default function ComponentPopUpNpwp(props) { |
||||
// const content = props
|
||||
// const content = data.features[0].properties
|
||||
// {
|
||||
// "alamat": "Jl. Peta Selatan Blok Pasar Kalideres No. 65",
|
||||
// "nm_kpp_zona": "KPP Pratama Jakarta Kalideres",
|
||||
// "nm_kantor_pengampu": "KPP Pratama Jakarta Kalideres",
|
||||
// "nm_perekam": "MUHAMMAD HILAL BASHORI",
|
||||
// "nm_kpp_perekam": "KPP Pratama Jakarta Jatinegara",
|
||||
// "nama_ar_mfwp": "NOVI PRIYANTI",
|
||||
// "jns_wp_mfwp": "OP NON KARYAWAN",
|
||||
// "status_wp_mfwp": "NORMAL",
|
||||
// "warna_pembayaran_thn_terakhir": "BLACK",
|
||||
// "status_spt_tahunan_terakhir": "0",
|
||||
// "merk_usaha": null,
|
||||
// "no_telp": "085640474272",
|
||||
// "creation_date": "26-JUL-24 09.18.25.000000 AM",
|
||||
// "nama_ar_zona": "ADHITYA PRIMADHA ANDI"
|
||||
// }
|
||||
const ElementReact = () => { |
||||
const petaStore = store.getState().peta |
||||
console.log(petaStore) |
||||
return ( |
||||
<> |
||||
<input type="hidden" id="uuid" value={props.UUID} /> |
||||
<div width={'200px'}> |
||||
<div style={{ width: '262px', height: '104px', overflow: 'hidden' }} className="mb-1 flex center-block border"> |
||||
<img alt="" src={noImage} style={{ maxWidth: 'inherit', maxHeight: 'inherit', height: '100px', width: 'inherit', objectFit: 'contain' }} /> |
||||
</div> |
||||
|
||||
<CardBody className="m-0 p-0 d-flex justify-content-around align-items-center"> |
||||
<div style={{ width: '190px' }}> |
||||
<h5 className="poi-name text-primary fw-bolder cursor-pointer"> {props.NAMA}</h5> |
||||
<h6 className="poi-name text-primary fw-bolder cursor-pointer"> {props.npwp}</h6> |
||||
</div> |
||||
<div style={{ width: '64px' }} className="d-flex justify-content-end text-end"> |
||||
<div className="arah"> |
||||
<Button className="btn-icon rounded-circle btn-sm" id="arah" color="primary"> |
||||
<CornerUpRight size={14} /> |
||||
</Button> |
||||
</div> |
||||
{/* <Button className="btn-icon rounded-circle btn-sm" outline color="primary"> |
||||
<Bookmark size={14} /> |
||||
</Button> */} |
||||
</div> |
||||
</CardBody> |
||||
<div className="container-next-data my-50" id="container-next-data"> |
||||
<ul className="list-unstyled" style={{ width: '262px' }}> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Merk:</span> |
||||
<span className="text-right">{props.merk_usaha ?? '-'}</span> |
||||
</li> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Alamat:</span> |
||||
<span className="text-right">{props.alamat}</span> |
||||
</li> |
||||
|
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Kontak:</span> |
||||
<span className="text-right">{props.no_telp}</span> |
||||
</li> |
||||
<hr className="m-25" /> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Zona:</span> |
||||
<span className="text-right"> |
||||
{props.nm_kpp_zona} - {props.nama_ar_zona} |
||||
</span> |
||||
</li> |
||||
{props.npwp === null ? null : ( |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Pengampu:</span> |
||||
<span className="text-right"> |
||||
{props.nm_kantor_pengampu} - {props.nama_ar_mfwp} |
||||
</span> |
||||
</li> |
||||
)} |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Perekam:</span> |
||||
<span className="text-right"> |
||||
{props.nm_kpp_perekam} - {props.nm_perekam} ({dayjs(props.creation_date).format('YYYY-MM-DD')}) |
||||
</span> |
||||
</li> |
||||
<hr className="m-25" /> |
||||
{props.npwp === null ? null : ( |
||||
<> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Jenis / Status WP:</span> |
||||
<span className="text-right"> |
||||
{props.jns_wp_mfwp} / {props.status_wp_mfwp}{' '} |
||||
</span> |
||||
</li> |
||||
<li className="mb-25 mt-25 d-flex justify-content-between align-middle"> |
||||
<span className="fw-bolder mr-1">Tematik Pembayaran:</span> |
||||
<span className="text-right"> |
||||
<> |
||||
<span className="mr-50">{petaStore.warnaBayar[props.warna_pembayaran_thn_terakhir].info}</span> |
||||
<Circle |
||||
fontSize={'1.5rem'} |
||||
fill={petaStore.warnaBayar[props.warna_pembayaran_thn_terakhir].warna} |
||||
color={petaStore.warnaBayar[props.warna_pembayaran_thn_terakhir].warna} |
||||
/> |
||||
</> |
||||
</span> |
||||
</li> |
||||
<li className="mb-25 mt-25 d-flex justify-content-between align-middle"> |
||||
<span className="fw-bolder mr-1">Tematik Pelaporan SPT:</span> |
||||
<span className="text-right"> |
||||
<> |
||||
<span className="mr-50">{petaStore.statusSPT[props.status_spt_tahunan_terakhir][0].KETERANGAN}</span> |
||||
{/* <Circle |
||||
fontSize={'1.5rem'} |
||||
fill={petaStore.warnaBayar[props.warna_pembayaran_thn_terakhir.toLowerCase()].warna} |
||||
color={petaStore.warnaBayar[props.warna_pembayaran_thn_terakhir.toLowerCase()].warna} |
||||
/> */} |
||||
</> |
||||
</span> |
||||
</li> |
||||
</> |
||||
)} |
||||
</ul> |
||||
</div> |
||||
|
||||
<div style={{ width: '100%' }}>{/* <div className="">Kategori : {content.NAMA}</div> */}</div> |
||||
<div className="arah2" id="arah2"></div> |
||||
<CardFooter className="p-0 pt-1 text-right flex justify-content-between align-items-center"> |
||||
<Button className="detail-box" outline color="primary" size="sm" title="Tutup tampilan" disabled> |
||||
{/* <Shortcut style={{ transform: 'scaleX(-1)' }} /> */} |
||||
<span className="align-middle ms-25 ">Detail </span> |
||||
</Button> |
||||
<Button className="tutup-box" outline color="primary" size="sm" title="Tutup tampilan"> |
||||
{/* <Shortcut style={{ transform: 'scaleX(-1)' }} /> */} |
||||
<span className="align-middle ms-25">Tutup</span> |
||||
</Button> |
||||
</CardFooter> |
||||
</div> |
||||
</> |
||||
) |
||||
} |
||||
return ReactDOMServer.renderToString( |
||||
<div> |
||||
<ElementReact /> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
// export default ComponentPopUpNpwp
|
@ -0,0 +1,112 @@
|
||||
import React from 'react' |
||||
import ReactDOMServer from 'react-dom/server' |
||||
import { Card, CardBody, CardText, Button, Label, UncontrolledTooltip, Tooltip, CardFooter } from 'reactstrap' |
||||
// import { Button as Button2 } from 'primereact/button'
|
||||
// import { Skeleton } from 'primereact/skeleton'
|
||||
import { Bookmark, Circle, CornerUpRight, Star } from 'react-feather' |
||||
import { Divider } from 'primereact/divider' |
||||
import Rating from 'react-rating' |
||||
// import { numberFormat } from '@utils'
|
||||
// import { Shortcut } from '@mui/icons-material'
|
||||
|
||||
import 'primereact/resources/themes/lara-light-indigo/theme.css' // theme
|
||||
import 'primereact/resources/primereact.css' // core css
|
||||
// import "primeicons/primeicons.css" // icons
|
||||
import 'primeflex/primeflex.css' |
||||
import noImage from './noImage.png' |
||||
import dayjs from 'dayjs' |
||||
import { store } from '../../kytp/store/store' |
||||
import { Shortcut } from '@mui/icons-material' |
||||
export default function ComponentPopUpPoiGoogle(props) { |
||||
const content = props |
||||
// const content = data.features[0].properties
|
||||
// {
|
||||
// "id_data": "g_5029108_090",
|
||||
// "nama": "Jasa isi Games Pc/Laptop",
|
||||
// "alamat": "Jl. Pengadegan Selatan No.10, RT.4/RW.5",
|
||||
// "category": "Video game store",
|
||||
// "nm_ar_zona": "ANNISA BALATIF",
|
||||
// "nm_kantor": "KPP Pratama Jakarta Pancoran",
|
||||
// "top_image_url": "https://lh5.googleusercontent.com/p/AF1QipPs4cUvbFaUeAnRx4zV-T543H4Ly3SoD3qh8NA=w426-h240-k-no",
|
||||
// "adm1_en": "DKI Jakarta",
|
||||
// "adm2_en": "Kota Administrasi Jakarta Selatan",
|
||||
// "adm3_en": "Pancoran",
|
||||
// "adm4_en": "Pengadegan",
|
||||
// "rating": "4",
|
||||
// "review": "4"
|
||||
// }
|
||||
const ElementReact = () => { |
||||
const petaStore = store.getState().peta |
||||
return ( |
||||
<> |
||||
<div width={'200px'}> |
||||
<div style={{ width: '262px', height: '104px', overflow: 'hidden' }} className="d-flex center-block "> |
||||
<img |
||||
alt="" |
||||
src={content.top_image_url ?? noImage} |
||||
style={{ maxWidth: 'inherit', maxHeight: 'inherit', height: '100px', width: 'inherit', objectFit: 'cover' }} |
||||
/> |
||||
</div> |
||||
|
||||
<CardBody className="m-0 p-0 d-flex justify-content-around align-items-center"> |
||||
<div style={{ width: '190px' }}> |
||||
<h5 className="poi-name text-primary fw-bolder cursor-pointer"> {content.nama}</h5> |
||||
</div> |
||||
<div style={{ width: '64px' }} className="d-flex justify-content-around text-end"> |
||||
<div className="arah"> |
||||
<Button className="btn-icon rounded-circle btn-sm" id="arah" color="primary"> |
||||
<CornerUpRight size={14} /> |
||||
</Button> |
||||
</div> |
||||
{/* <Button className="btn-icon rounded-circle btn-sm" outline color="primary"> |
||||
<Bookmark size={14} /> |
||||
</Button> */} |
||||
</div> |
||||
</CardBody> |
||||
|
||||
<div className="flex mt-1"> |
||||
<Label className="">{Number(content.rating).toLocaleString('id-ID')}</Label> |
||||
<Rating |
||||
className="px-25" |
||||
readonly |
||||
initialRating={content.rating} |
||||
direction={'ltr'} |
||||
emptySymbol={<Star size={12} fill="#babfc7" stroke="#babfc7" />} |
||||
fullSymbol={<Star size={12} fill="#ff9700" stroke="#ff9700" />} |
||||
/> |
||||
<Label className="">({Number(content.review ?? 0)} ulasan)</Label> |
||||
</div> |
||||
<div style={{ width: '100%' }}> |
||||
<div className="">Kategori : {content.category}</div> |
||||
</div> |
||||
<div className="arah2" id="arah2"></div> |
||||
<div className="container-next-data my-50" id="container-next-data"> |
||||
<ul className="list-unstyled" style={{ width: '262px' }}> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Alamat:</span> |
||||
<span className="text-right">{props.alamat}</span> |
||||
</li> |
||||
<li className="mb-25 d-flex justify-content-between"> |
||||
<span className="fw-bolder mr-1">Zona:</span> |
||||
<span className="text-right"> |
||||
{props.nm_kantor} - {props.nm_ar_zona} |
||||
</span> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<CardFooter className="pt-1 text-right"> |
||||
<Button className="tutup-box" outline color="primary" size="sm" title="Tutup tampilan"> |
||||
{/* <Shortcut style={{ transform: 'scaleX(-1)' }} /> */} |
||||
<span className="align-middle ms-25">Tutup</span> |
||||
</Button> |
||||
</CardFooter> |
||||
</div> |
||||
</> |
||||
) |
||||
} |
||||
return ReactDOMServer.renderToString( |
||||
<div> |
||||
<ElementReact /> |
||||
</div> |
||||
) |
||||
} |
@ -0,0 +1,173 @@
|
||||
import React from 'react' |
||||
import L from 'leaflet' |
||||
import { ReactDOMServer, renderToStaticMarkup } from 'react-dom/server' |
||||
import ComponentPopUpNpwp from './ComponentPopUpNpwp' |
||||
import jquery from 'jquery' |
||||
import { Label } from 'reactstrap' |
||||
import { Divider } from 'primereact/divider' |
||||
|
||||
let latitude |
||||
let longitude |
||||
|
||||
function success(position) { |
||||
latitude = position.coords.latitude |
||||
longitude = position.coords.longitude |
||||
} |
||||
|
||||
function error() { |
||||
console.log('Unable to retrieve your location') |
||||
} |
||||
|
||||
function getLocation() { |
||||
navigator.geolocation.getCurrentPosition(success, error) |
||||
} |
||||
|
||||
const onClickDirection = (koordinatAwal, KoordinatAkhir) => { |
||||
const lat1 = koordinatAwal.lat |
||||
const lng1 = koordinatAwal.lng |
||||
const lat2 = KoordinatAkhir.lat |
||||
const lng2 = KoordinatAkhir.lng |
||||
|
||||
const targetLink = `https://www.google.com/maps/dir/${lat1 ? `${lat1},${lng1}` : ''}/'${lat2},${lng2}'/` |
||||
window.open(targetLink, '_blank') |
||||
} |
||||
|
||||
L.TileLayer.MatoaNpwp = L.TileLayer.WMS.extend({ |
||||
onAdd(map) { |
||||
// Triggered when the layer is added to a map.
|
||||
// Register a click listener, then do all the upstream WMS things
|
||||
L.TileLayer.WMS.prototype.onAdd.call(this, map) |
||||
map.on('click', this.getFeatureInfo, this) |
||||
getLocation() |
||||
// map.on('move', () => console.log(this))
|
||||
// console.log(this)
|
||||
}, |
||||
onRemove(map) { |
||||
// Triggered when the layer is removed from a map.
|
||||
// Unregister a click listener, then do all the upstream WMS things
|
||||
L.TileLayer.WMS.prototype.onRemove.call(this, map) |
||||
map.off('click', this.getFeatureInfo, this) |
||||
}, |
||||
async getFeatureInfo(evt) { |
||||
// Make an AJAX request to the server and hope for the best
|
||||
const url = this.getFeatureInfoUrl(evt.latlng), |
||||
showResults = L.Util.bind(this.showGetFeatureInfo, this) |
||||
|
||||
await fetch(url) |
||||
.then((response) => response.json()) |
||||
.then((data) => { |
||||
// console.log(data)
|
||||
const err = typeof data === 'object' ? null : data |
||||
const numberReturned = data?.numberReturned |
||||
|
||||
if (numberReturned === 1) { |
||||
// showResults(err, evt.latlng, JSON.stringify(data))
|
||||
showResults(err, evt.latlng, data.features[0].properties) |
||||
// const id_md = data.features[0].properties.i
|
||||
} |
||||
if (numberReturned > 1) { |
||||
showList(err, evt.latlng, data) |
||||
} |
||||
}) |
||||
.catch((err) => { |
||||
// showResults(JSON.stringify(err))
|
||||
}) |
||||
}, |
||||
|
||||
getFeatureInfoUrl(latlng) { |
||||
// return
|
||||
// const map = useMap()
|
||||
// Construct a GetFeatureInfo request URL given a point
|
||||
const point = this._map.latLngToContainerPoint(latlng) |
||||
const size = this._map.getSize() |
||||
|
||||
// https://docs.geoserver.org/latest/en/user/services/wms/reference.html#wms-getfeatureinfo
|
||||
const params = { |
||||
request: 'GetFeatureInfo', |
||||
service: 'WMS', |
||||
crs: 'EPSG:4326', |
||||
styles: this.wmsParams.styles, |
||||
transparent: this.wmsParams.transparent, |
||||
version: this.wmsParams.version, |
||||
format: this.wmsParams.format, |
||||
bbox: this._map.getBounds().toBBoxString(), |
||||
height: size.y, |
||||
// height: this.wmsParams.height,
|
||||
width: size.x, |
||||
// width: this.wmsParams.width,
|
||||
layers: this.wmsParams.layers, |
||||
viewparams: this.wmsParams.viewparams, |
||||
cql_filter: this.wmsParams.cql_filter, |
||||
query_layers: this.wmsParams.layers, |
||||
info_format: 'application/json', |
||||
feature_count: 1 |
||||
} |
||||
|
||||
params[params.version === '1.3.0' ? 'i' : 'x'] = Math.round(point.x) |
||||
params[params.version === '1.3.0' ? 'j' : 'y'] = Math.round(point.y) |
||||
return this._url + L.Util.getParamString(params, this._url, true) |
||||
}, |
||||
|
||||
async showGetFeatureInfo(err, latlng, content) { |
||||
if (err) { |
||||
console.log(err) |
||||
} |
||||
let data = null |
||||
await jquery.ajax({ |
||||
url: '/engineN/kewilayahan/peta/matoalokasi', |
||||
type: 'post', |
||||
dataType: 'json', |
||||
data: { uuid: content.UUID }, |
||||
success: (response) => { |
||||
data = response |
||||
// console.log(response)
|
||||
} |
||||
}) |
||||
const popup = L.popup({ maxWidth: 800, minWidth: 200, namaLayer: this.wmsParams.layers }) |
||||
.setLatLng(latlng) |
||||
.setContent(ComponentPopUpNpwp({ ...content, ...data })) |
||||
.openOn(this._map) |
||||
// popup.on('popupclose', (e) => {
|
||||
// store.dispatch(setIsOpenPopUp(false))
|
||||
// console.log(e)
|
||||
// })
|
||||
|
||||
const popupTampil = popup._contentNode |
||||
const arah = popupTampil.querySelectorAll('.arah') |
||||
const poiName = popupTampil.querySelectorAll('.poi-name') |
||||
const tutupBox = popupTampil.querySelector('.tutup-box') |
||||
|
||||
// const alamat = popupTampil.querySelector('#popup-alamat')
|
||||
// const nm_kpp_zona = popupTampil.querySelector('#popup-nm_kpp_zona')
|
||||
// const nama_ar_zona = popupTampil.querySelector('#popup-nama_ar_zona')
|
||||
|
||||
// const Alamat = () => {
|
||||
// return (
|
||||
// <>
|
||||
// <Divider type="solid" />
|
||||
// <Label>{data.alamat}</Label>
|
||||
// <Label>{data.nm_kpp_zona}</Label>
|
||||
// <Label>{data.nama_ar_zona}</Label>
|
||||
// <Divider />
|
||||
// </>
|
||||
// )
|
||||
// }
|
||||
// alamat.innerHTML = renderToStaticMarkup(<Alamat />)
|
||||
|
||||
tutupBox.addEventListener('click', () => { |
||||
popup.close() |
||||
}) |
||||
|
||||
arah[0].addEventListener('click', () => { |
||||
onClickDirection({ lat: latitude ?? '', lng: longitude ?? '' }, { lat: content.GEO_LOK_LAT, lng: content.GEO_LOK_LING }) |
||||
}) |
||||
|
||||
poiName[0].addEventListener('click', () => { |
||||
// onClickPoiName(id_md)
|
||||
}) |
||||
} |
||||
}) |
||||
|
||||
L.tileLayer.matoaNpwp = function (url, options) { |
||||
return new L.TileLayer.MatoaNpwp(url, options) |
||||
} |
@ -0,0 +1,150 @@
|
||||
import React from 'react' |
||||
import L from 'leaflet' |
||||
import jquery from 'jquery' |
||||
|
||||
import ComponentPopUpPoiGoogle from './ComponentPopUpPoiGoogle' |
||||
|
||||
let latitude |
||||
let longitude |
||||
|
||||
function success(position) { |
||||
latitude = position.coords.latitude |
||||
longitude = position.coords.longitude |
||||
} |
||||
|
||||
function error() { |
||||
console.log('Unable to retrieve your location') |
||||
} |
||||
|
||||
function getLocation() { |
||||
navigator.geolocation.getCurrentPosition(success, error) |
||||
} |
||||
|
||||
const onClickDirection = (koordinatAwal, KoordinatAkhir) => { |
||||
const lat1 = koordinatAwal.lat |
||||
const lng1 = koordinatAwal.lng |
||||
const lat2 = KoordinatAkhir.lat |
||||
const lng2 = KoordinatAkhir.lng |
||||
|
||||
const targetLink = `https://www.google.com/maps/dir/${lat1 ? `${lat1},${lng1}` : ''}/'${lat2},${lng2}'/` |
||||
window.open(targetLink, '_blank') |
||||
} |
||||
|
||||
L.TileLayer.PoiGoogle = L.TileLayer.WMS.extend({ |
||||
onAdd(map) { |
||||
// Triggered when the layer is added to a map.
|
||||
// Register a click listener, then do all the upstream WMS things
|
||||
L.TileLayer.WMS.prototype.onAdd.call(this, map) |
||||
map.on('click', this.getFeatureInfo, this) |
||||
getLocation() |
||||
// map.on('move', () => console.log(this))
|
||||
// console.log(this)
|
||||
}, |
||||
onRemove(map) { |
||||
// Triggered when the layer is removed from a map.
|
||||
// Unregister a click listener, then do all the upstream WMS things
|
||||
L.TileLayer.WMS.prototype.onRemove.call(this, map) |
||||
map.off('click', this.getFeatureInfo, this) |
||||
}, |
||||
async getFeatureInfo(evt) { |
||||
// Make an AJAX request to the server and hope for the best
|
||||
const url = this.getFeatureInfoUrl(evt.latlng), |
||||
showResults = L.Util.bind(this.showGetFeatureInfo, this) |
||||
|
||||
await fetch(url) |
||||
.then((response) => response.json()) |
||||
.then((data) => { |
||||
// console.log(data)
|
||||
const err = typeof data === 'object' ? null : data |
||||
const numberReturned = data?.numberReturned |
||||
|
||||
if (numberReturned === 1) { |
||||
// showResults(err, evt.latlng, JSON.stringify(data))
|
||||
showResults(err, evt.latlng, data.features[0].properties) |
||||
// const id_md = data.features[0].properties.i
|
||||
} |
||||
if (numberReturned > 1) { |
||||
showList(err, evt.latlng, data) |
||||
} |
||||
}) |
||||
.catch((err) => { |
||||
// showResults(JSON.stringify(err))
|
||||
}) |
||||
}, |
||||
|
||||
getFeatureInfoUrl(latlng) { |
||||
// return
|
||||
// const map = useMap()
|
||||
// Construct a GetFeatureInfo request URL given a point
|
||||
const point = this._map.latLngToContainerPoint(latlng) |
||||
const size = this._map.getSize() |
||||
|
||||
// https://docs.geoserver.org/latest/en/user/services/wms/reference.html#wms-getfeatureinfo
|
||||
const params = { |
||||
request: 'GetFeatureInfo', |
||||
service: 'WMS', |
||||
crs: 'EPSG:4326', |
||||
styles: this.wmsParams.styles, |
||||
transparent: this.wmsParams.transparent, |
||||
version: this.wmsParams.version, |
||||
format: this.wmsParams.format, |
||||
bbox: this._map.getBounds().toBBoxString(), |
||||
height: size.y, |
||||
// height: this.wmsParams.height,
|
||||
width: size.x, |
||||
// width: this.wmsParams.width,
|
||||
layers: this.wmsParams.layers, |
||||
viewparams: this.wmsParams.viewparams, |
||||
cql_filter: this.wmsParams.cql_filter, |
||||
query_layers: this.wmsParams.layers, |
||||
info_format: 'application/json', |
||||
feature_count: 1 |
||||
} |
||||
|
||||
params[params.version === '1.3.0' ? 'i' : 'x'] = Math.round(point.x) |
||||
params[params.version === '1.3.0' ? 'j' : 'y'] = Math.round(point.y) |
||||
return this._url + L.Util.getParamString(params, this._url, true) |
||||
}, |
||||
|
||||
async showGetFeatureInfo(err, latlng, content) { |
||||
if (err) { |
||||
console.log(err) |
||||
} |
||||
let data = null |
||||
await jquery.ajax({ |
||||
url: '/engineN/kewilayahan/peta/poigoogle', |
||||
type: 'post', |
||||
dataType: 'json', |
||||
data: { id_data: content.ID_DATA }, |
||||
success: (response) => { |
||||
data = response |
||||
// console.log(response)
|
||||
} |
||||
}) |
||||
const popup = L.popup({ maxWidth: 800, minWidth: 200, namaLayer: this.wmsParams.layers }) |
||||
.setLatLng(latlng) |
||||
.setContent(ComponentPopUpPoiGoogle({ ...content, ...data })) |
||||
.openOn(this._map) |
||||
|
||||
const popupTampil = popup._contentNode |
||||
const arah = popupTampil.querySelectorAll('.arah') |
||||
const poiName = popupTampil.querySelectorAll('.poi-name') |
||||
const tutupBox = popupTampil.querySelector('.tutup-box') |
||||
|
||||
tutupBox.addEventListener('click', () => { |
||||
popup.close() |
||||
}) |
||||
|
||||
arah[0].addEventListener('click', () => { |
||||
onClickDirection({ lat: latitude ?? '', lng: longitude ?? '' }, { lat: content.GEO_LOK_LAT, lng: content.GEO_LOK_LING }) |
||||
}) |
||||
|
||||
poiName[0].addEventListener('click', () => { |
||||
// onClickPoiName(id_md)
|
||||
}) |
||||
} |
||||
}) |
||||
|
||||
L.tileLayer.poiGoogle = function (url, options) { |
||||
return new L.TileLayer.PoiGoogle(url, options) |
||||
} |
@ -0,0 +1,25 @@
|
||||
import React, { useEffect } from 'react' |
||||
import L from 'leaflet' |
||||
import { render } from 'react-dom' |
||||
|
||||
export const useRenderPopup = (props) => { |
||||
const container = L.DomUtil.create('div') |
||||
// const dispatch = useAppDispatch()
|
||||
useEffect(() => { |
||||
render( |
||||
<div> |
||||
<p>mbuh</p> |
||||
<a |
||||
onClick={() => { |
||||
console.log('abc') |
||||
}} |
||||
> |
||||
sdjsljf |
||||
</a> |
||||
{/* <a onClick={() => dispatch(setDevice(props.geoJsonPoint.properties))}></a> */} |
||||
</div>, |
||||
container |
||||
) |
||||
}, []) |
||||
return container |
||||
} |
After Width: | Height: | Size: 6.0 KiB |
@ -0,0 +1,150 @@
|
||||
import React, { useEffect, useRef } from 'react' |
||||
import ReactDOMServer from 'react-dom/server' |
||||
import { createTileLayerComponent, updateGridLayer } from '@react-leaflet/core' |
||||
import L, { tileLayer } from 'leaflet' |
||||
import isObject from 'lodash/isObject' |
||||
import isFunction from 'lodash/isFunction' |
||||
import isString from 'lodash/isString' |
||||
import isEmpty from 'lodash/isEmpty' |
||||
import clone from 'lodash/clone' |
||||
import cloneDeep from 'lodash/cloneDeep' |
||||
import extend from 'lodash/extend' |
||||
import merge from 'lodash/merge' |
||||
import has from 'lodash/has' |
||||
import find from 'lodash/find' |
||||
import 'leaflet.vectorgrid' |
||||
import '../generalWms/L.VectorGrid.VectorPoi' |
||||
import '../generalWms/L.TileLayer.GeneralWMS' |
||||
import '../generalWms/L.TileLayer.MatoaNpwp' |
||||
import '../generalWms/L.TileLayer.PoiGoogle' |
||||
// import { Popup, useMap } from 'react-leaflet'
|
||||
// import { Button, Col, Row } from 'reactstrap'
|
||||
|
||||
const style = { |
||||
kpdl_npwp_tidak_valid: { |
||||
fillColor: '#3388ff', |
||||
color: '#f20e93', |
||||
fillOpacity: 1, |
||||
opacity: 1, |
||||
radius: 7, |
||||
fill: true, |
||||
zIndex: 100, |
||||
getFeatureId: function (f) { |
||||
return f.properties.UUID |
||||
} |
||||
}, |
||||
kpdl_poi_google: { |
||||
fillColor: '#b30e3d', |
||||
color: '#da165a', |
||||
fillOpacity: 1, |
||||
opacity: 1, |
||||
radius: 7, |
||||
fill: true, |
||||
zIndex: 100, |
||||
getFeatureId: function (f) { |
||||
return f.properties.UUID |
||||
} |
||||
} |
||||
} |
||||
|
||||
const parameterPeta = (id, layername) => { |
||||
return { |
||||
id: id, |
||||
url: '/engineN/geoserver/wms', |
||||
wmsParams: { |
||||
request: 'GetMap', |
||||
service: 'WMS', |
||||
crs: 'EPSG:3857', |
||||
styles: '', |
||||
transparent: 'TRUE', |
||||
version: '1.3.0', |
||||
format: 'application/vnd.mapbox-vector-tile', |
||||
layers: layername, |
||||
width: 256, |
||||
height: 256, |
||||
cql_filter: "'1=1'", |
||||
// query_layers: 'matoa:kpdl_npwp_tidak_valid',
|
||||
tiled: 'FALSE' |
||||
}, |
||||
interactive: true, |
||||
type: 'protobuf', |
||||
rendererFactory: L.svg.tile, |
||||
vectorTileLayerStyles: style |
||||
} |
||||
} |
||||
|
||||
const parameterPetaWms = (id, layername, style, minzoom) => { |
||||
return { |
||||
id: id, |
||||
url: '/engineN/geoserver/wms', |
||||
wmsParams: { |
||||
request: 'GetMap', |
||||
service: 'WMS', |
||||
styles: style, |
||||
transparent: 'TRUE', |
||||
version: '1.1.0', |
||||
format: 'image/png', |
||||
layers: layername, |
||||
maxZoom: 23, |
||||
minZoom: minzoom ?? 5, |
||||
cql_filter: '(1=1)' |
||||
} |
||||
} |
||||
} |
||||
|
||||
//layer poi google
|
||||
const poiGoogleParam = parameterPetaWms(1, 'matoa:kpdl_poi_google', 'poi_google', 10) |
||||
const poiGoogleLayer = L.tileLayer.poiGoogle(poiGoogleParam.url, poiGoogleParam.wmsParams) |
||||
|
||||
//layer npwp tidak valid
|
||||
const npwpInvalidParam = parameterPeta(2, 'matoa:kpdl_npwp_tidak_valid', 'poi_matoa_npwp') |
||||
const npwpInvalidlayer = L.vectorGrid.vectorpoi(npwpInvalidParam.url, npwpInvalidParam) |
||||
|
||||
//layer poi Matoa BerNPWP (Hijau)
|
||||
const poiMatoaNpwpParam = parameterPetaWms(3, 'matoa:kpdl_npwp_valid', 'poi_matoa_npwp', 6) |
||||
const poiMatoaNpwpLayer = new L.tileLayer.matoaNpwp(poiMatoaNpwpParam.url, poiMatoaNpwpParam.wmsParams) |
||||
|
||||
//layer poi Matoa NonNPWP (Orange /Kuning)
|
||||
const poiMatoaNpwpNullParam = parameterPetaWms(4, 'matoa:kpdl_npwp_null', 'poi_matoa_npwp_null', 4) |
||||
const poiMatoaNpwpNullLayer = L.tileLayer.matoaNpwp(poiMatoaNpwpNullParam.url, poiMatoaNpwpNullParam.wmsParams) |
||||
|
||||
//action
|
||||
|
||||
npwpInvalidlayer.on('click', (e) => { |
||||
console.log(e) |
||||
}) |
||||
|
||||
export const matoaLayers = { |
||||
npwpInvalidlayer, |
||||
poiGoogleLayer, |
||||
poiMatoaNpwpLayer, |
||||
poiMatoaNpwpNullLayer |
||||
} |
||||
|
||||
export const overlaysTree = [ |
||||
{ |
||||
label: '<span style="padding-left:20px" class="text-center center text-sm">Poi Google</span>' |
||||
}, |
||||
{ |
||||
label: 'Poi Google', |
||||
layer: matoaLayers.poiGoogleLayer |
||||
}, |
||||
{ |
||||
label: 'POI MATOA', |
||||
selectAllCheckbox: true, |
||||
children: [ |
||||
{ |
||||
label: 'berNPWP', |
||||
layer: matoaLayers.poiMatoaNpwpLayer |
||||
}, |
||||
{ |
||||
label: 'Non NPWP', |
||||
layer: matoaLayers.poiMatoaNpwpNullLayer |
||||
} |
||||
// {
|
||||
// label: 'Matoa NPWP invalid',
|
||||
// layer: matoaLayers.npwpInvalidlayer
|
||||
// }
|
||||
] |
||||
} |
||||
] |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue