列车曲线图限制5分钟
This commit is contained in:
parent
cd433e70dc
commit
112223b150
@ -107,6 +107,11 @@ export const useLineStore = defineStore('line', {
|
||||
setTrainStateMap(v: TrainState[]) {
|
||||
const a = new Date();
|
||||
this.trainStateMap.set(a, v);
|
||||
this.trainStateMap.forEach((item, key) => {
|
||||
if (a.getTime() - key.getTime() > 5 * 60 * 1000) {
|
||||
this.trainStateMap.delete(key);
|
||||
}
|
||||
});
|
||||
},
|
||||
clearTrainStateMap() {
|
||||
this.trainStateMap.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user