From 5f561607abf371a91e8dfde394acd0901e7c1075 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 26 Jan 2025 18:04:27 +0100 Subject: [PATCH] chore: improved table layout --- src/components/RouteList.vue | 7 ++--- src/components/TableActions.vue | 2 +- src/views/ManagerView.vue | 46 +++++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/components/RouteList.vue b/src/components/RouteList.vue index 2ada204..07a63c9 100644 --- a/src/components/RouteList.vue +++ b/src/components/RouteList.vue @@ -1,6 +1,6 @@ @@ -36,7 +38,6 @@ export default defineComponent({ } &.hidden > .route-name { - // text-decoration: underline; color: #ccc; } } diff --git a/src/components/TableActions.vue b/src/components/TableActions.vue index ea8879f..c5961c8 100644 --- a/src/components/TableActions.vue +++ b/src/components/TableActions.vue @@ -52,7 +52,7 @@
Pokazuj maks. - + wyników
diff --git a/src/views/ManagerView.vue b/src/views/ManagerView.vue index 5d930bf..1e9c27b 100644 --- a/src/views/ManagerView.vue +++ b/src/views/ManagerView.vue @@ -10,21 +10,22 @@
- - - + + + -
{{ header }}DostępnośćUsuń{{ header.value }}DostępnośćUsuń
+ URL URL {{ station[propName] ? 'POKAŻ' : 'DODAJ' }} - - + + {{ station.routesInfo.length }} + {{ station[propName] }} @@ -64,14 +65,13 @@ import changeMixin from '../mixins/changeMixin'; import RoutesModal from '../components/RoutesModal.vue'; import TableActions from '../components/TableActions.vue'; import UpdateCard from '../components/UpdateCard.vue'; -import RouteList from '../components/RouteList.vue'; import { AuthState } from '../types/auth.types'; import { SceneryRowItem, Availability } from '../types/sceneries.types'; import { useSceneriesStore } from '../stores/sceneries.store'; import { useAuthStore } from '../stores/auth.store'; export default defineComponent({ - components: { RoutesModal, TableActions, UpdateCard, RouteList }, + components: { RoutesModal, TableActions, UpdateCard }, mixins: [changeMixin], data: () => ({ @@ -79,6 +79,26 @@ export default defineComponent({ authStore: useAuthStore(), AuthState, + + headers: [ + { id: 'name', value: 'Nazwa', width: 150 }, + { id: 'abbr', value: 'Skrót post.', width: 60 }, + { id: 'hash', value: 'Hash', width: 120 }, + { id: 'url', value: 'URL', width: 80 }, + { id: 'projectUrl', value: 'URL projektu', width: 80 }, + { id: 'lines', value: 'Linie', width: 80 }, + { id: 'project', value: 'Projekt', width: 100 }, + { id: 'reqLevel', value: 'Wym. poziom', width: 80 }, + { id: 'signalType', value: 'Sygnalizacja', width: 150 }, + { id: 'controlType', value: 'Sterowanie', width: 180 }, + { id: 'SUP', value: 'SUP', width: 70 }, + { id: 'ASDEK', value: 'ASDEK', width: 70 }, + { id: 'authors', value: 'Autorzy', width: 200 }, + { id: 'routes', value: 'Szlaki', width: 70 }, + { id: 'checkpoints', value: 'Posterunki', width: 100 }, + { id: 'hidden', value: 'Ukryty', width: 80 }, + ], + headerNameList: { name: 'Nazwa', abbr: 'Skrót posterunku', @@ -130,7 +150,7 @@ export default defineComponent({ return; } - let newValue = prompt(`Zmień wartość dla rubryki ${this.headerNameList[propertyName]}`, oldValue || ''); + let newValue = prompt(`Zmień wartość dla rubryki ${this.headers.find(h => h.id === propertyName)?.value ?? ''}`, oldValue || ''); if (newValue == null) return; (this.sceneriesStore.stationList[stationListRow] as any)[propertyName] = typeof oldValue === 'number' ? parseInt(newValue) : newValue; // this.$set(this.stationList[stationListRow], propertyName, parseInt(newValue)); @@ -173,17 +193,18 @@ export default defineComponent({