Merge branch 'feature/machine_performance_modal' into 'develop'
machine performance modal See merge request witel-front-end/rms!59
This commit is contained in:
@@ -43,10 +43,10 @@ const OperatorList = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cell: ({ renderedCellValue }) => {
|
Cell: ({ renderedCellValue, row }) => {
|
||||||
return (
|
return (
|
||||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||||
<MachinePerformanceForm />
|
<MachinePerformanceForm row={row} />
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const StopsInfo = ({ selectedPoint, staticData }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||||
{staticData.mileage || ""} کیلومتر
|
{staticData.mileage.toLocaleString() || ""} متر
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||||
|
|||||||
@@ -3,34 +3,15 @@ import DirectionsCarIcon from "@mui/icons-material/DirectionsCar";
|
|||||||
import MachinePerformanceContent from "./MachinePerformanceContent";
|
import MachinePerformanceContent from "./MachinePerformanceContent";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
const MachinePerformanceForm = () => {
|
const MachinePerformanceForm = ({row}) => {
|
||||||
const [openMachinesCodeDialog, setOpenMachinesCodeDialog] = useState(false);
|
const [openMachinesCodeDialog, setOpenMachinesCodeDialog] = useState(false);
|
||||||
const machineData = {
|
const machineData = {
|
||||||
cmms_machine_code: 245,
|
cmms_machine_code: row.original?.cmms_machines[0]?.machine_code,
|
||||||
resultCode: 0,
|
resultCode: 0,
|
||||||
mileage: 17645,
|
mileage: row.original?.distance,
|
||||||
accOnDuration: 3599,
|
accOnDuration: row.original?.vehicle_runtime,
|
||||||
fuelConsumption: 6.1757503,
|
fuelConsumption: row.original?.fuel_consumption,
|
||||||
stopPoints: [
|
stopPoints: row.original?.stop_points,
|
||||||
{
|
|
||||||
startDT: "2024-12-23T13:55:40",
|
|
||||||
duration: 114,
|
|
||||||
latitude: 37.521317,
|
|
||||||
longitude: 46.103584,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
startDT: "2024-12-23T14:31:11",
|
|
||||||
duration: 14,
|
|
||||||
latitude: 37.566532,
|
|
||||||
longitude: 46.17688,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
startDT: "2024-12-23T14:35:36",
|
|
||||||
duration: 55,
|
|
||||||
latitude: 37.569958,
|
|
||||||
longitude: 46.18166,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const StopsInfo = ({ selectedPoint, staticData }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||||
{staticData.mileage || ""} کیلومتر
|
{staticData.mileage.toLocaleString() || ""} متر
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||||
@@ -70,59 +70,54 @@ const StopsInfo = ({ selectedPoint, staticData }) => {
|
|||||||
{(staticData.accOnDuration / 60)?.toFixed(2) || ""} دقیقه
|
{(staticData.accOnDuration / 60)?.toFixed(2) || ""} دقیقه
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||||
{selectedPoint && (
|
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||||
<>
|
<Chip
|
||||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
icon={<PinDropIcon />}
|
||||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
label={
|
||||||
<Chip
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||||
icon={<PinDropIcon />}
|
طول جغرافیایی
|
||||||
label={
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
}
|
||||||
طول جغرافیایی
|
/>
|
||||||
</Typography>
|
</Box>
|
||||||
}
|
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||||
/>
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||||
</Box>
|
{selectedPoint ? selectedPoint.longitude : "نقطه مورد نظر را انتخاب کنید"}
|
||||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
</Grid>
|
||||||
{selectedPoint.longitude || ""}
|
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||||
</Typography>
|
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||||
</Grid>
|
<Chip
|
||||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
icon={<PinDropIcon />}
|
||||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
label={
|
||||||
<Chip
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||||
icon={<PinDropIcon />}
|
عرض جغرافیایی
|
||||||
label={
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
}
|
||||||
عرض جغرافیایی
|
/>
|
||||||
</Typography>
|
</Box>
|
||||||
}
|
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||||
/>
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||||
</Box>
|
{selectedPoint ? selectedPoint.latitude : "نقطه مورد نظر را انتخاب کنید"}
|
||||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
</Grid>
|
||||||
{selectedPoint.latitude || ""}
|
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||||
</Typography>
|
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||||
</Grid>
|
<Chip
|
||||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
icon={<AccessAlarmsIcon />}
|
||||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
label={
|
||||||
<Chip
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||||
icon={<AccessAlarmsIcon />}
|
مدت زمان توقف
|
||||||
label={
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
}
|
||||||
مدت زمان توقف
|
/>
|
||||||
</Typography>
|
</Box>
|
||||||
}
|
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||||
/>
|
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||||
</Box>
|
{selectedPoint ? `${selectedPoint.duration} ثانیه` : "نقطه مورد نظر را انتخاب کنید"}
|
||||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
</Grid>
|
||||||
{selectedPoint.duration || ""} ثانیه
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,34 +3,15 @@ import DirectionsCarIcon from "@mui/icons-material/DirectionsCar";
|
|||||||
import MachinePerformanceContent from "./MachinePerformanceContent";
|
import MachinePerformanceContent from "./MachinePerformanceContent";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
const MachinePerformanceForm = () => {
|
const MachinePerformanceForm = ({row}) => {
|
||||||
const [openMachinesCodeDialog, setOpenMachinesCodeDialog] = useState(false);
|
const [openMachinesCodeDialog, setOpenMachinesCodeDialog] = useState(false);
|
||||||
const machineData = {
|
const machineData = {
|
||||||
cmms_machine_code: 245,
|
cmms_machine_code: row.original?.cmms_machines[0]?.machine_code,
|
||||||
resultCode: 0,
|
resultCode: 0,
|
||||||
mileage: 17645,
|
mileage: row.original?.distance,
|
||||||
accOnDuration: 3599,
|
accOnDuration: row.original?.vehicle_runtime,
|
||||||
fuelConsumption: 6.1757503,
|
fuelConsumption: row.original?.fuel_consumption,
|
||||||
stopPoints: [
|
stopPoints: row.original?.stop_points,
|
||||||
{
|
|
||||||
startDT: "2024-12-23T13:55:40",
|
|
||||||
duration: 114,
|
|
||||||
latitude: 37.521317,
|
|
||||||
longitude: 46.103584,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
startDT: "2024-12-23T14:31:11",
|
|
||||||
duration: 14,
|
|
||||||
latitude: 37.566532,
|
|
||||||
longitude: 46.17688,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
startDT: "2024-12-23T14:35:36",
|
|
||||||
duration: 55,
|
|
||||||
latitude: 37.569958,
|
|
||||||
longitude: 46.18166,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ const SupervisorList = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cell: () => (
|
Cell: ({row}) => (
|
||||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||||
<MachinePerformanceForm />
|
<MachinePerformanceForm row={row} />
|
||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user