Merge branch 'release/v1.0.4'

This commit is contained in:
AmirHossein Mahmoodi
2025-04-20 16:33:34 +03:30
42 changed files with 57 additions and 44 deletions

View File

@@ -1,4 +1,4 @@
HOST="rms.witel.ir"
NEXT_PUBLIC_VERSION="1.0.3"
NEXT_PUBLIC_VERSION="1.0.4"
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"

View File

@@ -1,3 +1,7 @@
export const metadata = {
title: "پیشخوان",
};
const Page = () => {
return <></>;
};

View File

@@ -2,7 +2,7 @@ import WithPermission from "@/core/middlewares/withPermission";
import TollHousePage from "@/components/infrastructure/tollHouse";
export const metadata = {
title: "فهرست راهدارخانه ها",
title: "لیست راهدارخانه ها",
};
const Page = () => {

View File

@@ -1,13 +0,0 @@
import HeaderWithLogo from "@/components/layouts/dashboard/headerWithLogo";
import HeaderWithSidebar from "@/components/layouts/dashboard/headerWithSidebar";
import { Stack } from "@mui/material";
const Layout = ({ children }) => {
return (
<Stack sx={{ width: "100%", height: "100%" }}>
<HeaderWithLogo />
<HeaderWithSidebar>{children}</HeaderWithSidebar>
</Stack>
);
};
export default Layout;

View File

@@ -71,15 +71,12 @@ const OperatorList = () => {
},
},
},
Cell: ({ renderedCellValue }) => {
if (renderedCellValue) {
return (
<Stack alignItems={"center"} justifyContent={"center"}>
<RahdaranDialog rahdarLists={renderedCellValue} />
</Stack>
);
}
return <Typography variant="body2">-</Typography>;
Cell: ({ renderedCellValue, row }) => {
return (
<Stack alignItems={"center"} justifyContent={"center"}>
<RahdaranDialog rowId={row.original.id} />
</Stack>
);
},
},
{

View File

@@ -1,22 +1,44 @@
import { DialogContent, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from "@mui/material";
import DialogLoading from "@/core/components/DialogLoading";
import { GET_RAHDARAN_ROAD_POTROL } from "@/core/utils/routes";
import useRequest from "@/lib/hooks/useRequest";
import {
DialogContent,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Typography,
} from "@mui/material";
import { useEffect, useState } from "react";
const RahdaranContent = ({ rowId }) => {
const [loading, setLoading] = useState(true);
const [data, setData] = useState(null);
const request = useRequest();
useEffect(() => {
const fetchData = async () => {
try {
setLoading(true);
const response = await request(`${GET_RAHDARAN_ROAD_POTROL}/${rowId}`);
setData(response.data.data);
} catch (error) {
} finally {
setLoading(false);
}
};
fetchData();
}, [rowId]);
const RahdaranContent = ({ rahdarLists }) => {
return (
<>
<DialogContent>
<Paper
elevation={0}
sx={{
width: "100%",
overflow: "hidden",
"*::-webkit-scrollbar": {
width: "0.5em",
},
"*::-webkit-scrollbar-thumb": {
backgroundColor: "primary.main",
},
}}
>
{loading ? (
<DialogLoading />
) : data ? (
<TableContainer sx={{ maxHeight: 600 }}>
<Table stickyHeader sx={{ minWidth: 800 }}>
<TableHead>
@@ -26,7 +48,7 @@ const RahdaranContent = ({ rahdarLists }) => {
</TableRow>
</TableHead>
<TableBody>
{rahdarLists.map((rahdar) => {
{data.map((rahdar) => {
return (
<TableRow
key={rahdar.id}
@@ -40,7 +62,9 @@ const RahdaranContent = ({ rahdarLists }) => {
</TableBody>
</Table>
</TableContainer>
</Paper>
) : (
<Typography textAlign={"center"}>اطلاعات راهداران در سامانه یافت نشد</Typography>
)}
</DialogContent>
</>
);

View File

@@ -3,7 +3,7 @@ import GroupsIcon from "@mui/icons-material/Groups";
import { useState } from "react";
import RahdaranContent from "./RahdaranContent";
const RahdaranDialog = ({ rahdarLists }) => {
const RahdaranDialog = ({ rowId }) => {
const [openRahdaranDialog, setOpenRahdaranDialog] = useState(false);
return (
<>
@@ -25,7 +25,7 @@ const RahdaranDialog = ({ rahdarLists }) => {
maxWidth={"md"}
>
<DialogTitle sx={{ fontSize: "large" }}>لیست راهداران</DialogTitle>
<RahdaranContent rahdarLists={rahdarLists} />
{openRahdaranDialog && <RahdaranContent rowId={rowId} />}
<DialogActions>
<Button onClick={() => setOpenRahdaranDialog(false)} variant="outlined" color="secondary" autoFocus>
بستن

View File

@@ -6,7 +6,7 @@ import TollHouseList from "./TollHouseList";
const TollHousePage = () => {
return (
<Stack spacing={1}>
<PageTitle title={"فهرست راهدارخانه ها"} />
<PageTitle title={"لیست راهدارخانه ها"} />
<TollHouseList />
</Stack>
);

View File

@@ -39,6 +39,7 @@ export const DELETE_ROAD_PATROL_SUPERVISOR = api + "/api/v3/road_patrols/delete"
export const GET_CMMS_MACHINE_ROAD_PATROL = api + "/api/v3/road_patrols/machines";
export const GET_ROAD_PATROL_OPERATOR_REPORT = api + "/v2/road_patrols/operator/report";
export const GET_ROAD_PATROL_SUPERVISOR_REPORT = api + "/v2/road_patrols/operator/report";
export const GET_RAHDARAN_ROAD_POTROL = api + "/api/v3/road_patrols/rahdaran";
export const CREATE_PATROL = api + "/api/v3/road_patrols/store";
export const GET_FMS_DATA = api + "/api/v3/fms_vehicle/get_activity";
export const GET_OTP_TOKEN = api + "/api/v3/otp/get_token";