WholeProcessPlatform/frontend/src/store/modules/ui.ts

39 lines
905 B
TypeScript
Raw Normal View History

2026-04-02 08:56:49 +08:00
import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useUiStore = defineStore('ui', () => {
// 右侧抽屉状态
const drawerOpen = ref(true);
const mapType = ref('2D');
2026-07-10 17:56:16 +08:00
const mapSwitchCompletedTick = ref(0);
// 3d 流域三维漫游
const isRoaming = ref(false);
// dim 切换时跳过漫游相机还原(由地图模式切换自行处理)
const skipRoamCameraRestore = ref(false);
2026-04-02 08:56:49 +08:00
// 切换抽屉状态
const toggleDrawer = () => {
drawerOpen.value = !drawerOpen.value;
};
// 设置抽屉状态
const setDrawerOpen = (open: boolean) => {
drawerOpen.value = open;
};
2026-07-10 17:56:16 +08:00
const markMapSwitchCompleted = () => {
mapSwitchCompletedTick.value += 1;
};
2026-04-02 08:56:49 +08:00
return {
drawerOpen,
isRoaming,
skipRoamCameraRestore,
2026-04-02 08:56:49 +08:00
toggleDrawer,
setDrawerOpen,
2026-07-10 17:56:16 +08:00
mapType,
mapSwitchCompletedTick,
markMapSwitchCompleted
2026-04-02 08:56:49 +08:00
};
});