cleaned up and commented excel print
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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={"تاریخ شروع (تا تاریخ)"}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -118,6 +118,7 @@ const ReportPage = () => {
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"کارتابل گزارش ماموریت"} />
|
||||
|
||||
@@ -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"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user