parent
85f94a5070
commit
e86255756a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,16 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg"/>
|
||||
<link href="/favicon.ico" rel="icon"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>PostNet by Spatial</title>
|
||||
<script type="module" crossorigin src="/assets/index.24e33a70.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.9d2c87bd.css">
|
||||
<script crossorigin src="/assets/index.297e7fbd.js" type="module"></script>
|
||||
<link href="/assets/index.ca3dcc1b.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
import { Layer } from "react-map-gl";
|
||||
import { cancelledPointLayer } from "./layers-config";
|
||||
import { useLayersVisibility } from "../../stores/useLayersVisibility";
|
||||
import { STATUSES } from "../../config";
|
||||
import { useRegionFilterExpression } from "./useRegionFilterExpression";
|
||||
import { LAYER_IDS } from "./constants";
|
||||
|
||||
const statusExpression = ["==", ["get", "status"], STATUSES.cancelled];
|
||||
|
||||
export const CancelledPoints = () => {
|
||||
const { isVisible } = useLayersVisibility();
|
||||
const regionFilterExpression = useRegionFilterExpression();
|
||||
|
||||
const filter = regionFilterExpression
|
||||
? ["all", statusExpression, regionFilterExpression]
|
||||
: statusExpression;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layer
|
||||
{...cancelledPointLayer}
|
||||
id={LAYER_IDS.cancelled}
|
||||
source={"points"}
|
||||
source-layer={"public.service_placementpoint"}
|
||||
layout={{
|
||||
visibility: isVisible[LAYER_IDS.cancelled] ? "visible" : "none",
|
||||
}}
|
||||
filter={filter}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,22 @@
|
||||
import { Layer } from "react-map-gl";
|
||||
import { otherPostamatesLayer } from "./layers-config";
|
||||
import { useLayersVisibility } from "../../stores/useLayersVisibility";
|
||||
import { LAYER_IDS } from "./constants";
|
||||
|
||||
export const OtherPostamates = () => {
|
||||
const { isVisible } = useLayersVisibility();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layer
|
||||
{...otherPostamatesLayer}
|
||||
id={LAYER_IDS.other}
|
||||
source={"rivals"}
|
||||
source-layer={"public.service_rivals"}
|
||||
layout={{
|
||||
visibility: isVisible[LAYER_IDS.other] ? "visible" : "none",
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,22 @@
|
||||
import { Layer } from "react-map-gl";
|
||||
import { pvzPointLayer } from "./layers-config";
|
||||
import { useLayersVisibility } from "../../stores/useLayersVisibility";
|
||||
import { LAYER_IDS } from "./constants";
|
||||
|
||||
export const PVZ = () => {
|
||||
const { isVisible } = useLayersVisibility();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layer
|
||||
{...pvzPointLayer}
|
||||
id={LAYER_IDS.pvz}
|
||||
source={"rivals"}
|
||||
source-layer={"public.service_rivals"}
|
||||
layout={{
|
||||
visibility: isVisible[LAYER_IDS.pvz] ? "visible" : "none",
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -1,36 +1,58 @@
|
||||
import { Title } from "../../components/Title";
|
||||
import { useLayersVisibility } from "../../stores/useLayersVisibility";
|
||||
import { useMode } from "../../stores/useMode";
|
||||
import Checkbox from "antd/es/checkbox/Checkbox";
|
||||
import { MODES } from "../../config";
|
||||
import { LAYER_IDS } from "../Layers/constants";
|
||||
|
||||
export const LayersVisibility = () => {
|
||||
const { toggleVisibility, isVisible } = useLayersVisibility();
|
||||
const { mode } = useMode();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Title text={"Слои"} className={"mb-1"} />
|
||||
<div className={"space-y-1 flex flex-col"}>
|
||||
{/*{mode === MODES.INITIAL && (*/}
|
||||
{/* <Checkbox*/}
|
||||
{/* onChange={() => toggleVisibility(LAYER_IDS.initial)}*/}
|
||||
{/* checked={isVisible[LAYER_IDS.initial]}*/}
|
||||
{/* >*/}
|
||||
{/* Локации к рассмотрению*/}
|
||||
{/* </Checkbox>*/}
|
||||
{/*)}*/}
|
||||
|
||||
{/*{mode === MODES.WORKING && (*/}
|
||||
{/* <>*/}
|
||||
{/* <Checkbox*/}
|
||||
{/* className={"!ml-0"}*/}
|
||||
{/* onChange={() => toggleVisibility(LAYER_IDS.working)}*/}
|
||||
{/* checked={isVisible[LAYER_IDS.working]}*/}
|
||||
{/* >*/}
|
||||
{/* Работает*/}
|
||||
{/* </Checkbox>*/}
|
||||
{/* </>*/}
|
||||
{/*)}*/}
|
||||
</div>
|
||||
<div className={"space-y-1 flex flex-col"}>
|
||||
{mode === MODES.INITIAL && (
|
||||
<>
|
||||
<Checkbox
|
||||
className={"!ml-0"}
|
||||
onChange={() => toggleVisibility(LAYER_IDS.working)}
|
||||
checked={isVisible[LAYER_IDS.working]}
|
||||
>
|
||||
Работающие постаматы
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
className={"!ml-0"}
|
||||
onChange={() => toggleVisibility(LAYER_IDS.cancelled)}
|
||||
checked={isVisible[LAYER_IDS.cancelled]}
|
||||
>
|
||||
Отмененные локации
|
||||
</Checkbox>
|
||||
</>
|
||||
)}
|
||||
<Checkbox
|
||||
className={"!ml-0"}
|
||||
onChange={() => toggleVisibility(LAYER_IDS.pvz)}
|
||||
checked={isVisible[LAYER_IDS.pvz]}
|
||||
>
|
||||
ПВЗ
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
className={"!ml-0"}
|
||||
onChange={() => toggleVisibility(LAYER_IDS.other)}
|
||||
checked={isVisible[LAYER_IDS.other]}
|
||||
>
|
||||
Постаматы прочих сетей
|
||||
</Checkbox>
|
||||
{/*{mode === MODES.WORKING && (*/}
|
||||
{/* <>*/}
|
||||
{/* <Checkbox*/}
|
||||
{/* className={"!ml-0"}*/}
|
||||
{/* onChange={() => toggleVisibility(LAYER_IDS.working)}*/}
|
||||
{/* checked={isVisible[LAYER_IDS.working]}*/}
|
||||
{/* >*/}
|
||||
{/* Работает*/}
|
||||
{/* </Checkbox>*/}
|
||||
{/* </>*/}
|
||||
{/*)}*/}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
import { Select } from "antd";
|
||||
import { STATUS_LABEL_MAPPER, STATUSES } from "../config";
|
||||
|
||||
const statusOptions = [
|
||||
{ label: STATUS_LABEL_MAPPER[STATUSES.initial], value: STATUSES.initial },
|
||||
{ label: STATUS_LABEL_MAPPER[STATUSES.approve], value: STATUSES.approve },
|
||||
{ label: STATUS_LABEL_MAPPER[STATUSES.working], value: STATUSES.working },
|
||||
{ label: STATUS_LABEL_MAPPER[STATUSES.cancelled], value: STATUSES.cancelled },
|
||||
];
|
||||
|
||||
export const StatusSelect = ({ value, onChange, disabled }) => {
|
||||
const handleClick = (e) => e.stopPropagation();
|
||||
|
||||
const handleChange = (value) => {
|
||||
onChange(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<Select
|
||||
style={{
|
||||
width: 250,
|
||||
}}
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
options={statusOptions}
|
||||
disabled={disabled}
|
||||
placeholder="Выберите статус"
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Loading…
Reference in new issue