新增项目选择弹窗(预设选项),支持变更环境变量
This commit is contained in:
@@ -75,10 +75,6 @@ interface DataContextType {
|
||||
const MapContext = createContext<OlMap | undefined>(undefined);
|
||||
const DataContext = createContext<DataContextType | undefined>(undefined);
|
||||
|
||||
const MAP_EXTENT = config.MAP_EXTENT as [number, number, number, number];
|
||||
const MAP_URL = config.MAP_URL;
|
||||
const MAP_WORKSPACE = config.MAP_WORKSPACE;
|
||||
const MAP_VIEW_STORAGE_KEY = `${MAP_WORKSPACE}_map_view`; // 持久化 key
|
||||
// 添加防抖函数
|
||||
function debounce<F extends (...args: any[]) => any>(func: F, waitFor: number) {
|
||||
let timeout: ReturnType<typeof setTimeout> | null = null;
|
||||
@@ -99,6 +95,11 @@ export const useData = () => {
|
||||
};
|
||||
|
||||
const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
const MAP_EXTENT = config.MAP_EXTENT as [number, number, number, number];
|
||||
const MAP_URL = config.MAP_URL;
|
||||
const MAP_WORKSPACE = config.MAP_WORKSPACE;
|
||||
const MAP_VIEW_STORAGE_KEY = `${MAP_WORKSPACE}_map_view`; // 持久化 key
|
||||
|
||||
const mapRef = useRef<HTMLDivElement | null>(null);
|
||||
const deckLayerRef = useRef<DeckLayer | null>(null);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import routerProvider from "@refinedev/nextjs-router";
|
||||
|
||||
import { ColorModeContextProvider } from "@contexts/color-mode";
|
||||
import { dataProvider } from "@providers/data-provider";
|
||||
import { ProjectProvider } from "@/contexts/ProjectContext";
|
||||
|
||||
import { LiaNetworkWiredSolid } from "react-icons/lia";
|
||||
import { TbDatabaseEdit } from "react-icons/tb";
|
||||
@@ -32,7 +33,9 @@ export const RefineContext = (
|
||||
) => {
|
||||
return (
|
||||
<SessionProvider>
|
||||
<App {...props} />
|
||||
<ProjectProvider>
|
||||
<App {...props} />
|
||||
</ProjectProvider>
|
||||
</SessionProvider>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user