123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- import { Mode, PointInfo, Pos } from "@/sdk/types";
- import { stackFactory, Stack, fastStacksValue, os } from "@/utils/vue";
- import { Ref, ref } from "vue";
- import {FixPoint} from "@/store/fixPoint";
- import {BasePoint} from "@/store/basePoint";
- export enum DisabledCom {
- Search = "search",
- TabSwitch = "switch",
- MouseMenu = "mouseMenu",
- CustomMouseMenu = "cMoseMenu",
- ResidenMouseMenu = "rMouseMenu",
- Hot = "hot",
- HotInfo = "hotInfo",
- Measure = "measure",
- Map = "map",
- Clound = "clound",
- Coord = "coord",
- Save = "save",
- LaserLoading = "laserLoading",
- tool = "tool",
- floors = "floors",
- lmenu = "lmenu",
- autoLeave = "autoLeave",
- Mode = 'mode',
- photo = 'photo'
- }
- export const searchDisabledStack = stackFactory(ref(false));
- export const tabSwitchDisabledStack = stackFactory(ref(false));
- export const mouseMenuDisabledStack = stackFactory(ref(false));
- export const customMouseMenuDisabledStack = stackFactory(ref(false));
- export const residenMouseMenuDisapbedStack = stackFactory(ref(false));
- export const hotDisabledStack = stackFactory(ref(false));
- export const hotInfoDisabledStack = stackFactory(ref(false));
- export const measureDisabledStack = stackFactory(ref(true));
- export const mapDisabledStack = stackFactory(ref(true));
- export const cloundDisabledStack = stackFactory(ref(false));
- export const coordDisabledStack = stackFactory(ref(true));
- export const saveDisabledStack = stackFactory(ref(false));
- export const laserLoadingDisabled = stackFactory(ref(true));
- export const toolDisabled = stackFactory(ref(false));
- export const floorsDisabled = stackFactory(ref(false));
- export const lmenuDisabled = stackFactory(ref(false));
- export const autoLeaveDisabled = stackFactory(ref(false));
- export const modeDisabled = stackFactory(ref(false));
- export const photoDisabled= stackFactory(ref(false));
- export const disabledMapStack = {
- [DisabledCom.Search]: searchDisabledStack,
- [DisabledCom.TabSwitch]: tabSwitchDisabledStack,
- [DisabledCom.MouseMenu]: mouseMenuDisabledStack,
- [DisabledCom.ResidenMouseMenu]: residenMouseMenuDisapbedStack,
- [DisabledCom.CustomMouseMenu]: customMouseMenuDisabledStack,
- [DisabledCom.Hot]: hotDisabledStack,
- [DisabledCom.Measure]: measureDisabledStack,
- [DisabledCom.Map]: mapDisabledStack,
- [DisabledCom.Clound]: cloundDisabledStack,
- [DisabledCom.Coord]: coordDisabledStack,
- [DisabledCom.Save]: saveDisabledStack,
- [DisabledCom.LaserLoading]: laserLoadingDisabled,
- [DisabledCom.HotInfo]: hotInfoDisabledStack,
- [DisabledCom.HotInfo]: hotInfoDisabledStack,
- [DisabledCom.tool]: toolDisabled,
- [DisabledCom.floors]: floorsDisabled,
- [DisabledCom.lmenu]: lmenuDisabled,
- [DisabledCom.autoLeave]: autoLeaveDisabled,
- [DisabledCom.Mode]: modeDisabled,
- [DisabledCom.photo]: photoDisabled,
- } as { [key in DisabledCom]: Stack<Ref<boolean>> };
- export type DisabledMapStack = typeof disabledMapStack;
- export const disabledMap = fastStacksValue(disabledMapStack);
- export enum CustomCom {
- LaserMode = "mode",
- FullView = "full",
- SpiltView = "split",
- MagnifierMode = "magnifier",
- CustomMouseMenu = "cMoseMenu",
- ActiveFixPoint = "activeFixPoint",
- ActiveBasePoint = "activeBasePoint",
- ResidenMouseMenu = "rMouseMenu",
- CarryView = "carryView",
- SysView = "sysView",
- boxWidth = "boxWidth",
- autoMarginLeft = "autoMarginLeft",
- fullCtrl = "fullCtrl",
- }
- export enum RightMenuEum {
- NavStart = "NavStart",
- NavEnd = "NavEnd",
- MeasureStart = "MeasureStart",
- AddHot = "AddHot",
- DownClund = "DownClund",
- }
- export type RightMenuAtom = {
- key?: RightMenuEum | string;
- icon: string;
- label: string;
- color?: string;
- custDisabled?: boolean;
- mapDisabled?: boolean;
- sceneDisabled?: boolean;
- disabled?: boolean;
- click: (pos: PointInfo, screen: Pos, inMap: boolean) => void;
- };
- export type RightMenus = Array<RightMenuAtom>;
- export type FullViewMode = "scene" | "map";
- export type CarryViewMode = "full" | "auto" | "auto not-left";
- export type SysViewMode = "full" | "auto";
- export const laserModeStack = stackFactory(ref<Mode>(Mode.pano));
- export const fullViewStack = stackFactory(ref<FullViewMode>("scene"));
- export const spiltViewModeStack = stackFactory(ref<number>(null));
- export const magnifierModeStack = stackFactory(ref<boolean>(false));
- export const residenMouseMenuStack = stackFactory(ref<RightMenus>([]));
- export const customMouseMenuStack = stackFactory(ref<RightMenus>([]));
- export const carryViewStack = stackFactory(ref<CarryViewMode>("full"));
- export const sysViewStack = stackFactory(ref<SysViewMode>("auto"));
- export const boxWidthStack = stackFactory(
- ref<string>(os.isPc ? "" : "calc(100% - var(--editor-menu-width))")
- );
- export const autoSysViewLeftStack = stackFactory(ref<string>("70px"));
- export const controlFullStack = stackFactory(ref<boolean>(false));
- export const activeFixPointStack = stackFactory(ref<FixPoint>());
- export const activeBasePointStack = stackFactory(ref<BasePoint>());
- export const customMapStack = {
- [CustomCom.LaserMode]: laserModeStack,
- [CustomCom.FullView]: fullViewStack,
- [CustomCom.SpiltView]: spiltViewModeStack,
- [CustomCom.ActiveFixPoint]: activeFixPointStack,
- [CustomCom.ActiveBasePoint]: activeBasePointStack,
- [CustomCom.MagnifierMode]: magnifierModeStack,
- [CustomCom.ResidenMouseMenu]: residenMouseMenuStack,
- [CustomCom.CustomMouseMenu]: customMouseMenuStack,
- [CustomCom.CarryView]: carryViewStack,
- [CustomCom.SysView]: sysViewStack,
- [CustomCom.boxWidth]: boxWidthStack,
- [CustomCom.autoMarginLeft]: autoSysViewLeftStack,
- [CustomCom.fullCtrl]: controlFullStack,
- };
- export type CustomMapStack = typeof customMapStack;
- export const customMap = fastStacksValue(customMapStack);
|