2026-05-02 06:23:34 +03:30
|
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
import { useMemo } from "react";
|
|
|
|
|
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
|
|
|
|
|
|
|
|
|
|
import Box from "@mui/material/Box";
|
|
|
|
|
|
import Button from "@mui/material/Button";
|
|
|
|
|
|
import Card from "@mui/material/Card";
|
|
|
|
|
|
import CardContent from "@mui/material/CardContent";
|
|
|
|
|
|
import Chip from "@mui/material/Chip";
|
|
|
|
|
|
import Stack from "@mui/material/Stack";
|
|
|
|
|
|
import Typography from "@mui/material/Typography";
|
|
|
|
|
|
|
|
|
|
|
|
import PlantProductionPage from "@views/dashboards/farm/PlantProductionPage";
|
2026-04-11 03:50:23 +03:30
|
|
|
|
|
2026-04-18 01:23:37 +03:30
|
|
|
|
const YieldHarvestPage = () => {
|
2026-05-02 06:23:34 +03:30
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
const searchParams = useSearchParams();
|
|
|
|
|
|
|
|
|
|
|
|
const selectionSummary = useMemo(() => {
|
|
|
|
|
|
const from = searchParams.get("from");
|
|
|
|
|
|
const planType = searchParams.get("planType");
|
|
|
|
|
|
const planName = searchParams.get("planName");
|
|
|
|
|
|
const relatedType = searchParams.get("relatedType");
|
|
|
|
|
|
const relatedPlanName = searchParams.get("relatedPlanName");
|
|
|
|
|
|
|
|
|
|
|
|
if (!from || !planType || !planName || !relatedType || !relatedPlanName) {
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
from,
|
|
|
|
|
|
planType,
|
|
|
|
|
|
planName,
|
|
|
|
|
|
relatedType,
|
|
|
|
|
|
relatedPlanName,
|
|
|
|
|
|
};
|
|
|
|
|
|
}, [searchParams]);
|
|
|
|
|
|
|
|
|
|
|
|
const handleBack = () => {
|
|
|
|
|
|
const from = selectionSummary?.from;
|
|
|
|
|
|
|
|
|
|
|
|
if (from === "irrigation-plan") {
|
|
|
|
|
|
router.push("/irrigation-plan");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (from === "fertilization-plan") {
|
|
|
|
|
|
router.push("/fertilization-plan");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
router.back();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Stack spacing={6}>
|
|
|
|
|
|
{selectionSummary ? (
|
|
|
|
|
|
<Card variant="outlined">
|
|
|
|
|
|
<CardContent>
|
|
|
|
|
|
<Stack
|
|
|
|
|
|
direction={{ xs: "column", md: "row" }}
|
|
|
|
|
|
spacing={2}
|
|
|
|
|
|
alignItems={{ xs: "stretch", md: "center" }}
|
|
|
|
|
|
justifyContent="space-between"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Box>
|
|
|
|
|
|
<Typography variant="h5">تحلیل عملکرد و برداشت</Typography>
|
|
|
|
|
|
<Typography color="text.secondary">
|
|
|
|
|
|
بر اساس انتخاب برنامهها وارد این صفحه شدهاید.
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
variant="outlined"
|
|
|
|
|
|
color="secondary"
|
|
|
|
|
|
startIcon={<i className="tabler-arrow-right text-[18px]" />}
|
|
|
|
|
|
onClick={handleBack}
|
|
|
|
|
|
>
|
|
|
|
|
|
بازگشت به صفحه قبل
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
|
|
|
|
<Stack direction={{ xs: "column", md: "row" }} spacing={1.5} useFlexGap flexWrap="wrap" sx={{ mt: 3 }}>
|
|
|
|
|
|
<Chip
|
|
|
|
|
|
variant="tonal"
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
label={`برنامه ${selectionSummary.planType === "irrigation" ? "آبیاری" : "کوددهی"}: ${selectionSummary.planName}`}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<Chip
|
|
|
|
|
|
variant="tonal"
|
|
|
|
|
|
color="success"
|
|
|
|
|
|
label={`برنامه ${selectionSummary.relatedType === "irrigation" ? "آبیاری" : "کوددهی"} انتخابشده: ${selectionSummary.relatedPlanName}`}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
</CardContent>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
|
|
|
|
<PlantProductionPage />
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
2026-04-11 03:50:23 +03:30
|
|
|
|
|
2026-05-02 06:23:34 +03:30
|
|
|
|
export default YieldHarvestPage;
|