cleaned up and commented excel print

This commit is contained in:
2025-12-29 10:36:36 +03:30
parent 7a269ae8fb
commit 7cf54b2441
9 changed files with 48 additions and 55 deletions

View File

@@ -1,27 +1,27 @@
// javascript for production
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"],
"^/*": ["./public/*"]
}
}
}
// typescript for local development
// {
// "compilerOptions": {
// "jsx": "react-jsx",
// "noUnusedLocals": true,
// "noImplicitAny": false,
// "checkJs": true,
// "allowJs": true,
// "strict": true,
// "baseUrl": ".",
// "paths": {
// "@/*": ["./src/*"],
// "^/*": ["./public/*"]
// }
// },
// "exclude": ["node_modules"]
// }
// }
// typescript for local development
{
"compilerOptions": {
"jsx": "react-jsx",
"noUnusedLocals": true,
"noImplicitAny": false,
"checkJs": true,
"allowJs": true,
"strict": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"^/*": ["./public/*"]
}
},
"exclude": ["node_modules"]
}

View File

@@ -1,7 +1,6 @@
import { Controller } from "react-hook-form";
import MuiDatePicker from "@/core/components/MuiDatePicker";
import React from "react";
import moment from "jalali-moment";
import { Controller } from "react-hook-form";
const FromDateController = ({ control }) => {
return (

View File

@@ -1,10 +1,9 @@
import { Button, Grid, LinearProgress, Typography } from "@mui/material";
import SearchIcon from "@mui/icons-material/Search";
import React from "react";
import FromDateController from "./FromDateController";
import ToDateController from "./ToDateController";
import SelectProvince from "./SelectProvince";
import { Button, Grid } from "@mui/material";
import { Controller } from "react-hook-form";
import FromDateController from "./FromDateController";
import SelectProvince from "./SelectProvince";
import ToDateController from "./ToDateController";
const SearchReportField = ({ control, hasProvincesPermission }) => {
return (

View File

@@ -1,8 +1,6 @@
import { Controller } from "react-hook-form";
import MuiDatePicker from "@/core/components/MuiDatePicker";
import React from "react";
import { FormControl, FormHelperText, InputLabel, LinearProgress, MenuItem, Select, Typography } from "@mui/material";
import useProvinces from "@/lib/hooks/useProvince";
import { FormControl, FormHelperText, InputLabel, MenuItem, Select } from "@mui/material";
import { Controller } from "react-hook-form";
const SelectProvince = ({ control }) => {
const { provinces, loadingProvinces, errorProvinces } = useProvinces();

View File

@@ -1,7 +1,6 @@
import { Controller, useWatch } from "react-hook-form";
import MuiDatePicker from "@/core/components/MuiDatePicker";
import React from "react";
import moment from "jalali-moment";
import { Controller, useWatch } from "react-hook-form";
const ToDateController = ({ control }) => {
const minDate = useWatch({ control, name: "from_date" });
@@ -13,6 +12,7 @@ const ToDateController = ({ control }) => {
<MuiDatePicker
name="date_to"
minDate={minDate}
maxDate={new Date()}
error={!!error}
value={value}
label={"تاریخ شروع (تا تاریخ)"}

View File

@@ -2,10 +2,6 @@ import PrintExcel from "./ExcelPrint";
import { Box } from "@mui/material";
const Toolbar = ({ table, filterData, mutate }) => {
return (
<Box sx={{ display: "flex", gap: 1 }}>
<PrintExcel table={table} filterData={filterData} />
</Box>
);
return <Box sx={{ display: "flex", gap: 1 }}>{/* <PrintExcel table={table} filterData={filterData} /> */}</Box>;
};
export default Toolbar;

View File

@@ -118,6 +118,7 @@ const ReportPage = () => {
resolver: yupResolver(validationSchema),
mode: "all",
});
return (
<Stack spacing={1}>
<PageTitle title={"کارتابل گزارش ماموریت"} />

View File

@@ -159,15 +159,15 @@ export const pageMenu = [
// badges: [{ key: "mission.control" }], // TODO: add badge and permission
permissions: ["all"],
},
// {
// id: "roadMissionsReports",
// label: "گزارشات",
// type: "page",
// route: "/dashboard/road-missions/reports",
// icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
// // badges: [{ key: "mission.control" }], // TODO: add badge and permission
// permissions: ["all"],
// },
{
id: "roadMissionsReports",
label: "گزارشات",
type: "page",
route: "/dashboard/road-missions/reports",
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
// badges: [{ key: "mission.control" }], // TODO: add badge and permission
permissions: ["all"],
},
],
},
{

View File

@@ -158,15 +158,15 @@ export const pageMenuDev = [
// badges: [{ key: "mission.control" }], // TODO: add badge and permission
permissions: ["all"],
},
// {
// id: "roadMissionsReports",
// label: "گزارشات",
// type: "page",
// route: "/dashboard/road-missions/reports",
// icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
// // badges: [{ key: "mission.control" }], // TODO: add badge and permission
// permissions: ["all"],
// },
{
id: "roadMissionsReports",
label: "گزارشات",
type: "page",
route: "/dashboard/road-missions/reports",
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
// badges: [{ key: "mission.control" }], // TODO: add badge and permission
permissions: ["all"],
},
],
},
{