synced source control with server
This commit is contained in:
@@ -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"]
|
||||
// }
|
||||
|
||||
@@ -168,9 +168,12 @@ const PrivacyOfficeList = () => {
|
||||
grow: false,
|
||||
size: 100,
|
||||
Cell: ({ row }) =>
|
||||
row.original.primary_area ? (
|
||||
row.original.primary_area && row.original.forbidden_area ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<ShowPrimaryArea primaryArea={row.original.primary_area} />
|
||||
<ShowPrimaryArea
|
||||
primaryArea={row.original.primary_area}
|
||||
forbiddenArea={row.original.forbidden_area}
|
||||
/>
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { FeatureGroup, useMap } from "react-leaflet";
|
||||
|
||||
const ShowForbiddenBound = ({ bound }) => {
|
||||
const map = useMap();
|
||||
const featureRef = useRef(null);
|
||||
|
||||
const safeFitBounds = (layer) => {
|
||||
if (!layer || !map) return;
|
||||
try {
|
||||
const latLngs = layer.getLatLngs();
|
||||
map.fitBounds(latLngs, {
|
||||
paddingTopLeft: [20, 20],
|
||||
paddingBottomRight: [20, 20],
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn("fitBounds failed:", e);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
bound?.editing?.disable();
|
||||
featureRef.current.addLayer(bound);
|
||||
safeFitBounds(bound);
|
||||
}, []);
|
||||
|
||||
return <FeatureGroup ref={featureRef} />;
|
||||
};
|
||||
export default ShowForbiddenBound;
|
||||
@@ -1,27 +1,27 @@
|
||||
const {
|
||||
Button,
|
||||
IconButton,
|
||||
Tooltip,
|
||||
Box,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
Typography,
|
||||
DialogContent,
|
||||
DialogActions,
|
||||
} = require("@mui/material");
|
||||
import LayersIcon from "@mui/icons-material/Layers";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import { useMemo, useState } from "react";
|
||||
const { IconButton, Tooltip, Box, Dialog, DialogTitle, Typography, DialogContent } = require("@mui/material");
|
||||
import MapLayer from "@/core/components/MapLayer";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import LayersIcon from "@mui/icons-material/Layers";
|
||||
import { useMemo, useState } from "react";
|
||||
import ShowBound from "./ShowBound";
|
||||
import ShowForbiddenBound from "./ShowForbiddenBound";
|
||||
|
||||
const ShowPrimaryArea = ({ primaryArea }) => {
|
||||
const ShowPrimaryArea = ({ primaryArea, forbiddenArea }) => {
|
||||
const [openShowAreaDialog, setOpenShowAreaDialog] = useState(false);
|
||||
const bound = useMemo(() => {
|
||||
const latLngCoords = primaryArea.coordinates.map((coord) => [coord[1], coord[0]]);
|
||||
return primaryArea.type === "polygon" ? L.polygon(latLngCoords) : L.polyline(latLngCoords);
|
||||
}, [primaryArea]);
|
||||
|
||||
const forbiddenBound = useMemo(() => {
|
||||
const latLngCoords = forbiddenArea.coordinates.map((coord) => [coord[1], coord[0]]);
|
||||
return forbiddenArea.type === "polygon"
|
||||
? L.polygon(latLngCoords, {
|
||||
color: "#ff5555",
|
||||
})
|
||||
: L.polyline(latLngCoords);
|
||||
}, [forbiddenArea]);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Tooltip title="نمایش پلیگان" placement="right" arrow>
|
||||
@@ -57,6 +57,7 @@ const ShowPrimaryArea = ({ primaryArea }) => {
|
||||
<Box sx={{ width: "100%", height: "400px" }}>
|
||||
<MapLayer style={{ borderRadius: "4px" }}>
|
||||
<ShowBound bound={bound} />
|
||||
<ShowForbiddenBound bound={forbiddenBound} />
|
||||
</MapLayer>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -1,30 +1,34 @@
|
||||
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
||||
import GroupsIcon from "@mui/icons-material/Groups";
|
||||
import AccountTreeIcon from "@mui/icons-material/AccountTree";
|
||||
import FactCheckIcon from "@mui/icons-material/FactCheck";
|
||||
import FireTruckIcon from "@mui/icons-material/FireTruck";
|
||||
import RouteIcon from "@mui/icons-material/Route";
|
||||
import DoorbellIcon from "@mui/icons-material/Doorbell";
|
||||
import ElectricBoltIcon from "@mui/icons-material/ElectricBolt";
|
||||
import CottageIcon from "@mui/icons-material/Cottage";
|
||||
import GppMaybeIcon from "@mui/icons-material/GppMaybe";
|
||||
import GavelIcon from "@mui/icons-material/Gavel";
|
||||
import BallotIcon from "@mui/icons-material/Ballot";
|
||||
import AssistantIcon from "@mui/icons-material/Assistant";
|
||||
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
||||
import MapIcon from "@mui/icons-material/Map";
|
||||
import SpeedIcon from "@mui/icons-material/Speed";
|
||||
import EngineeringIcon from "@mui/icons-material/Engineering";
|
||||
import ReportIcon from "@mui/icons-material/Report";
|
||||
import AssessmentIcon from "@mui/icons-material/Assessment";
|
||||
import AssignmentLateIcon from "@mui/icons-material/AssignmentLate";
|
||||
import LockPersonIcon from "@mui/icons-material/LockPerson";
|
||||
import LineAxisIcon from "@mui/icons-material/LineAxis";
|
||||
import ScienceIcon from "@mui/icons-material/Science";
|
||||
import HandymanIcon from "@mui/icons-material/Handyman";
|
||||
import DriveEtaIcon from "@mui/icons-material/DriveEta";
|
||||
import AssistantIcon from "@mui/icons-material/Assistant";
|
||||
import BallotIcon from "@mui/icons-material/Ballot";
|
||||
import BiotechIcon from "@mui/icons-material/Biotech";
|
||||
import CottageIcon from "@mui/icons-material/Cottage";
|
||||
import DoorbellIcon from "@mui/icons-material/Doorbell";
|
||||
import DriveEtaIcon from "@mui/icons-material/DriveEta";
|
||||
import ElectricBoltIcon from "@mui/icons-material/ElectricBolt";
|
||||
import EngineeringIcon from "@mui/icons-material/Engineering";
|
||||
import FactCheckIcon from "@mui/icons-material/FactCheck";
|
||||
import FireTruckIcon from "@mui/icons-material/FireTruck";
|
||||
import GavelIcon from "@mui/icons-material/Gavel";
|
||||
import GppMaybeIcon from "@mui/icons-material/GppMaybe";
|
||||
import GroupsIcon from "@mui/icons-material/Groups";
|
||||
import HandymanIcon from "@mui/icons-material/Handyman";
|
||||
import LineAxisIcon from "@mui/icons-material/LineAxis";
|
||||
import LockPersonIcon from "@mui/icons-material/LockPerson";
|
||||
import ManageAccountsIcon from "@mui/icons-material/ManageAccounts";
|
||||
import MapIcon from "@mui/icons-material/Map";
|
||||
import MapsHomeWorkIcon from "@mui/icons-material/MapsHomeWork";
|
||||
import Mediation from "@mui/icons-material/Mediation";
|
||||
import PsychologyAltIcon from "@mui/icons-material/PsychologyAlt";
|
||||
import ReportIcon from "@mui/icons-material/Report";
|
||||
import RouteIcon from "@mui/icons-material/Route";
|
||||
import ScienceIcon from "@mui/icons-material/Science";
|
||||
import SecurityIcon from "@mui/icons-material/Security";
|
||||
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
||||
import SpeedIcon from "@mui/icons-material/Speed";
|
||||
|
||||
export const pageMenu = [
|
||||
{
|
||||
@@ -128,6 +132,14 @@ export const pageMenu = [
|
||||
badges: [{ key: "mission.control" }],
|
||||
permissions: ["manage-control-unit"],
|
||||
},
|
||||
{
|
||||
id: "roadMissionsViolations",
|
||||
label: "تخلفات",
|
||||
type: "page",
|
||||
route: "/dashboard/road-missions/violation",
|
||||
// badges: [{ key: "mission.control" }], // TODO: add badge and permission
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -296,32 +308,36 @@ export const pageMenu = [
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "cityAdminZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
id: "cityAdmin",
|
||||
label: "کارتابل شهرستان",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/city-admin/zamin-gov",
|
||||
permissions: [],
|
||||
route: "/dashboard/inquiry-privacy/city-admin",
|
||||
icon: <MapsHomeWorkIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "provinceAdminZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
id: "privacyOffice",
|
||||
label: "کارتابل اداره حریم",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/province-admin/zamin-gov",
|
||||
permissions: [],
|
||||
route: "/dashboard/inquiry-privacy/privacy-office",
|
||||
icon: <SecurityIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "assistantZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
id: "assistant",
|
||||
label: "کارتابل معاون",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/assistant/zamin-gov",
|
||||
permissions: [],
|
||||
route: "/dashboard/inquiry-privacy/technical-deputy",
|
||||
icon: <ManageAccountsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "generalManagerZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
id: "generalManager",
|
||||
label: "کارتابل مدیر",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/general-manager/zamin-gov",
|
||||
permissions: [],
|
||||
route: "/dashboard/inquiry-privacy/general-manager",
|
||||
icon: <PsychologyAltIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user