// src/stores/timeCache.ts import { defineStore } from 'pinia' import { RouteLocationNormalizedLoaded } from 'vue-router' // 时间组件的缓存值 用于驾驶舱放大的时候和内部的时间组件同步 interface TimeCacheState { cache: Map } export const useTimeCacheStore = defineStore('timeCache', { state: (): TimeCacheState => ({ cache: new Map() }), actions: { setCache(routePath: string, interval: number | undefined, timeValue: any) { this.cache.set(routePath, { interval, timeValue }) }, getCache(routePath: string) { return this.cache.get(routePath) }, hasCache(routePath: string) { return this.cache.has(routePath) } } })