mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-03 05:28:13 +00:00
Navbar dla OrderMessage i OrderList
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
<br />
|
<br />
|
||||||
Dodano: {{ new Date(order.createdAt).toLocaleString('pl-PL') }}
|
Dodano: {{ new Date(order.createdAt).toLocaleString('pl-PL') }}
|
||||||
<br />
|
<br />
|
||||||
<button class="g-button" @click="selectLocalOrder(order)">Wybierz</button>
|
<button class="g-button action" @click="selectLocalOrder(order)">Wybierz</button>
|
||||||
<button class="g-button" @click="removeOrder(order)">Usuń</button>
|
<button class="g-button action" @click="removeOrder(order)">Usuń</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
<div class="message_body" v-html="fullOrderMessage"></div>
|
<div class="message_body" v-html="fullOrderMessage"></div>
|
||||||
|
|
||||||
<div class="message_actions">
|
<div class="message_actions">
|
||||||
<button class="g-button" @click="saveOrder"><img :src="saveIcon" alt="save icon" />Zapisz ten rozkaz</button>
|
<button class="g-button action" @click="saveOrder"><img :src="saveIcon" alt="save icon" />Zapisz ten rozkaz</button>
|
||||||
<button class="g-button" @click="copyMessage">Kopiuj wiadomość rozkazu</button>
|
<button class="g-button action" @click="copyMessage">Kopiuj wiadomość rozkazu</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<transition name="monit-anim">
|
<transition name="monit-anim">
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="sidebar">
|
<section class="sidebar">
|
||||||
<div class="sidebar_content">
|
<div class="sidebar_content">
|
||||||
<button class="option-save" @click="toggleOrderMode" :data-selected="store.orderMode == 'OrderList'">
|
<!-- <button class="option-save" @click="toggleOrderMode" :data-selected="store.orderMode == 'OrderList'">
|
||||||
<img :src="saveIcon" alt="save icon" />
|
<img :src="saveIcon" alt="save icon" />
|
||||||
</button>
|
</button> -->
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-for="orderType in orderTypeList"
|
v-for="orderType in orderTypeList"
|
||||||
@@ -23,13 +23,9 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useStore } from '../store/store';
|
import { useStore } from '../store/store';
|
||||||
|
|
||||||
import saveIcon from '../assets/icon-save.svg';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
saveIcon,
|
|
||||||
|
|
||||||
orderTypeList: [
|
orderTypeList: [
|
||||||
{
|
{
|
||||||
id: 'orderN',
|
id: 'orderN',
|
||||||
@@ -56,10 +52,6 @@ export default defineComponent({
|
|||||||
selectOrderType(type: any) {
|
selectOrderType(type: any) {
|
||||||
this.store.chosenOrderType = type;
|
this.store.chosenOrderType = type;
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleOrderMode() {
|
|
||||||
this.store.orderMode = this.store.orderMode == 'OrderMessage' ? 'OrderList' : 'OrderMessage';
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
selectLocalOrder(order: LocalStorageOrder) {
|
selectLocalOrder(order: LocalStorageOrder) {
|
||||||
this.store.chosenOrderType = order.orderType;
|
this.store.chosenOrderType = order.orderType;
|
||||||
|
|
||||||
const localOrder = JSON.parse(JSON.stringify(order));
|
const localOrder = JSON.parse(JSON.stringify(order));
|
||||||
const localOrderBody = localOrder['orderBody'];
|
const localOrderBody = localOrder['orderBody'];
|
||||||
const localOrderFooter = localOrder['orderFooter'];
|
const localOrderFooter = localOrder['orderFooter'];
|
||||||
@@ -105,6 +106,8 @@ export default defineComponent({
|
|||||||
for (let key in this.store.orderFooter) {
|
for (let key in this.store.orderFooter) {
|
||||||
(this.store.orderFooter as any)[key] = localOrderFooter[key];
|
(this.store.orderFooter as any)[key] = localOrderFooter[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.store.orderMode = 'OrderMessage';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+17
-6
@@ -26,22 +26,33 @@ button {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
&.g-button {
|
button.g-button {
|
||||||
outline: 2px solid white;
|
text-align: center;
|
||||||
background: none;
|
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
text-align: center;
|
&.action {
|
||||||
|
outline: 2px solid white;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
outline: 2px solid $accentCol;
|
outline: 2px solid $accentCol;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.option {
|
||||||
|
margin: 0 0.25em;
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline: 1px solid $accentCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-active='true'] {
|
||||||
color: $accentCol;
|
color: $accentCol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Text styles
|
// Text styles
|
||||||
.text {
|
.text {
|
||||||
|
|||||||
+44
-1
@@ -8,6 +8,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="message_container">
|
<div class="message_container">
|
||||||
|
<div class="message_nav">
|
||||||
|
<span v-for="(action, i) in navActions">
|
||||||
|
<b v-if="i > 0">•</b>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="g-button option"
|
||||||
|
:data-active="store.orderMode == action.mode"
|
||||||
|
@click="selectOrderMode(action.mode)"
|
||||||
|
>
|
||||||
|
{{ action.value }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<transition name="order-anim" mode="out-in">
|
<transition name="order-anim" mode="out-in">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<Component :is="orderModeComponent" />
|
<Component :is="orderModeComponent" />
|
||||||
@@ -29,6 +43,29 @@ import { useStore } from '../store/store';
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { OrderVue, SideBar },
|
components: { OrderVue, SideBar },
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
navActions: [
|
||||||
|
{
|
||||||
|
mode: 'OrderMessage',
|
||||||
|
value: 'TREŚĆ ROZKAZU',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mode: 'OrderList',
|
||||||
|
value: 'ZAPISANE ROZKAZY',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
selectOrderMode(mode: string) {
|
||||||
|
console.log(mode);
|
||||||
|
|
||||||
|
this.store.orderMode = mode;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
store: useStore(),
|
store: useStore(),
|
||||||
@@ -74,12 +111,18 @@ export default defineComponent({
|
|||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|
||||||
@media screen and (max-width: 550px) {
|
@media screen and (max-width: 550px) {
|
||||||
margin: 0.5em;
|
margin: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.message_container {
|
.message_container {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message_nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user