|
|
|
@ -73,12 +73,13 @@ const PAGE_SIZE = 30;
|
|
|
|
const useTableData = (page) => {
|
|
|
|
const useTableData = (page) => {
|
|
|
|
const [pageSize, setPageSize] = useState(PAGE_SIZE);
|
|
|
|
const [pageSize, setPageSize] = useState(PAGE_SIZE);
|
|
|
|
const { filters } = useFilters();
|
|
|
|
const { filters } = useFilters();
|
|
|
|
const { prediction, status, categories } = filters;
|
|
|
|
const { prediction, status, categories, region } = filters;
|
|
|
|
|
|
|
|
const { selection } = usePointSelection();
|
|
|
|
const { clickedPointConfig } = useClickedPointConfig();
|
|
|
|
const { clickedPointConfig } = useClickedPointConfig();
|
|
|
|
const [finalData, setFinalData] = useState();
|
|
|
|
const [finalData, setFinalData] = useState();
|
|
|
|
|
|
|
|
|
|
|
|
const { data } = useQuery(
|
|
|
|
const { data } = useQuery(
|
|
|
|
["table", page, filters],
|
|
|
|
["table", page, filters, selection],
|
|
|
|
async () => {
|
|
|
|
async () => {
|
|
|
|
const params = new URLSearchParams({
|
|
|
|
const params = new URLSearchParams({
|
|
|
|
page,
|
|
|
|
page,
|
|
|
|
@ -86,8 +87,19 @@ const useTableData = (page) => {
|
|
|
|
"prediction_current[]": prediction,
|
|
|
|
"prediction_current[]": prediction,
|
|
|
|
"status[]": status,
|
|
|
|
"status[]": status,
|
|
|
|
"categories[]": categories,
|
|
|
|
"categories[]": categories,
|
|
|
|
|
|
|
|
"included[]": [...selection.included],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (region) {
|
|
|
|
|
|
|
|
if (region.type === "ao") {
|
|
|
|
|
|
|
|
params.append("ao[]", region.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (region.type === "rayon") {
|
|
|
|
|
|
|
|
params.append("rayon[]", region.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
const { data } = await api.get(
|
|
|
|
`/api/placement_points?${params.toString()}`
|
|
|
|
`/api/placement_points?${params.toString()}`
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -251,10 +263,6 @@ export const Table = React.memo(({ height = 200 }) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {
|
|
|
|
const geometry = parse(record.geometry);
|
|
|
|
const geometry = parse(record.geometry);
|
|
|
|
// const feature = {
|
|
|
|
|
|
|
|
// properties: record,
|
|
|
|
|
|
|
|
// geometry,
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
map.flyTo({
|
|
|
|
map.flyTo({
|
|
|
|
center: [geometry.coordinates[0], geometry.coordinates[1]],
|
|
|
|
center: [geometry.coordinates[0], geometry.coordinates[1]],
|
|
|
|
zoom: 15,
|
|
|
|
zoom: 15,
|
|
|
|
|