|
@@ -1,33 +1,37 @@
|
|
|
-import { stackFactory, flatStacksValue, strToParams } from '@/utils'
|
|
|
-import { reactive, ref } from 'vue'
|
|
|
+import { stackFactory, flatStacksValue, strToParams } from "@/utils";
|
|
|
+import { reactive, ref } from "vue";
|
|
|
|
|
|
-import type { FuseModel, Path, TaggingPosition, View } from '@/store'
|
|
|
-export const namespace = '/fusion'
|
|
|
-export const viewModeStack = stackFactory(ref<'full' | 'auto'>('auto'))
|
|
|
-export const showToolbarStack = stackFactory(ref<boolean>(false))
|
|
|
-export const showHeadBarStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showRightPanoStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showLeftPanoStack = stackFactory(ref<boolean>(false))
|
|
|
-export const moundLeftPanoStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showLeftCtrlPanoStack = stackFactory(ref<boolean>(true))
|
|
|
+import type { FuseModel, Path, TaggingPosition, View } from "@/store";
|
|
|
+export const namespace = "/fusion";
|
|
|
+export const viewModeStack = stackFactory(ref<"full" | "auto">("auto"));
|
|
|
+export const showToolbarStack = stackFactory(ref<boolean>(false));
|
|
|
+export const showHeadBarStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showRightPanoStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showLeftPanoStack = stackFactory(ref<boolean>(false));
|
|
|
+export const moundLeftPanoStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showLeftCtrlPanoStack = stackFactory(ref<boolean>(true));
|
|
|
export const showModeStack = stackFactory(ref<"pano" | "fuse">("fuse"));
|
|
|
-export const showRightCtrlPanoStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showBottomBarStack = stackFactory(ref<boolean>(false), true)
|
|
|
-export const bottomBarHeightStack = stackFactory(ref<string>('60px'))
|
|
|
-export const showTaggingsStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showMonitorsStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showPathsStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showSearchStack = stackFactory(ref<boolean>(true))
|
|
|
-export const showPathStack = stackFactory(ref<Path['id']>())
|
|
|
-export const showMeasuresStack = stackFactory(ref<boolean>(true))
|
|
|
-export const currentModelStack = stackFactory(ref<FuseModel | null>(null))
|
|
|
-export const showModelsMapStack = stackFactory(ref<WeakMap<FuseModel, boolean>>(new Map()), true)
|
|
|
-export const modelsChangeStoreStack = stackFactory(ref<boolean>(false))
|
|
|
-export const showTaggingPositionsStack = stackFactory(ref<WeakSet<TaggingPosition>>(new WeakSet()))
|
|
|
-export const currentViewStack = stackFactory(ref<View>())
|
|
|
+export const showRightCtrlPanoStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showBottomBarStack = stackFactory(ref<boolean>(false), true);
|
|
|
+export const bottomBarHeightStack = stackFactory(ref<string>("60px"));
|
|
|
+export const showTaggingsStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showMonitorsStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showPathsStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showSearchStack = stackFactory(ref<boolean>(true));
|
|
|
+export const showPathStack = stackFactory(ref<Path["id"]>());
|
|
|
+export const showMeasuresStack = stackFactory(ref<boolean>(true));
|
|
|
+export const currentModelStack = stackFactory(ref<FuseModel | null>(null));
|
|
|
+export const showModelsMapStack = stackFactory(
|
|
|
+ ref<WeakMap<FuseModel, boolean>>(new Map()),
|
|
|
+ true
|
|
|
+);
|
|
|
+export const modelsChangeStoreStack = stackFactory(ref<boolean>(false));
|
|
|
+export const showTaggingPositionsStack = stackFactory(
|
|
|
+ ref<WeakSet<TaggingPosition>>(new WeakSet())
|
|
|
+);
|
|
|
+export const currentViewStack = stackFactory(ref<View>());
|
|
|
|
|
|
export const custom = flatStacksValue({
|
|
|
-
|
|
|
viewMode: viewModeStack,
|
|
|
showToolbar: showToolbarStack,
|
|
|
showRightPano: showRightPanoStack,
|
|
@@ -49,38 +53,43 @@ export const custom = flatStacksValue({
|
|
|
showHeadBar: showHeadBarStack,
|
|
|
currentView: currentViewStack,
|
|
|
showMode: showModeStack,
|
|
|
- showSearch: showSearchStack
|
|
|
-})
|
|
|
+ showSearch: showSearchStack,
|
|
|
+});
|
|
|
|
|
|
+export const params = reactive(
|
|
|
+ strToParams(location.search)
|
|
|
+) as unknown as Params;
|
|
|
+params.caseId = Number(params.caseId);
|
|
|
+params.share = Boolean(Number(params.share));
|
|
|
+params.single = Boolean(Number(params.single));
|
|
|
|
|
|
-export const params = reactive(strToParams(location.search)) as unknown as Params
|
|
|
-params.caseId = Number(params.caseId)
|
|
|
-params.share = Boolean(Number(params.share))
|
|
|
-params.single = Boolean(Number(params.single))
|
|
|
+export type Params = {
|
|
|
+ caseId: number;
|
|
|
+ baseURL?: string;
|
|
|
+ modelId?: string;
|
|
|
+ mapKey?: string;
|
|
|
+ mapPlatform?: string;
|
|
|
+ fileUrl?: string;
|
|
|
+ sign?: string;
|
|
|
+ type?: string;
|
|
|
+ testMap?: boolean;
|
|
|
+ title?: string;
|
|
|
+ m?: string;
|
|
|
+ share?: boolean;
|
|
|
+ single?: boolean;
|
|
|
+ token?: string;
|
|
|
+};
|
|
|
|
|
|
-export type Params = {
|
|
|
- caseId: number,
|
|
|
- baseURL?: string,
|
|
|
- modelId?: string,
|
|
|
- fileUrl?: string
|
|
|
- sign?: string
|
|
|
- type?: string
|
|
|
- testMap?: boolean
|
|
|
- title?: string
|
|
|
- m?: string
|
|
|
- share?: boolean,
|
|
|
- single?: boolean
|
|
|
- token?: string
|
|
|
-}
|
|
|
-
|
|
|
-export const baseURL = params.baseURL ? params.baseURL : ''
|
|
|
+export const baseURL = params.baseURL ? params.baseURL : "";
|
|
|
|
|
|
export const getResource = (uri: string) => {
|
|
|
- if (~uri.indexOf('base64') || ~uri.indexOf('bolb') || ~uri.indexOf('//')) return uri
|
|
|
+ if (~uri.indexOf("base64") || ~uri.indexOf("bolb") || ~uri.indexOf("//"))
|
|
|
+ return uri;
|
|
|
|
|
|
- if (uri[0] === '/') {
|
|
|
- return `${baseURL}${uri}`
|
|
|
+ if (uri[0] === "/") {
|
|
|
+ return `${baseURL}${uri}`;
|
|
|
} else {
|
|
|
- return `${baseURL}/${uri}`
|
|
|
+ return `${baseURL}/${uri}`;
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
+
|