mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 20:18:12 +00:00
hotfixy komponentów
This commit is contained in:
+4
-2
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<ImageFullscreenPreview />
|
<AppModals />
|
||||||
|
<ImageFullscreenPreview v-if="store.vehiclePreviewSrc" />
|
||||||
<AppContainerView />
|
<AppContainerView />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -8,6 +9,7 @@ import { defineComponent } from 'vue';
|
|||||||
import { useStore } from './store';
|
import { useStore } from './store';
|
||||||
import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue';
|
import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue';
|
||||||
import AppContainerView from './views/AppContainerView.vue';
|
import AppContainerView from './views/AppContainerView.vue';
|
||||||
|
import AppModals from './components/app/AppModals.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
@@ -24,7 +26,7 @@ export default defineComponent({
|
|||||||
this.store.fetchStockInfoData();
|
this.store.fetchStockInfoData();
|
||||||
this.store.handleRouting();
|
this.store.handleRouting();
|
||||||
},
|
},
|
||||||
components: { ImageFullscreenPreview, AppContainerView },
|
components: { ImageFullscreenPreview, AppContainerView, AppModals },
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="g-card-dimmer" @click="store.isRealStockListCardOpen = false"></div>
|
|
||||||
|
|
||||||
<div class="real-stock-card g-card" @keydown.esc="store.isRealStockListCardOpen = false">
|
<div class="real-stock-card g-card" @keydown.esc="store.isRealStockListCardOpen = false">
|
||||||
<div class="g-card_bg" @click="store.isRealStockListCardOpen = false"></div>
|
<div class="g-card_bg" @click="store.isRealStockListCardOpen = false"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<div class="section_modes">
|
<div class="section_modes">
|
||||||
<button
|
<button
|
||||||
class="btn"
|
class="btn"
|
||||||
v-for="(id, name) in sectionModes"
|
v-for="(id, name, i) in sectionModes"
|
||||||
@click="chooseSection(id)"
|
@click="chooseSection(id)"
|
||||||
:data-selected="store.stockSectionMode == id"
|
:data-selected="store.stockSectionMode == id"
|
||||||
>
|
>
|
||||||
{{ name }}
|
<span class="text--accent">{{ i + 1 }}.</span> {{ name }}
|
||||||
<span v-if="id == 'stock-list'">({{ store.stockList.length }})</span>
|
<span v-if="id == 'stock-list'">({{ store.stockList.length }})</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, KeepAlive } from 'vue';
|
import { computed, KeepAlive, onMounted } from 'vue';
|
||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
import StockListTab from '../tabs/StockListTab.vue';
|
import StockListTab from '../tabs/StockListTab.vue';
|
||||||
import StockGeneratorTab from '../tabs/StockGeneratorTab.vue';
|
import StockGeneratorTab from '../tabs/StockGeneratorTab.vue';
|
||||||
@@ -38,6 +38,13 @@ const sectionModes: { [key: string]: SectionMode } = {
|
|||||||
'GNR SKŁADU': 'stock-generator',
|
'GNR SKŁADU': 'stock-generator',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sectionKeyIndexes: { [key: string]: SectionMode } = {
|
||||||
|
'1': 'stock-list',
|
||||||
|
'2': 'wiki-list',
|
||||||
|
'3': 'number-generator',
|
||||||
|
'4': 'stock-generator',
|
||||||
|
};
|
||||||
|
|
||||||
const chosenSectionComponent = computed(() => {
|
const chosenSectionComponent = computed(() => {
|
||||||
switch (store.stockSectionMode) {
|
switch (store.stockSectionMode) {
|
||||||
case 'stock-list':
|
case 'stock-list':
|
||||||
@@ -60,6 +67,14 @@ const chosenSectionComponent = computed(() => {
|
|||||||
function chooseSection(sectionId: SectionMode) {
|
function chooseSection(sectionId: SectionMode) {
|
||||||
store.stockSectionMode = sectionId;
|
store.stockSectionMode = sectionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
window.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key == '1' || e.key == '2' || e.key == '3' || e.key == '4') {
|
||||||
|
store.stockSectionMode = sectionKeyIndexes[e.key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export default defineComponent({
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: zoom-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-message,
|
.empty-message,
|
||||||
|
|||||||
@@ -26,7 +26,13 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody v-if="wikiMode == 'locomotives'">
|
<tbody v-if="wikiMode == 'locomotives'">
|
||||||
<tr v-for="loco in computedLocoList" @click="previewLocomotive(loco)" @dblclick="addLocomotive(loco)">
|
<tr
|
||||||
|
v-for="loco in computedLocoList"
|
||||||
|
@click="previewLocomotive(loco)"
|
||||||
|
@keydown.enter="previewLocomotive(loco)"
|
||||||
|
@dblclick="addLocomotive(loco)"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
<td>
|
<td>
|
||||||
<img
|
<img
|
||||||
:src="`https://spythere.github.io/api/td2/images/${loco.type}--300px.jpg`"
|
:src="`https://spythere.github.io/api/td2/images/${loco.type}--300px.jpg`"
|
||||||
@@ -45,7 +51,13 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
<tbody v-else>
|
<tbody v-else>
|
||||||
<tr v-for="car in computedCarList" @click="previewCarWagon(car)" @dblclick="addCarWagon(car)">
|
<tr
|
||||||
|
v-for="car in computedCarList"
|
||||||
|
@keydow.enter="previewCarWagon(car)"
|
||||||
|
@click="previewCarWagon(car)"
|
||||||
|
@dblclick="addCarWagon(car)"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
<td>
|
<td>
|
||||||
<img
|
<img
|
||||||
:src="`https://spythere.github.io/api/td2/images/${car.type}--300px.jpg`"
|
:src="`https://spythere.github.io/api/td2/images/${car.type}--300px.jpg`"
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="image-preview" v-if="store.vehiclePreviewSrc">
|
<div
|
||||||
|
class="image-preview"
|
||||||
|
@click="store.vehiclePreviewSrc = ''"
|
||||||
|
@keydown.esc="store.vehiclePreviewSrc = ''"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
<img :src="store.vehiclePreviewSrc" alt="preview" />
|
<img :src="store.vehiclePreviewSrc" alt="preview" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -14,6 +19,10 @@ export default defineComponent({
|
|||||||
store: useStore(),
|
store: useStore(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$el.focus();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -32,10 +41,12 @@ export default defineComponent({
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
background: rgba(black, 0.85);
|
background: rgba(black, 0.85);
|
||||||
|
cursor: zoom-out;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 90%;
|
max-width: 100%;
|
||||||
max-width: 800px;
|
height: auto;
|
||||||
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user