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
@ -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",
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -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