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

33 lines
678 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);
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,
toggleDrawer,
setDrawerOpen,
2026-07-10 17:56:16 +08:00
mapType,
mapSwitchCompletedTick,
markMapSwitchCompleted
2026-04-02 08:56:49 +08:00
};
});