Merge branch 'iipbs/common/main' into iipbs/fo/dev
This commit is contained in:
@@ -165,7 +165,7 @@ export default function LineBarchart({
|
||||
{chartTitle}
|
||||
</div>
|
||||
) : null}
|
||||
<div className="h-[calc(100%-42px)] flex justify-center">
|
||||
<div className="h-[calc(100%-42px)] w-[calc(100%-40px)] ">
|
||||
<ChartContainer config={chartConfig ?? {}} className="h-full w-full">
|
||||
<ComposedChart
|
||||
data={chartData}
|
||||
|
||||
@@ -65,7 +65,7 @@ const CustomTooltip = ({ active, payload, label }: { active?: boolean; payload?:
|
||||
return (
|
||||
<div className="w-[180px] rounded bg-white p-2.5 shadow-[0px_2px_10px_rgba(0,0,0,0.2)]">
|
||||
<p className="text-[12px] font-bold m-3">{label}</p>
|
||||
{payload.map((item, index) => (
|
||||
{payload.filter(item => item.value != null && String(item.value) != 'NaN' && item.value != undefined).map((item, index) => (
|
||||
<div key={index} style={{ marginTop: "10px", display: "flex", alignItems: "center", gap: "8px" }}>
|
||||
{/* 색상 박스 추가 (범례 색상과 동일) */}
|
||||
<div style={{ width: "10px", height: "10px", backgroundColor: item.color, borderRadius: "50%" }}></div>
|
||||
@@ -267,6 +267,7 @@ export default function Linechart({
|
||||
type="linear"
|
||||
strokeWidth={2}
|
||||
dot={false}
|
||||
connectNulls={true}
|
||||
name={String(config?.label || "X축")}
|
||||
stroke={config?.color}
|
||||
/>
|
||||
|
||||
@@ -597,40 +597,63 @@ GisOlLayer.prototype = {
|
||||
const tileSize = 256; // 기본 타일 크기
|
||||
return Math.ceil(Math.log2(maxResolution / (cameraHeight / tileSize)));
|
||||
},
|
||||
ensureSearchLayer: function () {
|
||||
ensureSearchLayer: function (option) {
|
||||
let layer = this.searchLayer;
|
||||
|
||||
if (!layer) {
|
||||
layer = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
let source;
|
||||
|
||||
try {
|
||||
if (option.cmncNm == 'bbox') {
|
||||
source = this.getVectorSourceBbox(option);
|
||||
} else {
|
||||
source = this.getVectorSourceAll(option);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(option);
|
||||
}
|
||||
|
||||
layer = new VectorImageLayer({
|
||||
...option,
|
||||
id: 'search-layer',
|
||||
source: source,
|
||||
zIndex: 9999
|
||||
});
|
||||
layer.setStyle(this.gisStyle.getLayerStyleFunction(layer, option));
|
||||
|
||||
let map = GisApp.Module.core.map;
|
||||
map.addLayer(layer);
|
||||
|
||||
this.searchLayer = layer;
|
||||
}
|
||||
return layer;
|
||||
},
|
||||
clearSearchLayer: function () {
|
||||
const layer = this.ensureSearchLayer();
|
||||
clearSearchLayer: function (option) {
|
||||
const layer = this.ensureSearchLayer(option);
|
||||
layer.getSource().clear(true);
|
||||
|
||||
if (this.searchLayer) {
|
||||
GisApp.Module.core.map.removeLayer(this.searchLayer);
|
||||
this.searchLayer = null;
|
||||
}
|
||||
},
|
||||
showSearchResultsFromGeoJSON: function (lyrTyNm, featureId) {
|
||||
const layer = this.ensureSearchLayer();
|
||||
|
||||
// 이전 검색결과는 깨끗이
|
||||
const prev = layer.getSource();
|
||||
if (prev) prev.clear(true);
|
||||
|
||||
//레이어 타입 설정(point, line 등. 이걸 style에서 사용)
|
||||
const layerCode = GisApp.layerCode;
|
||||
const matched = Object.values(layerCode).find(obj => obj.lyrTyNm === lyrTyNm);
|
||||
// 이전 검색 레이어 완전히 제거
|
||||
this.clearSearchLayer(matched);
|
||||
// 새로운 검색 레이어 생성
|
||||
const layer = this.ensureSearchLayer(matched);
|
||||
layer.set("gobjTy", matched.gobjTy);
|
||||
|
||||
// 새 소스 만들기
|
||||
const source = this.getFeatureSourceFromGeoserver(lyrTyNm, featureId);
|
||||
const source = this.getFeatureSourceFromGeoserver(lyrTyNm, featureId, matched);
|
||||
|
||||
// 1) 로드 완료시 extent 맞추기
|
||||
const onLoadEnd = () => {
|
||||
if (Object.keys(source.nullGeometryFeatures_).length > 0) alert('해당 시설의 위치 정보가 없습니다.');
|
||||
|
||||
const feats = source.getFeatures();
|
||||
if (feats && feats.length > 0) {
|
||||
const select = GisApp.Module.select;
|
||||
@@ -665,12 +688,13 @@ GisOlLayer.prototype = {
|
||||
* @param {*} featureId
|
||||
* @returns
|
||||
*/
|
||||
getFeatureSourceFromGeoserver: function (lyrTyNm, featureId) {
|
||||
getFeatureSourceFromGeoserver: function (lyrTyNm, featureId, option) {
|
||||
|
||||
const typeName = this.storageNm + lyrTyNm;
|
||||
const srsName = GisApp.TO_PROJ;
|
||||
const baseUrl = GisApp.GEOSERVER_URL;
|
||||
const source = new VectorSource({
|
||||
...option,
|
||||
format: new GeoJSON(),
|
||||
url: () => {
|
||||
const params = new URLSearchParams({
|
||||
@@ -695,13 +719,14 @@ GisOlLayer.prototype = {
|
||||
* @param {Array|string} featureIds 피처 ID 배열 또는 단일 ID
|
||||
*/
|
||||
showMultipleSearchResultsFromGeoJSON: function (lyrTyNm, featureIds) {
|
||||
const layer = this.ensureSearchLayer();
|
||||
|
||||
const prev = layer.getSource();
|
||||
if (prev) prev.clear(true);
|
||||
|
||||
const layerCode = GisApp.layerCode;
|
||||
const matched = Object.values(layerCode).find(obj => obj.lyrTyNm === lyrTyNm);
|
||||
|
||||
// 이전 검색 레이어 완전히 제거
|
||||
this.clearSearchLayer(matched);
|
||||
// 새로운 검색 레이어 생성
|
||||
const layer = this.ensureSearchLayer(matched);
|
||||
layer.set("gobjTy", matched.gobjTy);
|
||||
|
||||
const source = this.getMultiFeatureSourceFromGeoserver(lyrTyNm, featureIds);
|
||||
|
||||
@@ -284,6 +284,7 @@ GisOlSelect.prototype = {
|
||||
selectedFeatures.forEach(feature => {
|
||||
selectedFeatures.remove(feature);
|
||||
});
|
||||
selectedFeatures.clear();
|
||||
},
|
||||
/**
|
||||
* SELECT 이벤트 활성화
|
||||
|
||||
@@ -30,6 +30,7 @@ type UiTableProps = {
|
||||
boldArray?: number[];
|
||||
resetSelection?: boolean;
|
||||
index?: number;
|
||||
curPage?: number;
|
||||
headButton?: React.ReactNode | undefined;
|
||||
};
|
||||
|
||||
@@ -54,9 +55,10 @@ export function UiTable({
|
||||
boldArray = [],
|
||||
resetSelection = false,
|
||||
index = -1,
|
||||
curPage = 1,
|
||||
headButton = undefined,
|
||||
}: UiTableProps) {
|
||||
const [cur, setCur] = useState<number>(1);
|
||||
const [cur, setCur] = useState<number>(curPage);
|
||||
const [idx, setIdx] = useState<number>(index);
|
||||
const [headerHeight, setHeaderHeight] = useState<number>(0);
|
||||
const headerRef = useRef<HTMLTableSectionElement>(null);
|
||||
@@ -84,6 +86,10 @@ export function UiTable({
|
||||
setIdx(index);
|
||||
}, [index])
|
||||
|
||||
useEffect(() => {
|
||||
setCur(curPage);
|
||||
}, [curPage])
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
setCur(page);
|
||||
onPageChange(page);
|
||||
|
||||
Reference in New Issue
Block a user