@@ -244,10 +260,14 @@ import {
ArrowPathIcon,
ArrowUpTrayIcon,
ArrowUturnLeftIcon,
+ BookmarkIcon,
ChevronDownIcon,
ChevronUpIcon,
ClipboardDocumentIcon,
+ FolderPlusIcon,
+ ClipboardDocumentCheckIcon,
TrashIcon,
+ DocumentDuplicateIcon,
} from '@heroicons/vue/20/solid';
export default defineComponent({
@@ -255,13 +275,17 @@ export default defineComponent({
components: {
StockThumbnails,
Checkbox,
+ FolderPlusIcon,
ArrowDownTrayIcon,
ArrowPathIcon,
ArrowUpTrayIcon,
ArrowUturnLeftIcon,
+ BookmarkIcon,
ChevronDownIcon,
ChevronUpIcon,
ClipboardDocumentIcon,
+ ClipboardDocumentCheckIcon,
+ DocumentDuplicateIcon,
TrashIcon,
},
@@ -289,7 +313,6 @@ export default defineComponent({
return this.store.realCompositionList.find((rc) => rc.stockString == currentStockString);
},
-
stockIsEmpty() {
return this.store.stockList.length == 0;
},
@@ -495,6 +518,30 @@ export default defineComponent({
inputEl.value = '';
},
+ saveStockDataToStorage() {
+ if (this.store.stockList.length == 0) return;
+
+ const defaultName = `${this.store.stockList[0].vehicleRef.type} ${(this.store.totalWeight / 1000).toFixed(1)}t; ${this.store.totalLength}m; vmax ${this.store.maxStockSpeed}`;
+ const entryName = prompt(this.$t('stocklist.prompt-bookmark'), defaultName);
+
+ if (!entryName) return;
+
+ if (entryName in this.store.storageStockData) {
+ const overwriteData = confirm(this.$t('stocklist.prompt-bookmark-overwrite'));
+
+ if (!overwriteData) return;
+ }
+
+ this.store.storageStockData[entryName] = this.store.stockString;
+
+ try {
+ localStorage.setItem('savedStockData', JSON.stringify(this.store.storageStockData));
+ this.store.chosenStorageStockName = entryName;
+ } catch (error) {
+ console.error('Wystąpił błąd podczas zapisywania składu do localStorage!', error);
+ }
+ },
+
async uploadStockFromClipboard() {
try {
const content = await navigator.clipboard.readText();
@@ -588,7 +635,7 @@ export default defineComponent({
display: grid;
gap: 0.5em;
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
button {
width: 100%;
diff --git a/src/components/tabs/StorageTab.vue b/src/components/tabs/StorageTab.vue
index 3caab16..18d6d40 100644
--- a/src/components/tabs/StorageTab.vue
+++ b/src/components/tabs/StorageTab.vue
@@ -6,91 +6,106 @@
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+ {{
+ stockString
+ .split(';')
+ .map((s) => s.split(/:|,/)[0])
+ .join(' + ')
+ }}
+
+
+
+