mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
region query
This commit is contained in:
+11
@@ -100,6 +100,17 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
'$route.query.region': {
|
||||||
|
immediate: true,
|
||||||
|
handler(regionQuery: string) {
|
||||||
|
if (regionQuery) {
|
||||||
|
this.store.region.id = regionQuery;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
changeLang(lang: string) {
|
changeLang(lang: string) {
|
||||||
this.$i18n.locale = lang;
|
this.$i18n.locale = lang;
|
||||||
|
|||||||
+2
-8
@@ -2,25 +2,23 @@ import axios from 'axios';
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { io } from 'socket.io-client';
|
import { io } from 'socket.io-client';
|
||||||
import { DataStatus } from '../scripts/enums/DataStatus';
|
import { DataStatus } from '../scripts/enums/DataStatus';
|
||||||
import StationAPIData from '../scripts/interfaces/api/StationAPIData';
|
|
||||||
import { ScheduledTrain } from '../scripts/interfaces/ScheduledTrain';
|
|
||||||
import Station from '../scripts/interfaces/Station';
|
|
||||||
import StationRoutes from '../scripts/interfaces/StationRoutes';
|
import StationRoutes from '../scripts/interfaces/StationRoutes';
|
||||||
import Train from '../scripts/interfaces/Train';
|
import Train from '../scripts/interfaces/Train';
|
||||||
import { URLs } from '../scripts/utils/apiURLs';
|
import { URLs } from '../scripts/utils/apiURLs';
|
||||||
import {
|
import {
|
||||||
getDispatcherStatus,
|
getDispatcherStatus,
|
||||||
getCheckpointTrain,
|
|
||||||
parseSpawns,
|
parseSpawns,
|
||||||
getScheduledTrains,
|
getScheduledTrains,
|
||||||
getStationTrains
|
getStationTrains
|
||||||
} from '../scripts/utils/storeUtils';
|
} from '../scripts/utils/storeUtils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
APIData,
|
APIData,
|
||||||
OnlineScenery,
|
OnlineScenery,
|
||||||
StationJSONData,
|
StationJSONData,
|
||||||
StoreState
|
StoreState
|
||||||
} from '../scripts/interfaces/store/storeTypes';
|
} from '../scripts/interfaces/store/storeTypes';
|
||||||
|
|
||||||
import packageInfo from '../../package.json';
|
import packageInfo from '../../package.json';
|
||||||
import { RollingStockGithubData } from '../scripts/interfaces/github_api/StockInfoGithubData';
|
import { RollingStockGithubData } from '../scripts/interfaces/github_api/StockInfoGithubData';
|
||||||
|
|
||||||
@@ -342,8 +340,6 @@ export const useStore = defineStore('store', {
|
|||||||
|
|
||||||
async changeRegion(region: StoreState['region']) {
|
async changeRegion(region: StoreState['region']) {
|
||||||
this.region = region;
|
this.region = region;
|
||||||
|
|
||||||
await this.setOnlineData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetchStockInfoData() {
|
async fetchStockInfoData() {
|
||||||
@@ -372,8 +368,6 @@ export const useStore = defineStore('store', {
|
|||||||
this.dataStatuses.dispatchers = !this.apiData.dispatchers
|
this.dataStatuses.dispatchers = !this.apiData.dispatchers
|
||||||
? DataStatus.Warning
|
? DataStatus.Warning
|
||||||
: DataStatus.Loaded;
|
: DataStatus.Loaded;
|
||||||
|
|
||||||
// this.setStationsOnlineInfo();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user