change style

This commit is contained in:
AmirHossein Mahmoodi
2025-03-04 16:45:53 +03:30
parent ab2b8374ad
commit 84fdac3317
11 changed files with 37 additions and 31 deletions

View File

@@ -15,7 +15,6 @@ const RegisterAction = ({ rowId, mutate }) => {
image_after_1: null,
};
const onBaseSubmit = async (result) => {
console.log(result);
const formData = new FormData();
const rmsLatLng = `${result.start_point.lat},${result.start_point.lng}`;
if (result.rms_status === "1") {
@@ -35,7 +34,7 @@ const RegisterAction = ({ rowId, mutate }) => {
mutate();
setOpenRegisterActionDialog(false);
})
.catch(() => {});
.catch(() => { });
};
return (
<>

View File

@@ -31,7 +31,6 @@ const EditController = ({ rowId, mutate, setOpenEditDialog }) => {
image_after_1: fastReactItemDetails?.image_after || null,
};
const HandleSubmit = async (result) => {
console.log("result", result);
const formData = new FormData();
const rmsLatLng = `${result.start_point.lat},${result.start_point.lng}`;
if (result.rms_status === "1") {
@@ -53,7 +52,7 @@ const EditController = ({ rowId, mutate, setOpenEditDialog }) => {
mutate();
setOpenEditDialog(false);
})
.catch(() => {});
.catch(() => { });
};
return (
<>

View File

@@ -27,7 +27,7 @@ function TabPanel(props) {
const validationSchema = object({
recognize_picture: mixed().nullable().required("لطفا عکس فعالیت را بارگذاری کنید!"),
info_id: number().required("نوع آیتم را مشخص کنید!"),
axis_type_id: number().required("نوع محور را مشخص کنید!"),
axis_type_id: string().required("نوع محور را مشخص کنید!"),
start_point: mixed()
.test("start-point-required", "لطفاً نقطه شروع را مشخص کنید!", function (value) {
return !!value; // چک می‌کند که مقدار موجود است
@@ -42,7 +42,7 @@ const CreateFormContent = ({ setOpen, mutate }) => {
const [itemsList, setItemsList] = useState();
const defaultValues = {
info_id: null,
axis_type_id: null,
axis_type_id: '',
recognize_picture: null,
activity_date: "",
activity_time: "",
@@ -95,7 +95,7 @@ const CreateFormContent = ({ setOpen, mutate }) => {
mutate();
setOpen(false);
})
.catch((error) => {});
.catch((error) => { });
};
return (

View File

@@ -1,8 +1,7 @@
import React from "react";
import { Card, CardActionArea, Grid, LinearProgress, Typography } from "@mui/material";
import Image from "next/image";
import { Controller } from "react-hook-form";
import DialogLoading from "@/core/components/DialogLoading";
import useSafetyAndPrivacyGetItems from "@/lib/hooks/useSafetyAndPrivacyGetItems";
import { Card, CardActionArea, Grid, Typography } from "@mui/material";
import { Controller } from "react-hook-form";
const GetItemInfo = ({ setItemsList, setTabState, control }) => {
const { itemsList, loadingItemsList, errorItemsList } = useSafetyAndPrivacyGetItems();
@@ -14,7 +13,7 @@ const GetItemInfo = ({ setItemsList, setTabState, control }) => {
خطا در دریافت لیست آیتم ها
</Typography>
) : loadingItemsList ? (
<LinearProgress />
<DialogLoading />
) : (
<Grid container sx={{ justifyContent: "center" }} spacing={2}>
<Controller

View File

@@ -34,11 +34,11 @@ const StepThreeContent = ({ setOpen, mutate, rowId }) => {
mutate();
setOpen(false);
})
.catch((error) => {});
.catch((error) => { });
};
return (
<StyledForm onSubmit={handleSubmit(onSubmit)}>
<DialogContent>
<DialogContent dividers>
<Stack spacing={2}>
<Controller
name="action_picture"

View File

@@ -20,7 +20,7 @@ const StepThree = ({ mutate, rowId }) => {
},
}}
dir="rtl"
maxWidth={"md"}
maxWidth={"sm"}
fullWidth
>
<DialogTitle>بارگذاری تصویر اقدام</DialogTitle>

View File

@@ -53,11 +53,11 @@ const StepTwoContent = ({ setOpenStepTwoDialog, mutate, rowId }) => {
mutate();
setOpenStepTwoDialog(false);
})
.catch((error) => {});
.catch((error) => { });
};
return (
<StyledForm onSubmit={handleSubmit(onSubmit)}>
<DialogContent>
<DialogContent dividers>
<Stack spacing={2}>
<Controller
control={control}
@@ -86,7 +86,9 @@ const StepTwoContent = ({ setOpenStepTwoDialog, mutate, rowId }) => {
<Chip variant="outlined" label="لیست مستندات قضایی" />
</Divider>
{selectedDamageItemList.length === 0 && (
<Box sx={{ my: 4, width: "100%", textAlign: "center" }}>
<Box sx={{
my: 4, width: "100%", textAlign: "center"
}}>
<Typography variant="h6" sx={{ letterSpacing: "2px", color: "#606060" }}>
فایل موردنظر را بارگذاری کنید.
</Typography>

View File

@@ -21,7 +21,7 @@ const StepTwo = ({ mutate, rowId }) => {
},
}}
dir="rtl"
maxWidth={"md"}
maxWidth={"sm"}
fullWidth
>
<DialogTitle>بارگذاری مستندات قضایی</DialogTitle>

View File

@@ -133,8 +133,8 @@ const OperatorList = () => {
props.dependencyFieldValue?.value === ""
? "empty"
: loadingEdaratList
? "loading"
: props.filterParameters.value
? "loading"
: props.filterParameters.value
}
columnSelectOption={getColumnSelectOptions}
/>
@@ -181,7 +181,7 @@ const OperatorList = () => {
}));
},
Cell: ({ row }) =>
row.original?.axis_type_name ? <>{row.original.axis_type_name}</> : <>بدون محور</>,
row.original?.axis_type_name ? <>{row.original.axis_type_name}</> : <>-</>,
},
{
accessorKey: "location",
@@ -244,7 +244,7 @@ const OperatorList = () => {
<RecognizePictureDialog image={renderedCellValue} />
</Stack>
) : (
<>بدون تصویر</>
<>-</>
);
},
},
@@ -253,7 +253,7 @@ const OperatorList = () => {
row.activity_date_time ? (
moment(row.activity_date_time).locale("fa").format("HH:mm | yyyy/MM/DD")
) : (
<>بدون تاریخ</>
<>-</>
),
header: "تاریخ بازدید",
id: "activity_date_time",
@@ -294,7 +294,9 @@ const OperatorList = () => {
Cell: ({ row }) => {
return (
<Stack alignItems={"center"} justifyContent={"center"}>
<JudiciaryDocumentDialog rowId={row.getValue("id")} />
{row.original.judiciary_document_upload_date !== "0000-00-00 00:00:00" ? (
<JudiciaryDocumentDialog rowId={row.getValue("id")} />
) : (<>-</>)}
</Stack>
);
},
@@ -303,12 +305,12 @@ const OperatorList = () => {
accessorFn: (row) => {
const date = row.judiciary_document_upload_date;
if (!date || date === "0000-00-00 00:00:00") {
return <>بدون تاریخ</>;
return <>-</>;
}
return moment(date, "YYYY-MM-DD HH:mm:ss").locale("fa").format("HH:mm | yyyy/MM/DD");
},
header: "تاریخ مستندات قضایی",
header: "تاریخ بارگذاری مستندات",
id: "judiciary_document_upload_date",
enableColumnFilter: true,
datatype: "date",
@@ -351,7 +353,7 @@ const OperatorList = () => {
<ActionPictureDialog image={renderedCellValue} />
</Stack>
) : (
<>بدون تصویر</>
<>-</>
);
},
},
@@ -362,7 +364,7 @@ const OperatorList = () => {
.locale("fa")
.format("HH:mm | yyyy/MM/DD")
) : (
<>بدون تاریخ</>
<>-</>
),
header: "تاریخ اقدام",
id: "action_picture_document_upload_date",

View File

@@ -25,7 +25,7 @@ const JudiciaryDocumentDialog = ({ rowId }) => {
fullWidth
>
<DialogTitle>مشاهده مستندات قضایی</DialogTitle>
<DialogContent>
<DialogContent dividers>
<JudiciaryDocumentController rowId={rowId} />
</DialogContent>
<DialogActions>

View File

@@ -2,13 +2,18 @@ import { Box } from "@mui/material";
import DeleteForm from "./DeleteDialog";
import StepTwo from "../Form/StepTwo";
import StepThree from "../Form/StepThree";
import { usePermissions } from "@/lib/hooks/usePermissions";
const RowActions = ({ row, mutate }) => {
const { data: userPermissions } = usePermissions();
const hasDeletePermission = userPermissions?.includes("delete-safety-and-privacy");
return (
<Box sx={{ display: "flex", gap: 1 }}>
{row.original?.step === 1 && <StepTwo mutate={mutate} rowId={row.getValue("id")} />}
{row.original?.step === 2 && <StepThree mutate={mutate} rowId={row.getValue("id")} />}
<DeleteForm rowId={row.getValue("id")} mutate={mutate} />
{hasDeletePermission && (
<DeleteForm rowId={row.getValue("id")} mutate={mutate} />
)}
</Box>
);
};