feat(3d): integrate ZJB scene with project context
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import { Box, CircularProgress } from "@mui/material";
|
||||
|
||||
const ThreeDimensionalScene = dynamic(
|
||||
() => import("@components/threeDimensional/ThreeDimensionalScene"),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => (
|
||||
<Box sx={{ height: "100%", display: "grid", placeItems: "center" }}>
|
||||
<CircularProgress size={32} />
|
||||
</Box>
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
export default function ThreeDimensionalScenePage() {
|
||||
return <ThreeDimensionalScene />;
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import { clearSessionRecoveryDrafts } from "@/lib/sessionRecoveryDraft";
|
||||
import { permissionCodes, resourcePermissions } from "@/lib/permissions";
|
||||
import { config } from "@config/config";
|
||||
import { useAppNotificationProvider } from "@/providers/notification-provider/useAppNotificationProvider";
|
||||
import { supportsThreeDimensionalScene } from "@components/threeDimensional/sceneData";
|
||||
|
||||
import { LiaNetworkWiredSolid } from "react-icons/lia";
|
||||
import { TbActivity, TbDatabaseEdit, TbLocationPin } from "react-icons/tb";
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
ManageAccounts as ManageAccountsIcon,
|
||||
MyLocation as MyLocationIcon,
|
||||
Search as SearchIcon,
|
||||
ViewInAr as ViewInArIcon,
|
||||
} from "@mui/icons-material";
|
||||
|
||||
type RefineContextProps = {
|
||||
@@ -63,6 +65,9 @@ export const App = (props: React.PropsWithChildren<AppProps>) => {
|
||||
const markSessionExpired = useAuthStore((state) => state.markSessionExpired);
|
||||
const clearSessionExpired = useAuthStore((state) => state.clearSessionExpired);
|
||||
const currentProjectId = useProjectStore((state) => state.currentProjectId);
|
||||
const currentProjectCode = useProjectStore(
|
||||
(state) => state.currentProjectCode,
|
||||
);
|
||||
const permissions = useAccessStore((state) => state.permissions);
|
||||
const setAccessContext = useAccessStore((state) => state.setContext);
|
||||
const setAccessLoading = useAccessStore((state) => state.setLoading);
|
||||
@@ -209,6 +214,19 @@ export const App = (props: React.PropsWithChildren<AppProps>) => {
|
||||
};
|
||||
|
||||
const resources = [
|
||||
...(supportsThreeDimensionalScene(currentProjectCode) &&
|
||||
can(permissionCodes.webgisView)
|
||||
? [
|
||||
{
|
||||
name: "三维场景",
|
||||
list: "/three-dimensional-scene",
|
||||
meta: {
|
||||
icon: <ViewInArIcon />,
|
||||
label: "三维场景",
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(can(permissionCodes.simulationView)
|
||||
? [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user