diff --git a/src/components/OrderS.vue b/src/components/OrderS.vue index 8f488b9..44fdbbf 100644 --- a/src/components/OrderS.vue +++ b/src/components/OrderS.vue @@ -214,10 +214,15 @@
Inne:
- zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr - , maksymalnie do - km szlaku. Powrót odbędzie się na - + + + + po torze szlakowym nr + do kilometra + . Powrót odbędzie się na + . + do godziny
@@ -317,12 +322,19 @@ export default defineComponent({ () => { const row = order.rows[3]; - if (row.w5.enabled) - return `Inne: zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr ${ - row.w5.trackNo || '_' - }, maksymalnie do ${row.w5.maxKm || '_'} km szlaku. Powrót odbędzie się na ${row.w5.returnWay || '_'} ${ - row.w5.returnWay.includes('tarczy') ? row.w5.tmName || '_' : '' - } do godziny ${row.w5.maxHour || '_'}`; + if (row.w5.enabled) { + const { borderType, trackNo, maxHour, maxKm, returnWay, tmName } = row.w5; + const textArray = []; + + textArray.push('Inne: zezwalam na wyjazd poza', borderType || '_', 'po torze szlakowym nr', trackNo || '_'); + if (maxKm) textArray.push(`do kilometra ${maxKm}`); + textArray.push('.'); + textArray.push('Powrót odbędzie się na', returnWay || '_'); + if (returnWay.includes('tarczy')) textArray.push(tmName || '_'); + textArray.push(`do godziny ${maxHour || '_'}`); + + return textArray.join(' ').replace(/ \./, '.'); + } return `Inne: ${row.content}`; }, diff --git a/src/store/store.ts b/src/store/store.ts index 2da327a..d5f37de 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -180,6 +180,8 @@ export const useStore = defineStore('store', { w5: { enabled: false, maxHour: '', + borderType: 'wskaźnik przetaczania W5', + tmName: '', maxKm: '', returnWay: 'sygnał ręczny "Do mnie"', trackNo: '', @@ -192,3 +194,4 @@ export const useStore = defineStore('store', { }); + diff --git a/src/types/orderTypes.ts b/src/types/orderTypes.ts index a381a50..ade7190 100644 --- a/src/types/orderTypes.ts +++ b/src/types/orderTypes.ts @@ -110,6 +110,7 @@ export interface IOrderS { w5: { enabled: boolean; + borderType: string; trackNo: string; maxKm: string; returnWay: string; @@ -173,3 +174,4 @@ export interface IOrderO { other: string; } +