mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-03 13:38:12 +00:00
Poprawki zapisywania rozkazów i listy
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<transition-group name="list" tag="ul">
|
||||
<li class="no-orders-warning" v-if="sortedOrderList.length == 0" :key="-1">Brak zapisanych rozkazów!</li>
|
||||
|
||||
<li v-for="(order, i) in sortedOrderList" :key="order.id">
|
||||
<b class="text--accent">#{{ sortedOrderList.length - i }} </b>
|
||||
<li v-for="order in sortedOrderList" :selected="order.id == store.chosenLocalOrderId" :key="order.id">
|
||||
<b class="text--accent">#{{ order.id.split('-')[1] }} </b>
|
||||
<b>
|
||||
{{ getOrderName(order.orderType) }} nr {{ order.orderBody['header']['orderNo'] }} dla pociągu nr
|
||||
{{ order.orderBody['header']['trainNo'] }}
|
||||
@@ -84,6 +84,8 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/global.scss';
|
||||
|
||||
.list {
|
||||
&-move,
|
||||
&-enter-active,
|
||||
@@ -125,7 +127,6 @@ li {
|
||||
padding: 1em;
|
||||
margin: 0.5em;
|
||||
background-color: #222;
|
||||
width: 100%;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
@@ -133,6 +134,9 @@ li {
|
||||
margin: 1em 1em 0 0;
|
||||
}
|
||||
|
||||
&[selected='true'] {
|
||||
outline: 1px solid $accentCol;
|
||||
}
|
||||
&.no-orders-warning {
|
||||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<button class="g-button action" @click="saveOrder">Zapisz nowy rozkaz</button>
|
||||
<button class="g-button action" @click="copyMessage">Kopiuj treść rozkazu</button>
|
||||
<button class="g-button action" :data-disabled="!store.chosenLocalOrderId" @click="updateOrder">
|
||||
Zaktualizuj ten rozkaz
|
||||
Zaktualizuj rozkaz
|
||||
<span class="text--accent">{{ store.chosenLocalOrderId && `#${store.chosenLocalOrderId.split('-')[1]}` }} </span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +28,6 @@ import { useStore } from '../store/store';
|
||||
|
||||
import saveIcon from '../assets/icon-save.svg';
|
||||
import orderStorageMixin from '../mixins/orderStorageMixin';
|
||||
import orderFooterMixin from '../mixins/orderFooterMixin';
|
||||
import orderValidationMixin from '../mixins/orderValidationMixin';
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
@@ -67,7 +67,9 @@ export default defineComponent({
|
||||
|
||||
removeLocalOrder(order: LocalStorageOrder) {
|
||||
localStorage.removeItem(order.id);
|
||||
localStorage.setItem('orderCount', (Number(localStorage.getItem('orderCount')) - 1).toString());
|
||||
|
||||
if (this.store.chosenLocalOrderId == order.id) this.store.chosenLocalOrderId = '';
|
||||
// localStorage.setItem('orderCount', (Number(localStorage.getItem('orderCount')) - 1).toString());
|
||||
},
|
||||
|
||||
selectLocalOrder(order: LocalStorageOrder) {
|
||||
@@ -114,8 +116,6 @@ export default defineComponent({
|
||||
(this.store.orderFooter as any)[key] = localOrderFooter[key];
|
||||
}
|
||||
|
||||
console.log(this.store[this.store.chosenOrderType]);
|
||||
|
||||
this.store.orderMode = 'OrderMessage';
|
||||
},
|
||||
},
|
||||
|
||||
@@ -94,10 +94,6 @@ ul {
|
||||
|
||||
list-style: none;
|
||||
text-align: center;
|
||||
|
||||
li {
|
||||
padding: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
// Global scrollbar style
|
||||
|
||||
Reference in New Issue
Block a user