mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 13:38:13 +00:00
refactor: code organization
This commit is contained in:
@@ -40,22 +40,22 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { useStore } from '../store';
|
||||
import { Availability, HeaderTypes } from '../types/types';
|
||||
import { getAvailabilityValue } from '../types/typeUitls';
|
||||
import RouteList from './RouteList.vue';
|
||||
import { Availability, AvailabilityTypes, HeaderTypes } from '../types/sceneries.types';
|
||||
import { useSceneriesStore } from '../stores/sceneries.store';
|
||||
|
||||
export default defineComponent({
|
||||
components: { RouteList },
|
||||
data() {
|
||||
return {
|
||||
store: useStore(),
|
||||
getAvailabilityValue,
|
||||
sceneriesStore: useSceneriesStore(),
|
||||
HeaderTypes,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
changeList() {
|
||||
return this.store.changeList.map((changeItem) => {
|
||||
return this.sceneriesStore.changeList.map((changeItem) => {
|
||||
return {
|
||||
name: changeItem.name,
|
||||
toRemove: changeItem.toRemove,
|
||||
@@ -66,7 +66,12 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
},
|
||||
components: { RouteList },
|
||||
|
||||
methods: {
|
||||
getAvailabilityValue(availability: Availability) {
|
||||
return AvailabilityTypes[availability];
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user