working state

This commit is contained in:
Thomas Mack 2022-03-29 07:56:47 +02:00
parent 5bf5137661
commit c67fcba7f2
41 changed files with 2352 additions and 776 deletions

View File

@ -0,0 +1,74 @@
<template>
<transition
enter-active-class="animate__animated animate__lightSpeedInRight"
mode="out-in"
appear
>
<div class="row" :key="item.id">
<div class="col-12">
<h1 class="mt-4">
Zubehör
<button class="btn btn-lg bg-vue float-end"
>Bearbeiten</button>
</h1>
<div class="card mt-4">
<div class="row no-gutters">
<div class="col-md-4">
<img
src="https://dummyimage.com/600x400/34495e/fff"
class="card-img"
/>
</div>
<div class="col-md-8">
<div class="card-body">
<InventoryItemHead :item="item"></InventoryItemHead>
<InventoryItemCollectionInfo :item="item"></InventoryItemCollectionInfo>
<InventoryItemDescription :item="item"></InventoryItemDescription>
</div>
</div>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
import { mapGetters} from "vuex";
import Set from "@/store/classes/Set";
import InventoryItemDescription from "@/components/camera/parts/InventoryItemDescription";
import InventoryItemCollectionInfo from "@/components/camera/parts/InventoryItemCollectionInfo";
import InventoryItemHead from "@/components/camera/parts/InventoryItemHead";
export default {
name: "AccessoireReadDetail",
components: {
InventoryItemHead,
InventoryItemDescription,
InventoryItemCollectionInfo
},
props: {
item: {
type:Set,
required: true
}
},
computed: {
...mapGetters(["activeItem"]),
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@ -51,7 +51,7 @@
<label for="condition">Zustand</label>
</div>
<div class="col-9">
<Field name="condition" class="form-select" v-model="activCamer.condition_key" id="condition" as="select">
<Field name="condition" class="form-select" v-model="activeCamera.condition_key" id="condition" as="select">
<option v-for="condition in conditions" :key="condition.schluessel" :value="condition.schluessel" >{{condition.name}}</option>
<small class="text-danger" v-if="errors.condition">{{errors.condition}}</small>
</Field>
@ -63,7 +63,7 @@
<label for="buildtype">Bauform</label>
</div>
<div class="col-9">
<Field name="buildtype" class=" form-select" v-model="activeCamer.buildtype_key" id="buildtype" as="select">
<Field name="buildtype" class=" form-select" v-model="activeCamera.buildtype_key" id="buildtype" as="select">
<option v-for="buildtype in buildtypes" :key="buildtype.schluessel" :value="buildtype.schluessel" >{{buildtype.name}}</option>
<small class="text-danger" v-if="errors.buildtype">{{errors.buildtype}}</small>
</Field>

View File

@ -1,59 +0,0 @@
<template>
<div class="container ">
<div class="">
Wir haben {{ cameras.length }} in der Liste
<input type="text" name="searchstring" v-model="searchText">
</div>
<section>
<div v-for="camera in filteredCameras" :key="camera.id">
<component
:is="componentName"
:camera=camera
:key="camera.id"
></component>
</div>
</section>
</div>
</template>
<script>
import CameraListItem from "@/components/camera/CameraListItem";
export default {
name: "CameraList",
components: {
CameraListItem
},
props: {
cameras: {
type: Object,
required: true
}
},
data() {
return {
searchText: "",
orderBy: "name",
orderDirection: "acs"
}
},
computed: {
componentName() {
return "CameraListItem";
},
filteredCameras() {
if (this.searchText === "") return this.cameras;
else {
return this.cameras.filter((camera) => camera.name.toLowerCase().includes(this.searchText.toLowerCase()));
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -1,64 +0,0 @@
<template>
<transition
enter-active-class="animate__animated animate__fadeIn"
leave-active-class="animate__animated animate__fadeOut"
mode="out-in"
appear
>
<div class="card mt-3"
@click="toggleActive"
:key="camera.id"
>
<div class="card-header col-md-12"
:class="getActiveStyle"
>
<div class="row">
<div class="col-md-8">{{ camera.name }}</div>
<div class="col-md-4 text-end">{{ camera.year_of_purchase }}</div>
</div>
</div>
<div class="card-body" :class="`${getActiveStyle}`">
{{camera.year_of_production}}
</div>
</div>
</transition>
</template>
<script>
export default {
name: "CameraListItem",
props: {
camera: {
type:Object,
required: true
}
},
computed: {
getActiveStyle() {
if(this.isActive) return ["bg-primary"] ;
else return ["bg-secondary"];
},
isActive() {
const activeCamera = this.$store.getters.activeCamera;
if(activeCamera && activeCamera.id === this.camera.id) return true;
else return false;
}
},
methods: {
toggleActive() {
console.log("click toggleActive ")
this.$store.dispatch("setCameraActiveState", {cameraId: this.camera.id , active:!this.isActive})
}
}
}
</script>
<style scoped>
</style>

View File

@ -6,10 +6,10 @@
appear
>
<div class="row" :key="activeCamera.id">
<div class="row" :key="item.id">
<div class="col-12">
<h1 class="mt-4">
Neuer Artikel
Kamera
<button class="btn btn-lg bg-vue float-end"
@click="editCamera"
>Bearbeiten</button>
@ -25,23 +25,11 @@
</div>
<div class="col-md-8">
<div class="card-body">
<div class="row">
<div class="col-9">
<h5 class="card-title mb-4">{{ activeCamera.name }}</h5>
</div>
<div class="col-3">
<div class="d-grid">
<button class="btn bg-vue2"
> </button>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
Lorem
</div>
</div>
<InventoryItemHead :item="item"></InventoryItemHead>
<InventoryItemCollectionInfo :item="item"></InventoryItemCollectionInfo>
<InventoryItemDescription :item="item"></InventoryItemDescription>
</div>
</div>
</div>
@ -53,11 +41,26 @@
<script>
import { mapGetters} from "vuex";
import Camera from "@/store/classes/Camera";
import InventoryItemDescription from "@/components/camera/parts/InventoryItemDescription";
import InventoryItemHead from "@/components/camera/parts/InventoryItemHead";
import InventoryItemCollectionInfo from "@/components/camera/parts/InventoryItemCollectionInfo";
export default {
name: "CameraReadDetail",
components: {
InventoryItemDescription,
InventoryItemCollectionInfo,
InventoryItemHead
},
props: {
item: {
type:Camera,
required: true
}
},
computed: {
...mapGetters(["activeCamera"]),
...mapGetters(["activeItem"]),
},
methods: {
editCamera() {

View File

@ -0,0 +1,107 @@
<template>
<div class="container ">
<div class="row">
Wir haben {{ items.length }} in der Liste
<input type="text" name="searchstring" v-model="searchText">
</div>
<div class="row mt-3">
<FilterButtonItemType
itemType="camera"
typeName="Kamera"
icon="fa-camera"
:active="isFilterByType('camera')"
@click="setFilterByType('camera')"
></FilterButtonItemType>
<FilterButtonItemType
itemType="lens"
typeName="Objektiv"
:active="isFilterByType('lens')"
@click="setFilterByType('lens')"
icon="fa-aperture"
></FilterButtonItemType>
<FilterButtonItemType
itemType="accessoire"
typeName="'Zubehör'"
:active="isFilterByType('accessoire')"
@click="setFilterByType('accessoire')"
icon="fa-telescope"
></FilterButtonItemType>
<FilterButtonItemType
itemType="set"
typeName="Set"
:active="isFilterByType('set')"
@click="setFilterByType('set')"
icon="fa-box-open-full"
></FilterButtonItemType>
</div>
<div class="row" >
<component
:is="componentName"
:item=item
v-for="item in filteredItems" :key="item.id"
></component>
</div>
</div>
</template>
<script>
import InventoryListItem from "@/components/camera/InventoryListItem";
import FilterButtonItemType from "@/components/camera/parts/FilterButtonItemType";
export default {
name: "InventoryList",
components: {
InventoryListItem,
FilterButtonItemType
},
props: {
items: {
type: Array,
required: true
}
},
data() {
return {
searchText: "",
orderBy: "name",
orderDirection: "acs",
filterByType: ""
}
},
computed: {
componentName() {
return "InventoryListItem";
},
filteredItems() {
if (this.searchText === "" && this.filterByType=== "") return this.items;
else {
return this.items.filter((item) => {
if(this.filterByType === "") return item.name.toLowerCase().includes(this.searchText.toLowerCase());
else return item.item_type === this.filterByType && item.name.toLowerCase().includes(this.searchText.toLowerCase())
});
}
}
},
methods: {
setFilterByType(itemType) {
if(this.filterByType === itemType) this.filterByType = "";
this.filterByType = itemType;
},
isFilterByType(itemType) {
return this.filterByType === itemType
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,88 @@
<template>
<transition
enter-active-class="animate__animated animate__fadeIn"
leave-active-class="animate__animated animate__fadeOut"
mode="out-in"
appear
>
<div class="card mt-3" :class="`${getActiveStyle}`"
@click="toggleActive"
:key="item.id"
>
<div class="row no-gutters">
<div class="col-3 text-center ">
<i class="mx-2 mt-3 text-sm-center " :class="`${getIconClass}`"></i>
</div>
<div class="col-9 bg-white text-black">
<div class="col-md-12"
>
<div class="row mt-2 bottom-50">
<div class="col-md-8 "> {{ item.name }}</div>
<div class="col-md-4 text-end"><i class="fa-solid fa-tag text-black-50"></i> {{ item.inventory_number }}</div>
</div>
</div>
<div class="card-body">
<small> {{shortDescription}} </small>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
import InventoryItem from "@/store/classes/InventoryItem";
export default {
name: "InventoryListItem",
props: {
item: {
type:InventoryItem,
required: true
}
},
computed: {
getIconClass() {
const icons = ["fa-solid", "fa-3x"];
if(this.item.item_type === "camera") icons.push("fa-camera");
else if(this.item.item_type === "set") icons.push("fa-box-open-full");
else if(this.item.item_type === "lens") icons.push("fa-aperture");
else if(this.item.item_type === "accessoire") icons.push("fa-telescope");
else icons.push("fa-circle-question");
return icons.join(' ');
},
getActiveStyle() {
if(this.isActive) return ["bg-primary"] ;
else return ["bg-secondary"];
},
isActive() {
const activeItem = this.$store.getters.activeItem;
if(activeItem && activeItem.id === this.item.id) return true;
else return false;
},
shortDescription() {
if(typeof this.item.description == "undefined") return "";
else if(this.item.description.length > 40) return this.item.description.slice(0, 40)+ "...";
else if( this.item.description) return this.item.description;
return "";
}
},
methods: {
toggleActive() {
console.log("click toggleActive ")
this.$store.dispatch("setItemActiveState", {id: this.item.id , active:!this.isActive})
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,153 @@
<template>
<transition
enter-active-class="animate__animated animate__lightSpeedInRight"
mode="out-in"
appear
>
<div class="row" :key="item.id">
<div class="col-12">
<h1 class="mt-4">
Objektiv
<button class="btn btn-lg bg-vue float-end"
@click="editCamera"
>Bearbeiten
</button>
</h1>
<div class="card mt-4">
<div class="row no-gutters">
<div class="col-md-4">
<img
src="https://dummyimage.com/600x400/34495e/fff"
class="card-img"
/>
</div>
<div class="col-md-8">
<div class="card-body">
<InventoryItemHead :item="item"></InventoryItemHead>
<div v-if="true" class="card">
<div class="card-header"> Technische Details</div>
<div class="card-body">
<div v-if="true" class="row">
<div class="col-6">
Marke
</div>
<div class="col-6">
{{ brand(item.brand_key).name }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Hersteller
</div>
<div class="col-6">
{{ manufacturer(item.manufacturer_key).name }}
</div>
</div>
<div v-if="false" class="row">
<div class="col-6">
Lichtstärke
</div>
<div class="col-6">
{{ item.aperture_max }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Brennweite
</div>
<div class="col-3">
{{ item.focal_length_min }}
</div>
<div class="col-3">
{{ item.focal_length_max }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Autofocus
</div>
<div class="col-6">
{{ item.autofocus }}
</div>
</div>
<div v-if="item.mount_key" class="row">
<div class="col-6">
Anschluss
</div>
<div class="col-6">
{{ mount(item.mount_key).name }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Baujahr
</div>
<div class="col-6">
{{ item.year_of_production }}
</div>
</div>
</div>
</div>
<InventoryItemCollectionInfo :item="item"></InventoryItemCollectionInfo>
<InventoryItemDescription :item="item"></InventoryItemDescription>
</div>
</div>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
import { mapGetters} from "vuex";
import Lens from "@/store/classes/Lens";
import InventoryItemDescription from "@/components/camera/parts/InventoryItemDescription";
import InventoryItemCollectionInfo from "@/components/camera/parts/InventoryItemCollectionInfo";
import InventoryItemHead from "@/components/camera/parts/InventoryItemHead";
export default {
name: "CameraReadDetail",
components: {
InventoryItemHead,
InventoryItemDescription,
InventoryItemCollectionInfo
},
props: {
item: {
type:Lens,
required: true
}
},
computed: {
...mapGetters(["activeItem", "brand", "manufacturer", "mount"]),
getConditionName() {
if(this.item.condition_key) return this.$store.getters.condition(this.item.condition_key).name || "";
else return "-"
}
},
methods: {
editCamera() {
this.$store.dispatch("setCameraEditState", {cameraId:this.activeCamera.id, edit:true})
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,74 @@
<template>
<transition
enter-active-class="animate__animated animate__lightSpeedInRight"
mode="out-in"
appear
>
<div class="row" :key="item.id">
<div class="col-12">
<h1 class="mt-4">
Set
<button class="btn btn-lg bg-vue float-end"
>Bearbeiten</button>
</h1>
<div class="card mt-4">
<div class="row no-gutters">
<div class="col-md-4">
<img
src="https://dummyimage.com/600x400/34495e/fff"
class="card-img"
/>
</div>
<div class="col-md-8">
<div class="card-body">
<InventoryItemHead :item="item"></InventoryItemHead>
<InventoryItemCollectionInfo :item="item"></InventoryItemCollectionInfo>
<InventoryItemDescription :item="item"></InventoryItemDescription>
</div>
</div>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
import { mapGetters} from "vuex";
import Set from "@/store/classes/Set";
import InventoryItemDescription from "@/components/camera/parts/InventoryItemDescription";
import InventoryItemCollectionInfo from "@/components/camera/parts/InventoryItemCollectionInfo";
import InventoryItemHead from "@/components/camera/parts/InventoryItemHead";
export default {
name: "SetReadDetail",
components: {
InventoryItemHead,
InventoryItemDescription,
InventoryItemCollectionInfo
},
props: {
item: {
type:Set,
required: true
}
},
computed: {
...mapGetters(["activeItem"]),
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,47 @@
<template>
<div class="col-3">
<div class="card">
<!-- <div class="card-header text-black" style="font-size: 10px">{{typeName}}</div>-->
<div class="card-body " :class="cardStyle"
:title="typeName">
<i class="fa-solid fa-2x text-white" :class="this.icon"></i>
</div>
</div>
</div>
</template>
<script>
export default {
name: "FilterButtonItemType",
props: {
itemType: {
type: String,
required: true
},
icon: {
type: String,
required: true
},
typeName: {
type: String,
required: true
},
active: {
type: Boolean,
required: true
}
},
computed: {
cardStyle() {
console.log(this.itemType, this.active);
if(!this.active) return ["bg-secondary"]
else return ["bg-primary"]
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,72 @@
<template>
<div class="card mt-2">
<div class="card-header">Sammlung</div>
<div class="card-body">
<div class="row">
<div class="col-6">
Jahr des Kaufs
</div>
<div class="col-6">
{{ item.year_of_purchase }}
</div>
</div>
<div v-if="item.condition_key" class="row">
<div class="col-6">
Zustand
</div>
<div class="col-6">
{{ condition(item.condition_key).name }}
</div>
</div>
<div class="row">
<div class="col-6">
Kaufpreis
</div>
<div class="col-6">
{{ item.price_purchased }}
</div>
</div>
<div class="row">
<div class="col-6">
Zeitwert
</div>
<div class="col-6">
{{ item.price_purchased }}
</div>
</div>
<div class="row">
<div class="col-6">
hist. Kaufpreis
</div>
<div class="col-6">
{{ item.price_historic }}
</div>
</div>
</div>
</div>
</template>
<script>
import InventoryItem from "@/store/classes/InventoryItem";
import {mapGetters} from "vuex";
export default {
name: "InventoryItemCollectionInfo",
computed: {
...mapGetters(["condition"])
},
props: {
item: {
type: InventoryItem,
required: true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,39 @@
<template>
<div class="row">
<div class="col-12">
<div v-if="true" class="card mt-2">
<div class="card-header">Besonderheiten</div>
<div class="card-body">
{{ item.description }}
</div>
</div>
<div class="card mt-2">
<div class="card-header">Ausgeführte Arbeiten</div>
<div class="card-body">
{{ item.work_done }}
</div>
</div>
</div>
</div>
</template>
<script>
import InventoryItem from "@/store/classes/InventoryItem";
export default {
name: "InventoryItemDescription",
props: {
item: {
type: InventoryItem,
required: true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,33 @@
<template>
<div class="row">
<div class="col-9">
<h5 class="card-title mb-4">{{ item.name }}</h5>
</div>
<div class="col-3">
<div class="d-grid">
<button class="btn bg-primary text-white">
<i class="fa-solid fa-tag"></i> {{ item.inventory_number}}
</button>
</div>
</div>
</div>
</template>
<script>
import InventoryItem from "@/store/classes/InventoryItem";
export default {
name: "InventoryItemHead",
props: {
item: {
type: InventoryItem,
required: true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,87 @@
<template>
<div class="card">
<div class="card-header"> Technische Details</div>
<div class="card-body">
<div v-if="item.brand_key" class="row">
<div class="col-6">
Marke
</div>
<div class="col-6">
{{ brand(item.brand_key).name }}
</div>
</div>
<div v-if="item.manufacturer_key" class="row">
<div class="col-6">
Hersteller
</div>
<div class="col-6">
{{ manufacturer(item.manufacturer_key).name }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Lichtstärke
</div>
<div class="col-6">
{{ item.aperture_max }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Brennweite
</div>
<div class="col-3">
{{ item.focal_length_min }}
</div>
<div class="col-3">
{{ item.focal_length_max }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Autofocus
</div>
<div class="col-6">
{{ item.autofocus }}
</div>
</div>
<div v-if="item.mount_key" class="row">
<div class="col-6">
Anschluss
</div>
<div class="col-6">
{{ mount(item.mount_key).name }}
</div>
</div>
<div v-if="true" class="row">
<div class="col-6">
Baujahr
</div>
<div class="col-6">
{{ item.year_of_production }}
</div>
</div>
</div>
</div>
</template>
<script>
import {mapGetters} from "vuex";
export default {
name: "LensTechnicalDetail",
computed: {
...mapGetters(["activeItem", "brand", "manufacturer", "mount"]),
}
}
</script>
<style scoped>
</style>

View File

@ -21,10 +21,14 @@ export default class BilliDB {
console.log("onupgradeneeded");
// @ts-ignore
const db = e.target.result;
db.createObjectStore("cameras", { autoIncrement: false, keyPath: 'id' });
db.createObjectStore("brands", { autoIncrement: false, keyPath: 'schluessel' });
db.createObjectStore("conditions", { autoIncrement: false, keyPath: 'schluessel' });
db.createObjectStore("buildtypes", { autoIncrement: false, keyPath: 'schluessel' });
db.createObjectStore("inventory", { autoIncrement: false, keyPath: 'id' });
db.createObjectStore("sets", { autoIncrement: false, keyPath: 'id' });
db.createObjectStore("conditions", { autoIncrement: false, keyPath: 'key' });
db.createObjectStore("buildtypes", { autoIncrement: false, keyPath: 'key' });
db.createObjectStore("mounts", { autoIncrement: false, keyPath: 'key' });
db.createObjectStore("brands", { autoIncrement: false, keyPath: 'key' });
db.createObjectStore("manufacturers", { autoIncrement: false, keyPath: 'key' });
db.createObjectStore("medias", { autoIncrement: false, keyPath: 'key' });
};
});
}

File diff suppressed because one or more lines are too long

View File

@ -30,10 +30,16 @@ export default class BilliDB {
console.log("onupgradeneeded");
// @ts-ignore
const db = e.target.result;
db.createObjectStore("cameras", {autoIncrement: false, keyPath: 'id'});
db.createObjectStore("brands", {autoIncrement: false, keyPath: 'schluessel'});
db.createObjectStore("conditions", {autoIncrement: false, keyPath: 'schluessel'});
db.createObjectStore("buildtypes", {autoIncrement: false, keyPath: 'schluessel'});
db.createObjectStore("inventory", {autoIncrement: false, keyPath: 'id'});
db.createObjectStore("sets", {autoIncrement: false, keyPath: 'id'});
db.createObjectStore("conditions", {autoIncrement: false, keyPath: 'key'});
db.createObjectStore("buildtypes", {autoIncrement: false, keyPath: 'key'});
db.createObjectStore("mounts", {autoIncrement: false, keyPath: 'key'});
db.createObjectStore("brands", {autoIncrement: false, keyPath: 'key'});
db.createObjectStore("manufacturers", {autoIncrement: false, keyPath: 'key'});
db.createObjectStore("medias", {autoIncrement: false, keyPath: 'key'});
}
})
}
@ -105,16 +111,16 @@ export default class BilliDB {
})
}
async getItems(storeId:string) {
console.log("DB-getItems", storeId)
const db = await this.getDb();
return new Promise((resolve, reject) => {
console.log("DB-getItems: Starting Get Transaction");
const items = [];
// @ts-ignore
const trans = db.transaction([storeId], 'readonly');
trans.oncomplete = (e) => {
console.log(`${storeId}: oncomplete`, items.length)
resolve(items);
};
@ -123,18 +129,14 @@ export default class BilliDB {
reject(e);
};
const store = trans.objectStore(storeId);
console.log("--> We have try to get a cursor");
store.openCursor().onsuccess = (e) => {
console.log("--> We have a cursor", e.target.result);
const cursor = e.target.result;
if(cursor) {
items.push(cursor.value);
cursor.continue();
}
console.log("onsuccess on getAll", items)
// resolve(e.target.result);
}

View File

@ -5,12 +5,30 @@
:fullsize="true"
>
<template #leftCol>
<div v-if="activeCamera && activeCamera.edit">
<div v-if="activeItem && activeItem.edit">
<CameraEditDetail></CameraEditDetail>
</div>
<div v-else-if="activeCamera">
<CameraReadDetail></CameraReadDetail>
<div v-else-if="activeItem && activeItem.item_type === 'camera'">
<CameraReadDetail :item="activeItem"></CameraReadDetail>
</div>
<div v-else-if="activeItem && activeItem.item_type === 'lens'">
<LensReadDetail :item="activeItem"></LensReadDetail>
</div>
<div v-else-if="activeItem && activeItem.item_type === 'set'">
<SetReadDetail :item="activeItem"></SetReadDetail>
</div>
<div v-else-if="activeItem && activeItem.item_type === 'accessoire'">
<AccessoireReadDetail :item="activeItem"></AccessoireReadDetail>
</div>
<!-- <component-->
<!-- :is="componentName"-->
<!-- :item="activeItem"-->
<!-- v-if="activeItem"-->
<!-- ></component>-->
<div v-else>
<h2>Bitte wählen sie eine Kamera aus der Liste</h2>
</div>
@ -18,7 +36,7 @@
</template>
<template #rightCol>
<CameraList :cameras="cameras"></CameraList>
<InventoryList :items="inventory"></InventoryList>
</template>
@ -27,36 +45,58 @@
<script>
import TheCameraLayout from "@/layouts/TheCameraLayout";
import CameraList from "@/components/camera/CameraList";
import InventoryList from "@/components/camera/InventoryList";
import CameraReadDetail from "@/components/camera/CameraReadDetail";
import CameraEditDetail from "@/components/camera/CameraEditDetail";
import LensReadDetail from "@/components/camera/LensReadDetail";
import SetReadDetail from "@/components/camera/SetReadDetail";
import AccessoireReadDetail from "@/components/camera/AccessoireReadDetail";
import {mapGetters} from "vuex";
export default {
name: "ReadListPage",
components: {
CameraList,
InventoryList,
TheCameraLayout,
CameraReadDetail,
CameraEditDetail
CameraEditDetail,
LensReadDetail,
SetReadDetail,
AccessoireReadDetail
},
computed: {
...mapGetters(["activeCamera"]),
...mapGetters([ "inventory"]),
activeItem() {
return this.$store.getters.activeItem;
},
storeIsInitialized( ) {
return this.$store.getters.isInitialized;
},
cameras() {
return this.$store.getters.cameras;
componentName() {
switch(this.activeItem.item_type) {
case "lens":
return "LensReadDetail";
case "set":
return "SetReadDetail";
case "accessoire":
return "AccessoireReadDetail";
case "camera":
return "CameraReadDetail"
}
return "AccessoireReadDetail";
},
},
beforeCreate() {
async beforeCreate() {
console.log("beforeCreate", this.$store.getters.isInitialized);
if(!this.$store.getters.isInitialized) {
console.log("Not yet initialized")
this.$store.dispatch("initialize", {seed: true});
await this.$store.dispatch("initialize", {seed: true});
}
},
data() {

View File

@ -1,275 +1,403 @@
export const SEED_VERSION = 1;
export const conditions = [
{ schluessel: "neu", name: "neu", beschreibung: '' },
{ schluessel: "neuwertig", name: "neuwertig", beschreibung: '' },
{ schluessel: "lg", name: "leichte Gebrauchsspuren", beschreibung: '' },
{ schluessel: "mg", name: "mittlere Gebrauchsspuren", beschreibung: '' },
{ schluessel: "ag", name: "abgenutzt", beschreibung: '' },
{ schluessel: "eg", name: "eingeschränkte Funktion", beschreibung: '' },
{ schluessel: "defekt", name: "defekt", beschreibung: '' },
export const SEED_VERSION = 2;
export const medias = [
{ key: "kb", name: "Kleinbild", description: '' },
{ key: "rf9x9", name: "Rollfilm 9x9", description: '' },
{ key: "rf6x9", name: "Rollfilm 9x9", description: '' },
{ key: "SD", name: "SD-Card", description: '' },
{ key: "microSD", name: "microSD-Card", description: '' },
{ key: "miniSD", name: "miniSD-Card", description: '' },
];
export const buildtype = [
{ schluessel: "box", name: "Box", beschreibung: '' },
{ schluessel: "kb", name: "Kleinbildkamera", beschreibung: '' },
{ schluessel: "slr", name: "Spiegelreflex", beschreibung: '' },
{ schluessel: "dslr", name: "Digitale Spiegelreflex", beschreibung: '' },
{ schluessel: "mf", name: "Mittelformat", beschreibung: '' },
{ schluessel: "gf", name: "Großformat", beschreibung: '' },
{ schluessel: "aps", name: "Digitalkamera", beschreibung: '' },
{ schluessel: "holz", name: "Holzkamera", beschreibung: '' },
{ schluessel: "platte", name: "Plattenkamera", beschreibung: '' },
{ schluessel: "fach", name: "Fachkamera", beschreibung: '' },
{ schluessel: "lf", name: "Lichtfeldkamera", beschreibung: '' },
{ schluessel: "balg", name: "Balgenkamera", beschreibung: '' },
{ schluessel: "sof", name: "Sofortbild", beschreibung: '' },
export const batteries = [
{ key: "aaa", name: "AAA", description: '' },
{ key: "aa", name: "AA", description: '' },
{ key: "spezial", name: "SpezialAkku", description: '' },
];
export const mounts = [
{ key: "a-mount", name: "A-Mount", description: '' },
{ key: "e-mount", name: "E-Mount", description: '' },
{ key: "ef-bajonett", name: "EF-Bajonett", description: '' },
];
export const conditions = [
{ key: "neu", name: "neu", description: '' },
{ key: "neuwertig", name: "neuwertig", description: '' },
{ key: "lg", name: "leichte Gebrauchsspuren", description: '' },
{ key: "mg", name: "mittlere Gebrauchsspuren", description: '' },
{ key: "ag", name: "abgenutzt", description: '' },
{ key: "eg", name: "eingeschränkte Funktion", description: '' },
{ key: "defekt", name: "defekt", description: '' },
];
export const buildtypes = [
{ key: "box", name: "Box", description: '' },
{ key: "kb", name: "Kleinbildkamera", description: '' },
{ key: "slr", name: "Spiegelreflex", description: '' },
{ key: "dslr", name: "Digitale Spiegelreflex", description: '' },
{ key: "mf", name: "Mittelformat", description: '' },
{ key: "gf", name: "Großformat", description: '' },
{ key: "aps", name: "Digitalkamera", description: '' },
{ key: "holz", name: "Holzkamera", description: '' },
{ key: "platte", name: "Plattenkamera", description: '' },
{ key: "fach", name: "Fachkamera", description: '' },
{ key: "lf", name: "Lichtfeldkamera", description: '' },
{ key: "balg", name: "Balgenkamera", description: '' },
{ key: "sof", name: "Sofortbild", description: '' },
];
export const brands = [
{ schluessel: 'agfa', name: 'Agfa', beschreibung: 'Filme aller Art sowie analoge Kameras' },
{ schluessel: 'alpa', name: 'Alpa', beschreibung: 'Mittelformat analog/digital (früher Kleinbild).' },
{ schluessel: 'arca_swiss', name: 'Arca-Swiss', beschreibung: 'Großformatkameras.' },
{ schluessel: 'bilora', name: 'Bilora', beschreibung: 'Kleinbildkameras.' },
{ schluessel: 'braun_photo_technik', name: 'Braun Photo Technik', beschreibung: 'Kameras, Diaprojektoren' },
{ schluessel: 'bronica', name: 'Bronica', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'cambo', name: 'Cambo', beschreibung: 'Großformatkameras.' },
{ schluessel: 'camogli', name: 'Camogli', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'canham_cameras', name: 'Canham Cameras', beschreibung: 'Großformatkameras.' },
{ schluessel: 'canon', name: 'Canon', beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive.' },
{ schluessel: 'carena', name: 'Carena', beschreibung: 'Kleinbildkameras, Objektive' },
{ schluessel: 'casio', name: 'Casio', beschreibung: 'Digitalkameras.' },
{ schluessel: 'chinon', name: 'Chinon', beschreibung: 'Digitalkameras, Kleinbildkameras.' },
{ key: 'agfa', name: 'Agfa', description: 'Filme aller Art sowie analoge Kameras' },
{ key: 'alpa', name: 'Alpa', description: 'Mittelformat analog/digital (früher Kleinbild).' },
{ key: 'arca_swiss', name: 'Arca-Swiss', description: 'Großformatkameras.' },
{ key: 'bilora', name: 'Bilora', description: 'Kleinbildkameras.' },
{ key: 'braun_photo_technik', name: 'Braun Photo Technik', description: 'Kameras, Diaprojektoren' },
{ key: 'bronica', name: 'Bronica', description: 'Mittelformatkameras.' },
{ key: 'cambo', name: 'Cambo', description: 'Großformatkameras.' },
{ key: 'camogli', name: 'Camogli', description: 'Mittelformatkameras.' },
{ key: 'canham_cameras', name: 'Canham Cameras', description: 'Großformatkameras.' },
{ key: 'canon', name: 'Canon', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive.' },
{ key: 'carena', name: 'Carena', description: 'Kleinbildkameras, Objektive' },
{ key: 'casio', name: 'Casio', description: 'Digitalkameras.' },
{ key: 'chinon', name: 'Chinon', description: 'Digitalkameras, Kleinbildkameras.' },
{
schluessel: 'contax',
key: 'contax',
name: 'Contax',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{ schluessel: 'dr_gilde', name: 'Dr. Gilde', beschreibung: 'Mittelformatkameras.' },
{ key: 'dr_gilde', name: 'Dr. Gilde', description: 'Mittelformatkameras.' },
{
schluessel: 'dhw_fototechnik',
key: 'dhw_fototechnik',
name: 'DHW Fototechnik',
beschreibung: 'digitale und analoge Mittelformatkameras, TLR Mittelformatkameras, Fachkameras, Kleinbildkameras'
description: 'digitale und analoge Mittelformatkameras, TLR Mittelformatkameras, Fachkameras, Kleinbildkameras'
},
{ schluessel: 'epson', name: 'Epson', beschreibung: 'Digitalkameras.' },
{ key: 'epson', name: 'Epson', description: 'Digitalkameras.' },
{
schluessel: 'ernemann_Werke_AG',
key: 'ernemann_Werke_AG',
name: 'Ernemann-Werke AG',
beschreibung: 'Kinoprojektoren und Kameras, darunter die Ermanox mit damals lichtstärkstem Serienobjektiv der Welt'
description: 'Kinoprojektoren und Kameras, darunter die Ermanox mit damals lichtstärkstem Serienobjektiv der Welt'
},
{ schluessel: 'fed', name: 'FED', beschreibung: 'Kleinbildkameras.' },
{ key: 'fed', name: 'FED', description: 'Kleinbildkameras.' },
{
schluessel: 'fujifilm',
key: 'fujifilm',
name: 'Fujifilm',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{ schluessel: 'fandolfi', name: 'Gandolfi', beschreibung: 'Großformatkameras.' },
{ schluessel: 'fottschalt', name: 'Gottschalt', beschreibung: 'Fachkameras.' },
{ schluessel: 'hasselblad', name: 'Hasselblad', beschreibung: 'Kleinbildkameras, Mittelformatkameras.' },
{ schluessel: 'hitachi', name: 'Hitachi', beschreibung: 'Digitalkameras.' },
{ schluessel: 'hewlett-Packard (HP)', name: 'Hewlett-Packard (HP)', beschreibung: 'Digitalkameras.' },
{ schluessel: 'horseman', name: 'Horseman', beschreibung: 'Großformatkameras, Mittelformatkameras.' },
{ schluessel: 'ihagee', name: 'Ihagee', beschreibung: 'Kleinbildkameras (Bezeichnungen Exa und Exakta).' },
{ schluessel: 'jenoptik', name: 'Jenoptik', beschreibung: 'Digitalkameras.' },
{ schluessel: 'jvc', name: 'JVC', beschreibung: 'Digitalkameras.' },
{ schluessel: 'kalimar', name: 'Kalimar', beschreibung: 'Kleinbildkameras, Mittelformatkameras, Objektive.' },
{ key: 'fandolfi', name: 'Gandolfi', description: 'Großformatkameras.' },
{ key: 'fottschalt', name: 'Gottschalt', description: 'Fachkameras.' },
{ key: 'hasselblad', name: 'Hasselblad', description: 'Kleinbildkameras, Mittelformatkameras.' },
{ key: 'hitachi', name: 'Hitachi', description: 'Digitalkameras.' },
{ key: 'hewlett-Packard (HP)', name: 'Hewlett-Packard (HP)', description: 'Digitalkameras.' },
{ key: 'horseman', name: 'Horseman', description: 'Großformatkameras, Mittelformatkameras.' },
{ key: 'ihagee', name: 'Ihagee', description: 'Kleinbildkameras (Bezeichnungen Exa und Exakta).' },
{ key: 'jenoptik', name: 'Jenoptik', description: 'Digitalkameras.' },
{ key: 'jvc', name: 'JVC', description: 'Digitalkameras.' },
{ key: 'kalimar', name: 'Kalimar', description: 'Kleinbildkameras, Mittelformatkameras, Objektive.' },
{
schluessel: 'kamera_werk_dresden',
key: 'kamera_werk_dresden',
name: 'Kamera Werk Dresden',
beschreibung: 'Panoramakameras für Kleinbild und Mittelformat (Bezeichnung Noblex).'
description: 'Panoramakameras für Kleinbild und Mittelformat (Bezeichnung Noblex).'
},
{ schluessel: 'kiev', name: 'Kiev', beschreibung: 'Mittelformatkameras, Kleinbildkameras.' },
{ schluessel: 'kodak', name: 'Kodak', beschreibung: 'APS-Kameras, Kleinbildkameras, Digitalkameras.' },
{ key: 'kiev', name: 'Kiev', description: 'Mittelformatkameras, Kleinbildkameras.' },
{ key: 'kodak', name: 'Kodak', description: 'APS-Kameras, Kleinbildkameras, Digitalkameras.' },
{
schluessel: 'konica',
key: 'konica',
name: 'Konica',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{
schluessel: 'konica_minolta',
key: 'konica_minolta',
name: 'Konica Minolta',
beschreibung: 'Fusion aus Konica und Minolta; Digitalkameras, Objektive.'
description: 'Fusion aus Konica und Minolta; Digitalkameras, Objektive.'
},
{ schluessel: 'kōwa', name: 'Kōwa', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'kyocera', name: 'Kyocera', beschreibung: '(siehe auch Yashica und Contax): Digitalkameras.' },
{ schluessel: 'leaf', name: 'Leaf', beschreibung: 'Digitale Rückwände für Mittelformatkameras.' },
{ key: 'kōwa', name: 'Kōwa', description: 'Mittelformatkameras.' },
{ key: 'kyocera', name: 'Kyocera', description: '(siehe auch Yashica und Contax): Digitalkameras.' },
{ key: 'leaf', name: 'Leaf', description: 'Digitale Rückwände für Mittelformatkameras.' },
{
schluessel: 'leica',
key: 'leica',
name: 'Leica',
beschreibung: 'APS-Kameras, Analogkameras, Digitalkameras, Kleinbildkameras.'
description: 'APS-Kameras, Analogkameras, Digitalkameras, Kleinbildkameras.'
},
{ schluessel: 'linhof', name: 'Linhof', beschreibung: 'Großformatkameras, Mittelformatkameras.' },
{ schluessel: 'lomo', name: 'Lomo', beschreibung: 'analoge Kleinbildsucherkameras.' },
{ schluessel: 'lotus_view', name: 'Lotus-View', beschreibung: 'Großformatkameras.' },
{ schluessel: 'mamiya', name: 'Mamiya', beschreibung: 'Kleinbildkameras, Mittelformatkameras, Digitalkameras' },
{ schluessel: 'meyer_optik', name: 'Meyer-Optik', beschreibung: 'v. a. Objektive' },
{ key: 'linhof', name: 'Linhof', description: 'Großformatkameras, Mittelformatkameras.' },
{ key: 'lomo', name: 'Lomo', description: 'analoge Kleinbildsucherkameras.' },
{ key: 'lotus_view', name: 'Lotus-View', description: 'Großformatkameras.' },
{ key: 'mamiya', name: 'Mamiya', description: 'Kleinbildkameras, Mittelformatkameras, Digitalkameras' },
{ key: 'meyer_optik', name: 'Meyer-Optik', description: 'v. a. Objektive' },
{
schluessel: 'minolta',
key: 'minolta',
name: 'Minolta',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{ schluessel: 'minox', name: 'Minox', beschreibung: 'Digitalkameras, Kleinbildkameras.' },
{ schluessel: 'mustek', name: 'Mustek', beschreibung: 'Digitalkameras.' },
{ key: 'minox', name: 'Minox', description: 'Digitalkameras, Kleinbildkameras.' },
{ key: 'mustek', name: 'Mustek', description: 'Digitalkameras.' },
{
schluessel: 'nikon',
key: 'nikon',
name: 'Nikon',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive für GF-Kameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive für GF-Kameras.'
},
{ schluessel: 'olympus', name: 'Olympus', beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras.' },
{ schluessel: 'panasonic', name: 'Panasonic', beschreibung: 'Digitalkameras, Smartphones.' },
{ key: 'olympus', name: 'Olympus', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras.' },
{ key: 'panasonic', name: 'Panasonic', description: 'Digitalkameras, Smartphones.' },
{
schluessel: 'pentacon',
key: 'pentacon',
name: 'Pentacon',
beschreibung: 'Digitalkameras, Kleinbildkameras (Bezeichnung Praktica), früher auch Mittelformatkameras.'
description: 'Digitalkameras, Kleinbildkameras (Bezeichnung Praktica), früher auch Mittelformatkameras.'
},
{ schluessel: 'pentax', name: 'Pentax', beschreibung: 'Digitalkameras, Kleinbildkameras, Mittelformatkameras.' },
{ schluessel: 'phase_one', name: 'Phase One', beschreibung: 'Digitalkameras (digitaler Rückteile).' },
{ schluessel: 'plaubel', name: 'Plaubel', beschreibung: 'Großformatkameras' },
{ schluessel: 'polaroid', name: 'Polaroid', beschreibung: 'Digitalkameras, Sofortbildsysteme chemisch.' },
{ schluessel: 'rbt', name: 'RBT', beschreibung: 'Stereokameras und Projektoren.' },
{ key: 'pentax', name: 'Pentax', description: 'Digitalkameras, Kleinbildkameras, Mittelformatkameras.' },
{ key: 'phase_one', name: 'Phase One', description: 'Digitalkameras (digitaler Rückteile).' },
{ key: 'plaubel', name: 'Plaubel', description: 'Großformatkameras' },
{ key: 'polaroid', name: 'Polaroid', description: 'Digitalkameras, Sofortbildsysteme chemisch.' },
{ key: 'rbt', name: 'RBT', description: 'Stereokameras und Projektoren.' },
{
schluessel: 'reflekta_kamerawerk_tharandt',
key: 'reflekta_kamerawerk_tharandt',
name: 'Reflekta-Kamerawerk Tharandt',
beschreibung: 'TLR Mittelformatkameras, Reflekta'
description: 'TLR Mittelformatkameras, Reflekta'
},
{ schluessel: 'ricoh', name: 'Ricoh', beschreibung: 'Digitalkameras, Kleinbildkameras.' },
{ schluessel: 'rheinmetall', name: 'Rheinmetall', beschreibung: 'Kleinbildkameras EXA, Exakta' },
{ key: 'ricoh', name: 'Ricoh', description: 'Digitalkameras, Kleinbildkameras.' },
{ key: 'rheinmetall', name: 'Rheinmetall', description: 'Kleinbildkameras EXA, Exakta' },
{
schluessel: 'rollei',
key: 'rollei',
name: 'Rollei',
beschreibung: 'Digitalkameras, Kleinbildkameras, digitale und analoge Mittelformatkameras, TLR Mittelformatkameras.'
description: 'Digitalkameras, Kleinbildkameras, digitale und analoge Mittelformatkameras, TLR Mittelformatkameras.'
},
{
schluessel: 'sakar_international',
key: 'sakar_international',
name: 'Sakar International',
beschreibung: 'Zubehör, Digitalkameras, Marken Vivitar, Kodak'
description: 'Zubehör, Digitalkameras, Marken Vivitar, Kodak'
},
{ schluessel: 'salyut', name: 'Salyut', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'samsung', name: 'Samsung', beschreibung: 'Digitalkameras, Kleinbildkameras.' },
{ schluessel: 'sanyo', name: 'Sanyo', beschreibung: 'Digitalkameras.' },
{ schluessel: 'sigma', name: 'Sigma', beschreibung: 'Digitalkameras, Kleinbildkameras, Objektive.' },
{ schluessel: 'silvestri', name: 'Silvestri', beschreibung: 'Großformatkameras.' },
{ schluessel: 'sinar', name: 'Sinar', beschreibung: 'Digitalkameras, Großformatkameras.' },
{ schluessel: 'sony', name: 'Sony', beschreibung: 'Digitalkameras, Objektive.' },
{ schluessel: 'tachihara', name: 'Tachihara', beschreibung: 'Mittelformatkameras' },
{ schluessel: 'tamron', name: 'Tamron', beschreibung: 'Objektive' },
{ schluessel: 'teamwork', name: 'Teamwork', beschreibung: 'Mittelformatkameras' },
{ schluessel: 'tokina', name: 'Tokina', beschreibung: 'Objektive' },
{ schluessel: 'topcon', name: 'Topcon', beschreibung: 'Kleinbildkameras' },
{ schluessel: 'toshiba', name: 'Toshiba', beschreibung: 'Digitalkameras, Großformatkameras' },
{ schluessel: 'toyo', name: 'Toyo', beschreibung: 'Großformatkameras' },
{ schluessel: 'yashica', name: 'Yashica', beschreibung: 'Digitalkameras, Kleinbildkameras.' },
{ schluessel: 'yashica_kyocera', name: 'Yashica-Kyocera', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'vinten', name: 'Vinten', beschreibung: 'Luftbildkameras.' },
{ schluessel: 'vivitar', name: 'Vivitar', beschreibung: 'Digitalkameras, Wechselobjektive.' },
{ key: 'salyut', name: 'Salyut', description: 'Mittelformatkameras.' },
{ key: 'samsung', name: 'Samsung', description: 'Digitalkameras, Kleinbildkameras.' },
{ key: 'sanyo', name: 'Sanyo', description: 'Digitalkameras.' },
{ key: 'sigma', name: 'Sigma', description: 'Digitalkameras, Kleinbildkameras, Objektive.' },
{ key: 'silvestri', name: 'Silvestri', description: 'Großformatkameras.' },
{ key: 'sinar', name: 'Sinar', description: 'Digitalkameras, Großformatkameras.' },
{ key: 'sony', name: 'Sony', description: 'Digitalkameras, Objektive.' },
{ key: 'tachihara', name: 'Tachihara', description: 'Mittelformatkameras' },
{ key: 'tamron', name: 'Tamron', description: 'Objektive' },
{ key: 'teamwork', name: 'Teamwork', description: 'Mittelformatkameras' },
{ key: 'tokina', name: 'Tokina', description: 'Objektive' },
{ key: 'topcon', name: 'Topcon', description: 'Kleinbildkameras' },
{ key: 'toshiba', name: 'Toshiba', description: 'Digitalkameras, Großformatkameras' },
{ key: 'toyo', name: 'Toyo', description: 'Großformatkameras' },
{ key: 'yashica', name: 'Yashica', description: 'Digitalkameras, Kleinbildkameras.' },
{ key: 'yashica_kyocera', name: 'Yashica-Kyocera', description: 'Mittelformatkameras.' },
{ key: 'vinten', name: 'Vinten', description: 'Luftbildkameras.' },
{ key: 'vivitar', name: 'Vivitar', description: 'Digitalkameras, Wechselobjektive.' },
{
schluessel: 'voigtländer',
key: 'voigtländer',
name: 'Voigtländer',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, erstes Foto-Zoomobjektiv der Welt, aktuell: ausschließlich Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, erstes Foto-Zoomobjektiv der Welt, aktuell: ausschließlich Objektive.'
},
{ schluessel: 'walker_cameras', name: 'Walker Cameras', beschreibung: 'Großformatkameras.' },
{ key: 'walker_cameras', name: 'Walker Cameras', description: 'Großformatkameras.' },
{
schluessel: 'welta',
key: 'welta',
name: 'Welta',
beschreibung: 'Mittelformatkameras, TLR, Kleinbildkameras. Später aufgegangen in Pentacon.'
description: 'Mittelformatkameras, TLR, Kleinbildkameras. Später aufgegangen in Pentacon.'
},
{
schluessel: 'wünsche_emil_ag',
key: 'wünsche_emil_ag',
name: 'Wünsche, Emil AG',
beschreibung: 'Magazinkameras, Laufboden-Klappkameras mit Klappmechanismus, Reisekameras; aufgegangen in ICA Dresden im Jahre 1909.'
description: 'Magazinkameras, Laufboden-Klappkameras mit Klappmechanismus, Reisekameras; aufgegangen in ICA Dresden im Jahre 1909.'
},
{ schluessel: 'zeiss_ikon', name: 'Zeiss Ikon', beschreibung: 'Kleinbildkameras.' },
{ schluessel: 'zenit', name: 'Zenit', beschreibung: 'Kleinbildkameras, Mittelformatkameras.' },
{ schluessel: 'zenza_bronica', name: 'Zenza Bronica', beschreibung: 'Mittelformatkameras.' },
{ schluessel: 'zorki', name: 'Zorki', beschreibung: 'Kleinbildkameras.' },
{ key: 'zeiss_ikon', name: 'Zeiss Ikon', description: 'Kleinbildkameras.' },
{ key: 'zenit', name: 'Zenit', description: 'Kleinbildkameras, Mittelformatkameras.' },
{ key: 'zenza_bronica', name: 'Zenza Bronica', description: 'Mittelformatkameras.' },
{ key: 'zorki', name: 'Zorki', description: 'Kleinbildkameras.' },
];
export const lenses = [
{
id: "pentax-zoom",
name: "name",
lensmount_key: "",
aperture_max: "0.0",
focal_length_min: "50",
focal_length_max: null,
autofocus: false,
manufacturer_key: "",
brand_key: "",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 1980
}
];
export const cameras = [
{
id: "pentax_19",
brand_key: "pentax",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Pentax K30",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "pentax_20",
brand_key: "pentax",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Pentax K50",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "pentax_21",
brand_key: "pentax",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Pentax K3",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "agfa_01",
brand_key: "agfa",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Agfa Click",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 2000,
},
{
id: "agfa_02",
brand_key: "agfa",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Agfa Box",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "cancon_02",
brand_key: "canon",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Canon EOS",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "agfa_03",
brand_key: "agfa",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Agfa Click",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 2000,
},
{
id: "agfa_05",
brand_key: "agfa",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Agfa Box",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "cancon_07",
brand_key: "canon",
shape_key: "neuwertig",
condition_key: "neuwertig",
name: "Canon EOS",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
manufacturer_key: "",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
ligthMesure: "",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
}
];
export const inventory = [
...cameras,
...lenses
];
export const sets = [];
//# sourceMappingURL=seed.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,233 +1,393 @@
export const SEED_VERSION = 1;
export const SEED_VERSION = 3;
export const medias = [
{schluessel: "kb", name: "Kleinbild", beschreibung: ''},
{schluessel: "rf9x9", name: "Rollfilm 9x9", beschreibung: ''},
{schluessel: "rf6x9", name: "Rollfilm 9x9", beschreibung: ''},
{schluessel: "SD", name: "SD-Card", beschreibung: ''},
{schluessel: "microSD", name: "microSD-Card", beschreibung: ''},
{schluessel: "miniSD", name: "miniSD-Card", beschreibung: ''},
{key: "kb", name: "Kleinbild", description: ''},
{key: "rf9x9", name: "Rollfilm 9x9", description: ''},
{key: "rf6x9", name: "Rollfilm 9x9", description: ''},
{key: "SD", name: "SD-Card", description: ''},
{key: "microSD", name: "microSD-Card", description: ''},
{key: "miniSD", name: "miniSD-Card", description: ''},
];
export const batteries = [
{schluessel: "aaa", name: "AAA", beschreibung: ''},
{schluessel: "aa", name: "AA", beschreibung: ''},
{schluessel: "spezial", name: "SpezialAkku", beschreibung: ''},
{key: "aaa", name: "AAA", description: ''},
{key: "aa", name: "AA", description: ''},
{key: "spezial", name: "SpezialAkku", description: ''},
];
export const lensconnector = [
{schluessel: "a-mount", name: "A-Mount", beschreibung: ''},
{schluessel: "e-mount", name: "E-Mount", beschreibung: ''},
{schluessel: "ef-bajonett", name: "EF-Bajonett", beschreibung: ''},
export const mounts = [
{key: "a-mount", name: "A-Mount", description: ''},
{key: "e-mount", name: "E-Mount", description: ''},
{key: "ef-bajonett", name: "EF-Bajonett", description: ''},
];
export const conditions = [
{schluessel: "neu", name: "neu", beschreibung: ''},
{schluessel: "neuwertig", name: "neuwertig", beschreibung: ''},
{schluessel: "lg", name: "leichte Gebrauchsspuren", beschreibung: ''},
{schluessel: "mg", name: "mittlere Gebrauchsspuren", beschreibung: ''},
{schluessel: "ag", name: "abgenutzt", beschreibung: ''},
{schluessel: "eg", name: "eingeschränkte Funktion", beschreibung: ''},
{schluessel: "defekt", name: "defekt", beschreibung: ''},
];
{key: "neu", name: "neu", description: ''},
{key: "neuwertig", name: "neuwertig", description: ''},
{key: "lg", name: "leichte Gebrauchsspuren", description: ''},
{key: "mg", name: "mittlere Gebrauchsspuren", description: ''},
{key: "ag", name: "abgenutzt", description: ''},
{key: "eg", name: "eingeschränkte Funktion", description: ''},
{key: "defekt", name: "defekt", description: ''},
];
export const buildtype= [
{schluessel: "box", name: "Box", beschreibung: ''},
{schluessel: "kb", name: "Kleinbildkamera", beschreibung: ''},
{schluessel: "slr", name: "Spiegelreflex", beschreibung: ''},
{schluessel: "dslr", name: "Digitale Spiegelreflex", beschreibung: ''},
{schluessel: "mf", name: "Mittelformat", beschreibung: ''},
{schluessel: "gf", name: "Großformat", beschreibung: ''},
{schluessel: "aps", name: "Digitalkamera", beschreibung: ''},
{schluessel: "holz", name: "Holzkamera", beschreibung: ''},
{schluessel: "platte", name: "Plattenkamera", beschreibung: ''},
{schluessel: "fach", name: "Fachkamera", beschreibung: ''},
{schluessel: "lf", name: "Lichtfeldkamera", beschreibung: ''},
{schluessel: "balg", name: "Balgenkamera", beschreibung: ''},
{schluessel: "sof", name: "Sofortbild", beschreibung: ''},
export const buildtypes = [
{key: "box", name: "Box", description: ''},
{key: "kb", name: "Kleinbildkamera", description: ''},
{key: "slr", name: "Spiegelreflex", description: ''},
{key: "dslr", name: "Digitale Spiegelreflex", description: ''},
{key: "mf", name: "Mittelformat", description: ''},
{key: "gf", name: "Großformat", description: ''},
{key: "aps", name: "Digitalkamera", description: ''},
{key: "holz", name: "Holzkamera", description: ''},
{key: "platte", name: "Plattenkamera", description: ''},
{key: "fach", name: "Fachkamera", description: ''},
{key: "lf", name: "Lichtfeldkamera", description: ''},
{key: "balg", name: "Balgenkamera", description: ''},
{key: "sof", name: "Sofortbild", description: ''},
];
];
export const brands= [
{schluessel: 'agfa', name: 'Agfa', beschreibung: 'Filme aller Art sowie analoge Kameras'},
{schluessel: 'alpa', name: 'Alpa', beschreibung: 'Mittelformat analog/digital (früher Kleinbild).'},
{schluessel: 'arca_swiss', name: 'Arca-Swiss', beschreibung: 'Großformatkameras.'},
{schluessel: 'bilora', name: 'Bilora', beschreibung: 'Kleinbildkameras.'},
{schluessel: 'braun_photo_technik', name: 'Braun Photo Technik', beschreibung: 'Kameras, Diaprojektoren'},
{schluessel: 'bronica', name: 'Bronica', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'cambo', name: 'Cambo', beschreibung: 'Großformatkameras.'},
{schluessel: 'camogli', name: 'Camogli', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'canham_cameras', name: 'Canham Cameras', beschreibung: 'Großformatkameras.'},
{schluessel: 'canon', name: 'Canon', beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive.'},
{schluessel: 'carena', name: 'Carena', beschreibung: 'Kleinbildkameras, Objektive'},
{schluessel: 'casio', name: 'Casio', beschreibung: 'Digitalkameras.'},
{schluessel: 'chinon', name: 'Chinon', beschreibung: 'Digitalkameras, Kleinbildkameras.'},
export const brands = [
{key: 'agfa', name: 'Agfa', description: 'Filme aller Art sowie analoge Kameras'},
{key: 'alpa', name: 'Alpa', description: 'Mittelformat analog/digital (früher Kleinbild).'},
{key: 'arca_swiss', name: 'Arca-Swiss', description: 'Großformatkameras.'},
{key: 'bilora', name: 'Bilora', description: 'Kleinbildkameras.'},
{key: 'braun_photo_technik', name: 'Braun Photo Technik', description: 'Kameras, Diaprojektoren'},
{key: 'bronica', name: 'Bronica', description: 'Mittelformatkameras.'},
{key: 'cambo', name: 'Cambo', description: 'Großformatkameras.'},
{key: 'camogli', name: 'Camogli', description: 'Mittelformatkameras.'},
{key: 'canham_cameras', name: 'Canham Cameras', description: 'Großformatkameras.'},
{key: 'canon', name: 'Canon', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive.'},
{key: 'carena', name: 'Carena', description: 'Kleinbildkameras, Objektive'},
{key: 'casio', name: 'Casio', description: 'Digitalkameras.'},
{key: 'chinon', name: 'Chinon', description: 'Digitalkameras, Kleinbildkameras.'},
{
schluessel: 'contax',
key: 'contax',
name: 'Contax',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{schluessel: 'dr_gilde', name: 'Dr. Gilde', beschreibung: 'Mittelformatkameras.'},
{key: 'dr_gilde', name: 'Dr. Gilde', description: 'Mittelformatkameras.'},
{
schluessel: 'dhw_fototechnik',
key: 'dhw_fototechnik',
name: 'DHW Fototechnik',
beschreibung: 'digitale und analoge Mittelformatkameras, TLR Mittelformatkameras, Fachkameras, Kleinbildkameras'
description: 'digitale und analoge Mittelformatkameras, TLR Mittelformatkameras, Fachkameras, Kleinbildkameras'
},
{schluessel: 'epson', name: 'Epson', beschreibung: 'Digitalkameras.'},
{key: 'epson', name: 'Epson', description: 'Digitalkameras.'},
{
schluessel: 'ernemann_Werke_AG',
key: 'ernemann_Werke_AG',
name: 'Ernemann-Werke AG',
beschreibung: 'Kinoprojektoren und Kameras, darunter die Ermanox mit damals lichtstärkstem Serienobjektiv der Welt'
description: 'Kinoprojektoren und Kameras, darunter die Ermanox mit damals lichtstärkstem Serienobjektiv der Welt'
},
{schluessel: 'fed', name: 'FED', beschreibung: 'Kleinbildkameras.'},
{key: 'fed', name: 'FED', description: 'Kleinbildkameras.'},
{
schluessel: 'fujifilm',
key: 'fujifilm',
name: 'Fujifilm',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{schluessel: 'fandolfi', name: 'Gandolfi', beschreibung: 'Großformatkameras.'},
{schluessel: 'fottschalt', name: 'Gottschalt', beschreibung: 'Fachkameras.'},
{schluessel: 'hasselblad', name: 'Hasselblad', beschreibung: 'Kleinbildkameras, Mittelformatkameras.'},
{schluessel: 'hitachi', name: 'Hitachi', beschreibung: 'Digitalkameras.'},
{schluessel: 'hewlett-Packard (HP)', name: 'Hewlett-Packard (HP)', beschreibung: 'Digitalkameras.'},
{schluessel: 'horseman', name: 'Horseman', beschreibung: 'Großformatkameras, Mittelformatkameras.'},
{schluessel: 'ihagee', name: 'Ihagee', beschreibung: 'Kleinbildkameras (Bezeichnungen Exa und Exakta).'},
{schluessel: 'jenoptik', name: 'Jenoptik', beschreibung: 'Digitalkameras.'},
{schluessel: 'jvc', name: 'JVC', beschreibung: 'Digitalkameras.'},
{schluessel: 'kalimar', name: 'Kalimar', beschreibung: 'Kleinbildkameras, Mittelformatkameras, Objektive.'},
{key: 'fandolfi', name: 'Gandolfi', description: 'Großformatkameras.'},
{key: 'fottschalt', name: 'Gottschalt', description: 'Fachkameras.'},
{key: 'hasselblad', name: 'Hasselblad', description: 'Kleinbildkameras, Mittelformatkameras.'},
{key: 'hitachi', name: 'Hitachi', description: 'Digitalkameras.'},
{key: 'hewlett-Packard (HP)', name: 'Hewlett-Packard (HP)', description: 'Digitalkameras.'},
{key: 'horseman', name: 'Horseman', description: 'Großformatkameras, Mittelformatkameras.'},
{key: 'ihagee', name: 'Ihagee', description: 'Kleinbildkameras (Bezeichnungen Exa und Exakta).'},
{key: 'jenoptik', name: 'Jenoptik', description: 'Digitalkameras.'},
{key: 'jvc', name: 'JVC', description: 'Digitalkameras.'},
{key: 'kalimar', name: 'Kalimar', description: 'Kleinbildkameras, Mittelformatkameras, Objektive.'},
{
schluessel: 'kamera_werk_dresden',
key: 'kamera_werk_dresden',
name: 'Kamera Werk Dresden',
beschreibung: 'Panoramakameras für Kleinbild und Mittelformat (Bezeichnung Noblex).'
description: 'Panoramakameras für Kleinbild und Mittelformat (Bezeichnung Noblex).'
},
{schluessel: 'kiev', name: 'Kiev', beschreibung: 'Mittelformatkameras, Kleinbildkameras.'},
{schluessel: 'kodak', name: 'Kodak', beschreibung: 'APS-Kameras, Kleinbildkameras, Digitalkameras.'},
{key: 'kiev', name: 'Kiev', description: 'Mittelformatkameras, Kleinbildkameras.'},
{key: 'kodak', name: 'Kodak', description: 'APS-Kameras, Kleinbildkameras, Digitalkameras.'},
{
schluessel: 'konica',
key: 'konica',
name: 'Konica',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{
schluessel: 'konica_minolta',
key: 'konica_minolta',
name: 'Konica Minolta',
beschreibung: 'Fusion aus Konica und Minolta; Digitalkameras, Objektive.'
description: 'Fusion aus Konica und Minolta; Digitalkameras, Objektive.'
},
{schluessel: 'kōwa', name: 'Kōwa', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'kyocera', name: 'Kyocera', beschreibung: '(siehe auch Yashica und Contax): Digitalkameras.'},
{schluessel: 'leaf', name: 'Leaf', beschreibung: 'Digitale Rückwände für Mittelformatkameras.'},
{key: 'kōwa', name: 'Kōwa', description: 'Mittelformatkameras.'},
{key: 'kyocera', name: 'Kyocera', description: '(siehe auch Yashica und Contax): Digitalkameras.'},
{key: 'leaf', name: 'Leaf', description: 'Digitale Rückwände für Mittelformatkameras.'},
{
schluessel: 'leica',
key: 'leica',
name: 'Leica',
beschreibung: 'APS-Kameras, Analogkameras, Digitalkameras, Kleinbildkameras.'
description: 'APS-Kameras, Analogkameras, Digitalkameras, Kleinbildkameras.'
},
{schluessel: 'linhof', name: 'Linhof', beschreibung: 'Großformatkameras, Mittelformatkameras.'},
{schluessel: 'lomo', name: 'Lomo', beschreibung: 'analoge Kleinbildsucherkameras.'},
{schluessel: 'lotus_view', name: 'Lotus-View', beschreibung: 'Großformatkameras.'},
{schluessel: 'mamiya', name: 'Mamiya', beschreibung: 'Kleinbildkameras, Mittelformatkameras, Digitalkameras'},
{schluessel: 'meyer_optik', name: 'Meyer-Optik', beschreibung: 'v. a. Objektive'},
{key: 'linhof', name: 'Linhof', description: 'Großformatkameras, Mittelformatkameras.'},
{key: 'lomo', name: 'Lomo', description: 'analoge Kleinbildsucherkameras.'},
{key: 'lotus_view', name: 'Lotus-View', description: 'Großformatkameras.'},
{key: 'mamiya', name: 'Mamiya', description: 'Kleinbildkameras, Mittelformatkameras, Digitalkameras'},
{key: 'meyer_optik', name: 'Meyer-Optik', description: 'v. a. Objektive'},
{
schluessel: 'minolta',
key: 'minolta',
name: 'Minolta',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{schluessel: 'minox', name: 'Minox', beschreibung: 'Digitalkameras, Kleinbildkameras.'},
{schluessel: 'mustek', name: 'Mustek', beschreibung: 'Digitalkameras.'},
{key: 'minox', name: 'Minox', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'mustek', name: 'Mustek', description: 'Digitalkameras.'},
{
schluessel: 'nikon',
key: 'nikon',
name: 'Nikon',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive für GF-Kameras.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive für GF-Kameras.'
},
{schluessel: 'olympus', name: 'Olympus', beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras.'},
{schluessel: 'panasonic', name: 'Panasonic', beschreibung: 'Digitalkameras, Smartphones.'},
{key: 'olympus', name: 'Olympus', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras.'},
{key: 'panasonic', name: 'Panasonic', description: 'Digitalkameras, Smartphones.'},
{
schluessel: 'pentacon',
key: 'pentacon',
name: 'Pentacon',
beschreibung: 'Digitalkameras, Kleinbildkameras (Bezeichnung Praktica), früher auch Mittelformatkameras.'
description: 'Digitalkameras, Kleinbildkameras (Bezeichnung Praktica), früher auch Mittelformatkameras.'
},
{schluessel: 'pentax', name: 'Pentax', beschreibung: 'Digitalkameras, Kleinbildkameras, Mittelformatkameras.'},
{schluessel: 'phase_one', name: 'Phase One', beschreibung: 'Digitalkameras (digitaler Rückteile).'},
{schluessel: 'plaubel', name: 'Plaubel', beschreibung: 'Großformatkameras'},
{schluessel: 'polaroid', name: 'Polaroid', beschreibung: 'Digitalkameras, Sofortbildsysteme chemisch.'},
{schluessel: 'rbt', name: 'RBT', beschreibung: 'Stereokameras und Projektoren.'},
{key: 'pentax', name: 'Pentax', description: 'Digitalkameras, Kleinbildkameras, Mittelformatkameras.'},
{key: 'phase_one', name: 'Phase One', description: 'Digitalkameras (digitaler Rückteile).'},
{key: 'plaubel', name: 'Plaubel', description: 'Großformatkameras'},
{key: 'polaroid', name: 'Polaroid', description: 'Digitalkameras, Sofortbildsysteme chemisch.'},
{key: 'rbt', name: 'RBT', description: 'Stereokameras und Projektoren.'},
{
schluessel: 'reflekta_kamerawerk_tharandt',
key: 'reflekta_kamerawerk_tharandt',
name: 'Reflekta-Kamerawerk Tharandt',
beschreibung: 'TLR Mittelformatkameras, Reflekta'
description: 'TLR Mittelformatkameras, Reflekta'
},
{schluessel: 'ricoh', name: 'Ricoh', beschreibung: 'Digitalkameras, Kleinbildkameras.'},
{schluessel: 'rheinmetall', name: 'Rheinmetall', beschreibung: 'Kleinbildkameras EXA, Exakta'},
{key: 'ricoh', name: 'Ricoh', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'rheinmetall', name: 'Rheinmetall', description: 'Kleinbildkameras EXA, Exakta'},
{
schluessel: 'rollei',
key: 'rollei',
name: 'Rollei',
beschreibung: 'Digitalkameras, Kleinbildkameras, digitale und analoge Mittelformatkameras, TLR Mittelformatkameras.'
description: 'Digitalkameras, Kleinbildkameras, digitale und analoge Mittelformatkameras, TLR Mittelformatkameras.'
},
{
schluessel: 'sakar_international',
key: 'sakar_international',
name: 'Sakar International',
beschreibung: 'Zubehör, Digitalkameras, Marken Vivitar, Kodak'
description: 'Zubehör, Digitalkameras, Marken Vivitar, Kodak'
},
{schluessel: 'salyut', name: 'Salyut', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'samsung', name: 'Samsung', beschreibung: 'Digitalkameras, Kleinbildkameras.'},
{schluessel: 'sanyo', name: 'Sanyo', beschreibung: 'Digitalkameras.'},
{schluessel: 'sigma', name: 'Sigma', beschreibung: 'Digitalkameras, Kleinbildkameras, Objektive.'},
{schluessel: 'silvestri', name: 'Silvestri', beschreibung: 'Großformatkameras.'},
{schluessel: 'sinar', name: 'Sinar', beschreibung: 'Digitalkameras, Großformatkameras.'},
{schluessel: 'sony', name: 'Sony', beschreibung: 'Digitalkameras, Objektive.'},
{schluessel: 'tachihara', name: 'Tachihara', beschreibung: 'Mittelformatkameras'},
{schluessel: 'tamron', name: 'Tamron', beschreibung: 'Objektive'},
{schluessel: 'teamwork', name: 'Teamwork', beschreibung: 'Mittelformatkameras'},
{schluessel: 'tokina', name: 'Tokina', beschreibung: 'Objektive'},
{schluessel: 'topcon', name: 'Topcon', beschreibung: 'Kleinbildkameras'},
{schluessel: 'toshiba', name: 'Toshiba', beschreibung: 'Digitalkameras, Großformatkameras'},
{schluessel: 'toyo', name: 'Toyo', beschreibung: 'Großformatkameras'},
{schluessel: 'yashica', name: 'Yashica', beschreibung: 'Digitalkameras, Kleinbildkameras.'},
{schluessel: 'yashica_kyocera', name: 'Yashica-Kyocera', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'vinten', name: 'Vinten', beschreibung: 'Luftbildkameras.'},
{schluessel: 'vivitar', name: 'Vivitar', beschreibung: 'Digitalkameras, Wechselobjektive.'},
{key: 'salyut', name: 'Salyut', description: 'Mittelformatkameras.'},
{key: 'samsung', name: 'Samsung', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'sanyo', name: 'Sanyo', description: 'Digitalkameras.'},
{key: 'sigma', name: 'Sigma', description: 'Digitalkameras, Kleinbildkameras, Objektive.'},
{key: 'silvestri', name: 'Silvestri', description: 'Großformatkameras.'},
{key: 'sinar', name: 'Sinar', description: 'Digitalkameras, Großformatkameras.'},
{key: 'sony', name: 'Sony', description: 'Digitalkameras, Objektive.'},
{key: 'tachihara', name: 'Tachihara', description: 'Mittelformatkameras'},
{key: 'tamron', name: 'Tamron', description: 'Objektive'},
{key: 'teamwork', name: 'Teamwork', description: 'Mittelformatkameras'},
{key: 'tokina', name: 'Tokina', description: 'Objektive'},
{key: 'topcon', name: 'Topcon', description: 'Kleinbildkameras'},
{key: 'toshiba', name: 'Toshiba', description: 'Digitalkameras, Großformatkameras'},
{key: 'toyo', name: 'Toyo', description: 'Großformatkameras'},
{key: 'yashica', name: 'Yashica', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'yashica_kyocera', name: 'Yashica-Kyocera', description: 'Mittelformatkameras.'},
{key: 'vinten', name: 'Vinten', description: 'Luftbildkameras.'},
{key: 'vivitar', name: 'Vivitar', description: 'Digitalkameras, Wechselobjektive.'},
{
schluessel: 'voigtländer',
key: 'voigtländer',
name: 'Voigtländer',
beschreibung: 'APS-Kameras, Digitalkameras, Kleinbildkameras, erstes Foto-Zoomobjektiv der Welt, aktuell: ausschließlich Objektive.'
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, erstes Foto-Zoomobjektiv der Welt, aktuell: ausschließlich Objektive.'
},
{schluessel: 'walker_cameras', name: 'Walker Cameras', beschreibung: 'Großformatkameras.'},
{key: 'walker_cameras', name: 'Walker Cameras', description: 'Großformatkameras.'},
{
schluessel: 'welta',
key: 'welta',
name: 'Welta',
beschreibung: 'Mittelformatkameras, TLR, Kleinbildkameras. Später aufgegangen in Pentacon.'
description: 'Mittelformatkameras, TLR, Kleinbildkameras. Später aufgegangen in Pentacon.'
},
{
schluessel: 'wünsche_emil_ag',
key: 'wünsche_emil_ag',
name: 'Wünsche, Emil AG',
beschreibung: 'Magazinkameras, Laufboden-Klappkameras mit Klappmechanismus, Reisekameras; aufgegangen in ICA Dresden im Jahre 1909.'
description: 'Magazinkameras, Laufboden-Klappkameras mit Klappmechanismus, Reisekameras; aufgegangen in ICA Dresden im Jahre 1909.'
},
{schluessel: 'zeiss_ikon', name: 'Zeiss Ikon', beschreibung: 'Kleinbildkameras.'},
{schluessel: 'zenit', name: 'Zenit', beschreibung: 'Kleinbildkameras, Mittelformatkameras.'},
{schluessel: 'zenza_bronica', name: 'Zenza Bronica', beschreibung: 'Mittelformatkameras.'},
{schluessel: 'zorki', name: 'Zorki', beschreibung: 'Kleinbildkameras.'},
]
{key: 'zeiss_ikon', name: 'Zeiss Ikon', description: 'Kleinbildkameras.'},
{key: 'zenit', name: 'Zenit', description: 'Kleinbildkameras, Mittelformatkameras.'},
{key: 'zenza_bronica', name: 'Zenza Bronica', description: 'Mittelformatkameras.'},
{key: 'zorki', name: 'Zorki', description: 'Kleinbildkameras.'},
]
export const manufacturers = [
{key: 'agfa', name: 'Agfa', description: 'Filme aller Art sowie analoge Kameras'},
{key: 'alpa', name: 'Alpa', description: 'Mittelformat analog/digital (früher Kleinbild).'},
{key: 'arca_swiss', name: 'Arca-Swiss', description: 'Großformatkameras.'},
{key: 'bilora', name: 'Bilora', description: 'Kleinbildkameras.'},
{key: 'braun_photo_technik', name: 'Braun Photo Technik', description: 'Kameras, Diaprojektoren'},
{key: 'bronica', name: 'Bronica', description: 'Mittelformatkameras.'},
{key: 'cambo', name: 'Cambo', description: 'Großformatkameras.'},
{key: 'camogli', name: 'Camogli', description: 'Mittelformatkameras.'},
{key: 'canham_cameras', name: 'Canham Cameras', description: 'Großformatkameras.'},
{key: 'canon', name: 'Canon', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive.'},
{key: 'carena', name: 'Carena', description: 'Kleinbildkameras, Objektive'},
{key: 'casio', name: 'Casio', description: 'Digitalkameras.'},
{key: 'chinon', name: 'Chinon', description: 'Digitalkameras, Kleinbildkameras.'},
{
key: 'contax',
name: 'Contax',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{key: 'dr_gilde', name: 'Dr. Gilde', description: 'Mittelformatkameras.'},
{
key: 'dhw_fototechnik',
name: 'DHW Fototechnik',
description: 'digitale und analoge Mittelformatkameras, TLR Mittelformatkameras, Fachkameras, Kleinbildkameras'
},
{key: 'epson', name: 'Epson', description: 'Digitalkameras.'},
{
key: 'ernemann_Werke_AG',
name: 'Ernemann-Werke AG',
description: 'Kinoprojektoren und Kameras, darunter die Ermanox mit damals lichtstärkstem Serienobjektiv der Welt'
},
{key: 'fed', name: 'FED', description: 'Kleinbildkameras.'},
{
key: 'fujifilm',
name: 'Fujifilm',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras.'
},
{key: 'fandolfi', name: 'Gandolfi', description: 'Großformatkameras.'},
{key: 'fottschalt', name: 'Gottschalt', description: 'Fachkameras.'},
{key: 'hasselblad', name: 'Hasselblad', description: 'Kleinbildkameras, Mittelformatkameras.'},
{key: 'hitachi', name: 'Hitachi', description: 'Digitalkameras.'},
{key: 'hewlett-Packard (HP)', name: 'Hewlett-Packard (HP)', description: 'Digitalkameras.'},
{key: 'horseman', name: 'Horseman', description: 'Großformatkameras, Mittelformatkameras.'},
{key: 'ihagee', name: 'Ihagee', description: 'Kleinbildkameras (Bezeichnungen Exa und Exakta).'},
{key: 'jenoptik', name: 'Jenoptik', description: 'Digitalkameras.'},
{key: 'jvc', name: 'JVC', description: 'Digitalkameras.'},
{key: 'kalimar', name: 'Kalimar', description: 'Kleinbildkameras, Mittelformatkameras, Objektive.'},
{
key: 'kamera_werk_dresden',
name: 'Kamera Werk Dresden',
description: 'Panoramakameras für Kleinbild und Mittelformat (Bezeichnung Noblex).'
},
{key: 'kiev', name: 'Kiev', description: 'Mittelformatkameras, Kleinbildkameras.'},
{key: 'kodak', name: 'Kodak', description: 'APS-Kameras, Kleinbildkameras, Digitalkameras.'},
{
key: 'konica',
name: 'Konica',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{
key: 'konica_minolta',
name: 'Konica Minolta',
description: 'Fusion aus Konica und Minolta; Digitalkameras, Objektive.'
},
{key: 'kōwa', name: 'Kōwa', description: 'Mittelformatkameras.'},
{key: 'kyocera', name: 'Kyocera', description: '(siehe auch Yashica und Contax): Digitalkameras.'},
{key: 'leaf', name: 'Leaf', description: 'Digitale Rückwände für Mittelformatkameras.'},
{
key: 'leica',
name: 'Leica',
description: 'APS-Kameras, Analogkameras, Digitalkameras, Kleinbildkameras.'
},
{key: 'linhof', name: 'Linhof', description: 'Großformatkameras, Mittelformatkameras.'},
{key: 'lomo', name: 'Lomo', description: 'analoge Kleinbildsucherkameras.'},
{key: 'lotus_view', name: 'Lotus-View', description: 'Großformatkameras.'},
{key: 'mamiya', name: 'Mamiya', description: 'Kleinbildkameras, Mittelformatkameras, Digitalkameras'},
{key: 'meyer_optik', name: 'Meyer-Optik', description: 'v. a. Objektive'},
{
key: 'minolta',
name: 'Minolta',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Mittelformatkameras, Objektive.'
},
{key: 'minox', name: 'Minox', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'mustek', name: 'Mustek', description: 'Digitalkameras.'},
{
key: 'nikon',
name: 'Nikon',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, Objektive für GF-Kameras.'
},
{key: 'olympus', name: 'Olympus', description: 'APS-Kameras, Digitalkameras, Kleinbildkameras.'},
{key: 'panasonic', name: 'Panasonic', description: 'Digitalkameras, Smartphones.'},
{
key: 'pentacon',
name: 'Pentacon',
description: 'Digitalkameras, Kleinbildkameras (Bezeichnung Praktica), früher auch Mittelformatkameras.'
},
{key: 'pentax', name: 'Pentax', description: 'Digitalkameras, Kleinbildkameras, Mittelformatkameras.'},
{key: 'phase_one', name: 'Phase One', description: 'Digitalkameras (digitaler Rückteile).'},
{key: 'plaubel', name: 'Plaubel', description: 'Großformatkameras'},
{key: 'polaroid', name: 'Polaroid', description: 'Digitalkameras, Sofortbildsysteme chemisch.'},
{key: 'rbt', name: 'RBT', description: 'Stereokameras und Projektoren.'},
{
key: 'reflekta_kamerawerk_tharandt',
name: 'Reflekta-Kamerawerk Tharandt',
description: 'TLR Mittelformatkameras, Reflekta'
},
{key: 'ricoh', name: 'Ricoh', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'rheinmetall', name: 'Rheinmetall', description: 'Kleinbildkameras EXA, Exakta'},
{
key: 'rollei',
name: 'Rollei',
description: 'Digitalkameras, Kleinbildkameras, digitale und analoge Mittelformatkameras, TLR Mittelformatkameras.'
},
{
key: 'sakar_international',
name: 'Sakar International',
description: 'Zubehör, Digitalkameras, Marken Vivitar, Kodak'
},
{key: 'salyut', name: 'Salyut', description: 'Mittelformatkameras.'},
{key: 'samsung', name: 'Samsung', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'sanyo', name: 'Sanyo', description: 'Digitalkameras.'},
{key: 'sigma', name: 'Sigma', description: 'Digitalkameras, Kleinbildkameras, Objektive.'},
{key: 'silvestri', name: 'Silvestri', description: 'Großformatkameras.'},
{key: 'sinar', name: 'Sinar', description: 'Digitalkameras, Großformatkameras.'},
{key: 'sony', name: 'Sony', description: 'Digitalkameras, Objektive.'},
{key: 'tachihara', name: 'Tachihara', description: 'Mittelformatkameras'},
{key: 'tamron', name: 'Tamron', description: 'Objektive'},
{key: 'teamwork', name: 'Teamwork', description: 'Mittelformatkameras'},
{key: 'tokina', name: 'Tokina', description: 'Objektive'},
{key: 'topcon', name: 'Topcon', description: 'Kleinbildkameras'},
{key: 'toshiba', name: 'Toshiba', description: 'Digitalkameras, Großformatkameras'},
{key: 'toyo', name: 'Toyo', description: 'Großformatkameras'},
{key: 'yashica', name: 'Yashica', description: 'Digitalkameras, Kleinbildkameras.'},
{key: 'yashica_kyocera', name: 'Yashica-Kyocera', description: 'Mittelformatkameras.'},
{key: 'vinten', name: 'Vinten', description: 'Luftbildkameras.'},
{key: 'vivitar', name: 'Vivitar', description: 'Digitalkameras, Wechselobjektive.'},
{
key: 'voigtländer',
name: 'Voigtländer',
description: 'APS-Kameras, Digitalkameras, Kleinbildkameras, erstes Foto-Zoomobjektiv der Welt, aktuell: ausschließlich Objektive.'
},
{key: 'walker_cameras', name: 'Walker Cameras', description: 'Großformatkameras.'},
{
key: 'welta',
name: 'Welta',
description: 'Mittelformatkameras, TLR, Kleinbildkameras. Später aufgegangen in Pentacon.'
},
{
key: 'wünsche_emil_ag',
name: 'Wünsche, Emil AG',
description: 'Magazinkameras, Laufboden-Klappkameras mit Klappmechanismus, Reisekameras; aufgegangen in ICA Dresden im Jahre 1909.'
},
{key: 'zeiss_ikon', name: 'Zeiss Ikon', description: 'Kleinbildkameras.'},
{key: 'zenit', name: 'Zenit', description: 'Kleinbildkameras, Mittelformatkameras.'},
{key: 'zenza_bronica', name: 'Zenza Bronica', description: 'Mittelformatkameras.'},
{key: 'zorki', name: 'Zorki', description: 'Kleinbildkameras.'},
]
export const lenses = [
{
id: "pentax-zoom",
name: "name",
lensmount_key:"",
inventory_number: '200',
item_type: "lens",
name: "Pentax Zoom",
mount_key: "a-mount",
aperture_max: "0.0",
focal_length_min: "50",
focal_length_max: null,
focal_length_max: "250",
autofocus: false,
manufacturer_key: "",
brand_key:"",
manufacturer_key: "pentax",
brand_key: "pentax",
description: "Langer Text",
year_manufactured_from: "",
year_manufactured_to: "",
year_manufactured_from: "1980",
year_manufactured_to: "1990",
price_purchased: 0.0,
price_hisotric: 0.0,
price_current: 0.0,
work_done: "",
work_done: "Bisher nur kleinere Reinigungsarbeiten",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 1980
}
@ -236,9 +396,11 @@ export const lenses = [
export const cameras = [
{
id: "pentax_19",
inventory_number: '109',
item_type: "camera",
brand_key: "pentax",
condition_key: "neuwertig",
name:"Pentax K30",
name: "Pentax K30",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
@ -249,15 +411,17 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "pentax_20",
inventory_number: '108',
item_type: "camera",
brand_key: "pentax",
condition_key: "neuwertig",
name:"Pentax K50",
name: "Pentax K50",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
@ -268,15 +432,17 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "pentax_21",
inventory_number: '107',
item_type: "camera",
brand_key: "pentax",
condition_key: "neuwertig",
name:"Pentax K3",
name: "Pentax K3",
buildtype: "slr",
description: "Langer Text",
year_manufactured_from: "",
@ -287,12 +453,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 2022,
},
{
id: "agfa_01",
inventory_number: '106',
item_type: "camera",
brand_key: "agfa",
condition_key: "neuwertig",
name: "Agfa Click",
@ -306,12 +474,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 2000,
},
{
id: "agfa_02",
inventory_number: '105',
item_type: "camera",
brand_key: "agfa",
condition_key: "neuwertig",
name: "Agfa Box",
@ -325,12 +495,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "cancon_02",
inventory_number: '104',
item_type: "camera",
brand_key: "canon",
condition_key: "neuwertig",
name: "Canon EOS",
@ -344,12 +516,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "agfa_03",
inventory_number: '103',
item_type: "camera",
brand_key: "agfa",
condition_key: "neuwertig",
name: "Agfa Click",
@ -363,12 +537,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 2000,
},
{
id: "agfa_05",
inventory_number: '102',
item_type: "camera",
brand_key: "agfa",
condition_key: "neuwertig",
name: "Agfa Box",
@ -382,12 +558,14 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
},
{
id: "cancon_07",
inventory_number: '101',
item_type: "camera",
brand_key: "canon",
condition_key: "neuwertig",
name: "Canon EOS",
@ -401,11 +579,38 @@ export const cameras = [
price_current: 0.0,
work_done: "",
ligthMesure: "",
special:"",
special: "",
year_of_production: 2000,
year_of_purchase: 1980,
}
]
export const sets = [
{
id: "minox-set",
inventory_number: '300',
item_type: "set",
name: "minox Set"
}
]
export const accessories = [
{
id: "stat11",
inventory_number: '300',
item_type: "accessoire",
name: "Stativ"
}
]
export const inventory = [
...cameras,
...lenses,
...sets,
...accessories
]

View File

@ -0,0 +1,22 @@
import InventoryItem from "@/store/classes/InventoryItem";
export default class Camera extends InventoryItem {
ADD_FIELDS = ['_light_measure_method', 'mount_key',
'buildtype_key', 'media_key', 'year_manufactured_from', 'year_manufactured_to'];
_light_measure_method;
_mount_key;
_buildtype_key;
_media_key;
_year_manufactured_from;
_year_manufactured_to;
constructor(id, name, values) {
super(id, name, values);
this._item_type = "camera";
if (typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if (field in values)
this["_" + field] = values[field];
}
}
}
}
//# sourceMappingURL=Camera.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Camera.js","sourceRoot":"","sources":["Camera.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,aAAa;IAErC,UAAU,GAAG,CAAC,uBAAuB,EAAE,WAAW;QACtD,eAAe,EAAE,WAAW,EAAE,wBAAwB,EAAE,sBAAsB,CAAC,CAAA;IAE3E,qBAAqB,CAAS;IAC9B,UAAU,CAAS;IACnB,cAAc,CAAS;IACvB,UAAU,CAAS;IAGnB,uBAAuB,CAAS;IAChC,qBAAqB,CAAS;IAEtC,YAAY,EAAS,EAAE,IAAW,EAAE,MAAc;QAC9C,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAE3B,IAAG,OAAO,MAAM,IAAI,WAAW,EAAE;YAC7B,KAAK,MAAM,KAAK,IAAK,IAAI,CAAC,UAAU,EAAE;gBAClC,IAAG,KAAK,IAAI,MAAM;oBAAE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;aACzD;SACJ;IACL,CAAC;CACJ"}

View File

@ -0,0 +1,27 @@
import InventoryItem from "@/store/classes/InventoryItem";
export default class Camera extends InventoryItem {
private ADD_FIELDS = ['_light_measure_method', 'mount_key',
'buildtype_key', 'media_key', 'year_manufactured_from', 'year_manufactured_to']
private _light_measure_method: string;
private _mount_key: string;
private _buildtype_key: string;
private _media_key: string;
private _year_manufactured_from: string;
private _year_manufactured_to: string;
constructor(id:string, name:string, values?:Object) {
super(id, name, values);
this._item_type = "camera";
if(typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if(field in values) this["_" + field] = values[field];
}
}
}
}

View File

@ -0,0 +1,73 @@
export default class InventoryItem {
FIELDS = ['manufacturer_key', 'brand_key', 'condition_key',
'name', 'description', 'work_done', 'special',
'price_purchased', 'price_historic', 'price_current',
'year_of_production', 'year_of_purchase'];
_id;
_item_type;
_manufacturer_key;
_brand_key;
_condition_key;
_name;
_description;
_work_done;
_special;
_price_purchased;
_price_historic;
_price_current;
_year_of_production;
_year_of_purchase;
constructor(id, name, values) {
this._id = id;
this._name = name;
if (typeof values != "undefined") {
for (const field of this.FIELDS) {
if (field in values)
this["_" + field] = values[field];
}
}
}
get id() {
return this._id;
}
get item_type() {
return this._item_type;
}
get manufacturer_key() {
return this._manufacturer_key;
}
get brand_key() {
return this._brand_key;
}
get condition_key() {
return this._condition_key;
}
get name() {
return this._name;
}
get description() {
return this._description;
}
get work_done() {
return this._work_done;
}
get special() {
return this._special;
}
get price_purchased() {
return this._price_purchased;
}
get price_historic() {
return this._price_historic;
}
get price_current() {
return this._price_current;
}
get year_of_production() {
return this._year_of_production;
}
get year_of_purchase() {
return this._year_of_purchase;
}
}
//# sourceMappingURL=InventoryItem.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"InventoryItem.js","sourceRoot":"","sources":["InventoryItem.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,aAAa;IAEtB,MAAM,GAAG,CAAC,kBAAkB,EAAE,WAAW,EAAE,eAAe;QAC9D,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS;QAC7C,iBAAiB,EAAE,gBAAgB,EAAE,eAAe;QACpD,oBAAoB,EAAE,kBAAkB,CAAE,CAAC;IAEvC,GAAG,CAAS;IAEZ,UAAU,CAAmC;IAE7C,iBAAiB,CAAS;IAC1B,UAAU,CAAS;IACnB,cAAc,CAAS;IAEvB,KAAK,CAAS;IACd,YAAY,CAAS;IACrB,UAAU,CAAS;IACnB,QAAQ,CAAS;IAEjB,gBAAgB,CAAS;IACzB,eAAe,CAAS;IACxB,cAAc,CAAS;IAEvB,mBAAmB,CAAS;IAC5B,iBAAiB,CAAS;IAIlC,YAAa,EAAS,EAAE,IAAW,EAAE,MAAc;QAC/C,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAG,OAAO,MAAM,IAAI,WAAW,EAAE;YAC7B,KAAK,MAAM,KAAK,IAAK,IAAI,CAAC,MAAM,EAAE;gBAC9B,IAAG,KAAK,IAAI,MAAM;oBAAE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;aACzD;SACJ;IACL,CAAC;IAGD,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAI,kBAAkB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;CACJ"}

View File

@ -0,0 +1,172 @@
export default class InventoryItem {
private FIELDS = ['manufacturer_key', 'brand_key', 'condition_key',
'name', 'description', 'work_done', 'special',
'price_purchased', 'price_historic', 'price_current',
'year_of_production', 'year_of_purchase', 'inventory_number' ];
private _id: string;
protected _inventory_number: string;
protected _item_type: "camera" | "accessoire" | "lens";
private _active: boolean;
private _edit: boolean;
private _manufacturer_key: string;
private _brand_key: string;
private _condition_key: string;
private _name: string;
private _description: string;
private _work_done: string;
private _special: string;
private _price_purchased: number;
private _price_historic: number;
private _price_current: number;
private _year_of_production: number;
private _year_of_purchase: number;
constructor( id:string, name:string, values?:Object ) {
this._id = id;
this._name = name;
this._active = false;
this._edit = false;
if(typeof values != "undefined") {
for (const field of this.FIELDS) {
if(field in values) this["_" + field] = values[field];
}
}
}
get id(): string {
return this._id;
}
get active(): boolean {
return this._active;
}
get edit(): boolean {
return this._edit;
}
get item_type(): "camera" | "accessoire" | "lens" {
return this._item_type;
}
get manufacturer_key(): string {
return this._manufacturer_key;
}
get brand_key(): string {
return this._brand_key;
}
get condition_key(): string {
return this._condition_key;
}
get name(): string {
return this._name;
}
get description(): string {
return this._description;
}
get work_done(): string {
return this._work_done;
}
get special(): string {
return this._special;
}
get price_purchased(): number {
return this._price_purchased;
}
get price_historic(): number {
return this._price_historic;
}
get price_current(): number {
return this._price_current;
}
get year_of_production(): number {
return this._year_of_production;
}
get year_of_purchase(): number {
return this._year_of_purchase;
}
set active(value: boolean) {
this._active = value;
}
set edit(value: boolean) {
this._edit = value;
}
set manufacturer_key(value: string) {
this._manufacturer_key = value;
}
set brand_key(value: string) {
this._brand_key = value;
}
set condition_key(value: string) {
this._condition_key = value;
}
set name(value: string) {
this._name = value;
}
set description(value: string) {
this._description = value;
}
set work_done(value: string) {
this._work_done = value;
}
set special(value: string) {
this._special = value;
}
set price_purchased(value: number) {
this._price_purchased = value;
}
set price_historic(value: number) {
this._price_historic = value;
}
set price_current(value: number) {
this._price_current = value;
}
set year_of_production(value: number) {
this._year_of_production = value;
}
set year_of_purchase(value: number) {
this._year_of_purchase = value;
}
}

28
src/store/classes/Lens.js Normal file
View File

@ -0,0 +1,28 @@
import InventoryItem from "@/store/classes/InventoryItem";
export class Lens extends InventoryItem {
ADD_FIELDS = ['mount_key', 'autofocus', 'aperture_max', 'focal_length_min', 'focal_length_max'];
_mount_key;
_autofocus;
_aperture_max;
_focal_length_min;
_focal_length_max;
constructor(id, name, values) {
super(id, name, values);
this._item_type = "lens";
if (typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if (field in values)
this["_" + field] = values[field];
}
}
}
}
const camera2 = new Lens(null, "Pentax K30", {
manufacturer_key: "manufacturere",
brand_key: "brand",
condition_key: "condition",
buildtype_key: "buildtype",
autofocus: true,
});
console.log(camera2);
//# sourceMappingURL=Lens.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Lens.js","sourceRoot":"","sources":["Lens.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,OAAO,IAAK,SAAQ,aAAa;IAE3B,UAAU,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,CAAE,CAAC;IAEjG,UAAU,CAAS;IACnB,UAAU,CAAU;IACpB,aAAa,CAAS;IACtB,iBAAiB,CAAS;IAC1B,iBAAiB,CAAS;IAElC,YAAY,EAAS,EAAE,IAAW,EAAE,MAAc;QAC9C,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QAErB,IAAG,OAAO,MAAM,IAAI,WAAW,EAAE;YAC7B,KAAK,MAAM,KAAK,IAAK,IAAI,CAAC,UAAU,EAAE;gBAClC,IAAG,KAAK,IAAI,MAAM;oBAAE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;aACzD;SACJ;IACT,CAAC;CACJ;AAGD,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE;IACzC,gBAAgB,EAAE,eAAe;IACjC,SAAS,EAAE,OAAO;IAClB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,SAAS,EAAE,IAAI;CAClB,CAAC,CAAC;AACH,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC"}

54
src/store/classes/Lens.ts Normal file
View File

@ -0,0 +1,54 @@
import InventoryItem from "@/store/classes/InventoryItem";
export default class Lens extends InventoryItem {
private ADD_FIELDS = ['mount_key', 'autofocus', 'aperture_max', 'focal_length_min', 'focal_length_max' ];
private _mount_key: string;
private _autofocus: boolean;
private _aperture_max: number;
private _focal_length_min: number;
private _focal_length_max: number;
constructor(id:string, name:string, values?:Object) {
super(id, name, values);
this._item_type = "lens";
if(typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if(field in values) this["_" + field] = values[field];
}
}
}
get mount_key(): string {
return this._mount_key;
}
get autofocus(): boolean {
return this._autofocus;
}
get aperture_max(): number {
return this._aperture_max;
}
get focal_length_min(): number {
return this._focal_length_min;
}
get focal_length_max(): number {
return this._focal_length_max;
}
}
const camera2 = new Lens(null, "Pentax K30", {
manufacturer_key: "manufacturere",
brand_key: "brand",
condition_key: "condition",
buildtype_key: "buildtype",
autofocus: true,
});
console.log(camera2);

View File

@ -0,0 +1,36 @@
export default class NameKey {
_key;
_name;
_type;
_active;
_description;
constructor(key, name, type, active = true, description) {
this._key = key;
this._name = name;
this._type = type;
this._active = active;
this._description = description;
}
get key() {
return this._key;
}
get name() {
return this._name;
}
set name(value) {
this._name = value;
}
get type() {
return this._type;
}
set type(value) {
this._type = value;
}
get active() {
return this._active;
}
set active(value) {
this._active = value;
}
}
//# sourceMappingURL=NameKey.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"NameKey.js","sourceRoot":"","sources":["NameKey.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,OAAO;IAEhB,IAAI,CAAU;IACd,KAAK,CAAS;IACd,KAAK,CAA2E;IAChF,OAAO,CAAU;IACjB,YAAY,CAAS;IAE7B,YAAY,GAAW,EAAE,IAAW,EAAE,IAAI,EAAE,SAAkB,IAAI,EAAE,WAAmB;QACrF,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAGD,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,IAAI,CAAC,KAAa;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,IAAI,CAAC,KAA8E;QACnF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,MAAM,CAAC,KAAc;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;CACJ"}

View File

@ -0,0 +1,48 @@
export default class NameKey {
private _key : string;
private _name: string;
private _type: 'brand' | 'manufacturer' | 'condition' | 'media' | 'mount' | 'buildtype';
private _active: boolean;
private _description: string;
constructor(key: string, name:string, type, active: boolean = true, description?:string) {
this._key = key;
this._name = name;
this._type = type;
this._active = active;
this._description = description;
}
get key(): string {
return this._key;
}
get name(): string {
return this._name;
}
set name(value: string) {
this._name = value;
}
get type(): "brand" | "manufacturer" | "condition" | "media" | "mount" | 'buildtype'{
return this._type;
}
set type(value: "brand" | "manufacturer" | "condition" | "media" | "mount"| 'buildtype') {
this._type = value;
}
get active(): boolean {
return this._active;
}
set active(value: boolean) {
this._active = value;
}
}

45
src/store/classes/Set.ts Normal file
View File

@ -0,0 +1,45 @@
import InventoryItem from "@/store/classes/InventoryItem";
export default class Set extends InventoryItem {
private ADD_FIELDS = ['mount_key', 'autofocus', 'aperture_max', 'focal_length_min', 'focal_length_max' ];
private _mount_key: string;
private _autofocus: boolean;
private _aperture_max: number;
private _focal_length_min: number;
private _focal_length_max: number;
constructor(id:string, name:string, values?:Object) {
super(id, name, values);
this._item_type = "lens";
if(typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if(field in values) this["_" + field] = values[field];
}
}
}
get mount_key(): string {
return this._mount_key;
}
get autofocus(): boolean {
return this._autofocus;
}
get aperture_max(): number {
return this._aperture_max;
}
get focal_length_min(): number {
return this._focal_length_min;
}
get focal_length_max(): number {
return this._focal_length_max;
}
}

View File

@ -1,10 +1,10 @@
import { createStore } from 'vuex';
import authModule from "./modules/auth";
import cameraModule from "./modules/camera";
import inventoryModule from "./modules/inventory";
export default createStore({
modules: {
auth: authModule,
camera: cameraModule
camera: inventoryModule
}
});
//# sourceMappingURL=index.js.map

View File

@ -1,7 +1,7 @@
import { createStore } from 'vuex'
import authModule from "./modules/auth";
import cameraModule from "./modules/camera";
import cameraModule from "./modules/inventory";
export default createStore({
modules: {

File diff suppressed because one or more lines are too long

View File

@ -1,201 +0,0 @@
import {ActionContext} from "vuex";
import * as seed from "@/seed";
import BilliDB from "@/indexdDB";
import { v4 as uuidv4 } from 'uuid';
import {SEED_VERSION} from "@/seed";
const db = new BilliDB("billibox", 3);
const state = {
isInitialized: false,
cameras: [],
brands: [],
conditions: [],
medias: [],
buildtypes: []
};
const getters = {
cameras: (state: any) => {
return state.cameras.sort();
},
camera: (state: any) => (id: any) => state.cameras.find((camera: any) => camera.id === id),
activeCamera: (state: any) => state.cameras.find((camera:any) => camera.active ),
brands: (state: any) => state.brands,
brand: (state: any) => (id: any) => state.brands.find((brand: any) => brand.schluessel === id),
conditions: (state: any) => state.conditions,
condition: (state: any) => (id: any) => state.conditions.find((condition: any) => condition.schluessel === id),
medias: (state: any) => state.medias,
media: (state: any) => (id: any) => state.medias.find((condition: any) => media.schluessel === id),
buildtypes: (state: any) => state.buildtypes,
buildtype: (state: any) => (id: any) => state.buildtypes.find((buildtype: any) => buildtype.schluessel === id),
isInitialized: (state:any ) => state.isInitialized,
};
const mutations = {
setCameras(state:any, payload:any) {
console.log("mutation.setCameras");
const camerasDA = [];
payload.map((camera:any) => {
state.cameras.push({
...camera,
edit: false,
active: false
})
})
console.log("STORE", state.cameras);
},
storeCamera(sate:any, payload:any) {
// console.log("mutation.storeCamera", payload)
const objCamera = state.cameras.find((camera:any) => camera.id === payload.id);
if(objCamera) {
// console.log("found existing Camera", objCamera.id);
payload.edit =false;
objCamera.name = payload.name;
} else {
// console.log("creating new Camera");
payload.edit = false;
state.cameras.push(payload);
}
return payload.id;
},
setCameraActiveState(state:any, payload:any) {
// console.log("setCameraActiveState", payload);
state.cameras.map((camera:any) => camera.active= false);
const objCamera = state.cameras.find((camera:any) => camera.id === payload.id);
objCamera.active = payload.active;
},
setCameraEditState(state:any, payload:any) {
state.cameras.map((camera:any) => camera.edit= false);
const objCamera = state.cameras.find((camera:any) => camera.id === payload.id);
objCamera.edit = payload.edit;
},
setBrands(state:any, payload:any) {
state.brands = payload;
},
setMedias(state:any, payload:any) {
state.medias = payload;
},
setConditions(state:any, payload:any) {
state.conditions = payload;
},
setBuildtypes(state:any, payload:any) {
state.buildtypes = payload;
},
setInitialized(state:any, payload:boolean) {
state.isInitialized = payload;
}
};
const actions = {
fetchCameras(context:ActionContext<any, any>) {
db.getItems("cameras").then((cameras) => {
context.commit("setCameras", cameras);
})
},
fetchMedias(context:ActionContext<any, any>) {
db.getItems("medias").then((rs) => {
context.commit("setMedias", rs);
})
},
fetchBrands(context:ActionContext<any, any>) {
db.getItems("brands").then((rs) => {
context.commit("setBrands", rs);
})
},
fetchBuildTypes(context:ActionContext<any, any>) {
db.getItems("buildtype").then((rs) => {
context.commit("setBuildtypes", rs);
})
},
fetchCondition(context:ActionContext<any, any>) {
db.getItems("conditions").then((rs) => {
context.commit("setConditions", rs);
})
},
setCameraActiveState(context:ActionContext<any, any>, payload:any) {
console.log("action.setCameraActiveState", payload)
const cameraObj = state.cameras.find( (camera:any) => camera.id === payload.cameraId);
context.commit("setCameraActiveState", {id: payload.cameraId, active:payload.active});
},
setCameraEditState(context:ActionContext<any, any>, payload:any) {
console.log("action.setCameraEditState", payload)
const cameraObj = state.cameras.find( (camera:any) => camera.id === payload.cameraId);
context.commit("setCameraEditState", {id: payload.cameraId, edit:payload.edit});
},
storeCamera(context:ActionContext<any, any>, payload:any) {
// console.log("action.storeCamera", payload)
if(!payload.id) payload.id = uuidv4();
//console.log(" ... with id ", payload.id);
//console.log("Try to save to indexDB");
db.saveItem(payload , "cameras").then( (res) => {
console.log("DB-Save resolved", res )}
)
context.commit("storeCamera", payload);
context.commit("setCameraActiveState", {cameraId:payload.id, active:true})
},
initialize(context:ActionContext<any, any>, payload) {
db.getDb();
const promises = [];
const seedVersion = localStorage.getItem("SEED_VERSION") || 0;
if(payload.seed && seedVersion < SEED_VERSION ) {
console.log("SEEDING database");
promises.push(db.saveItems(seed.brands, "brands"));
promises.push(db.saveItems(seed.conditions, "conditions"));
promises.push(db.saveItems(seed.buildtype, "buildtypes"));
promises.push(db.saveItems(seed.cameras, "cameras"));
promises.push(db.saveItems(seed.medias, "medias"));
localStorage.setItem("SEED_VERSION", seed.SEED_VERSION.toString())
} else {
console.log("SEEDING skipped");
}
Promise.all(promises).then( (e) => {
console.log("All written to store")
}
)
context.dispatch("fetchCameras");
context.dispatch("fetchBrands");
context.dispatch("fetchBuildTypes");
context.dispatch("fetchCondition");
context.dispatch("fetchMedias");
context.commit("setInitialized", true);
}
};
const modules = {};
const cameraModule = {
state,
getters,
mutations,
actions,
modules
}
export default cameraModule

View File

@ -5,28 +5,40 @@ import { SEED_VERSION } from "@/seed";
const db = new BilliDB("billibox", 3);
const state = {
isInitialized: false,
cameras: [],
inventory: [],
brands: [],
conditions: [],
medias: [],
mounts: [],
buildtypes: []
};
const getters = {
cameras: (state) => {
return state.cameras.sort();
return state.cameras.find((item) => item.item_type === "camera");
},
camera: (state) => (id) => state.cameras.find((camera) => camera.id === id),
activeCamera: (state) => state.cameras.find((camera) => camera.active),
camera: (state) => (id) => state.inventory.find((item) => item.item_type === "camera" && item.id === id),
activeItem: (state) => state.inventory.find((item) => item.active),
lenses: (state) => {
return state.cameras.find((item) => item.item_type === "lens");
},
lens: (state) => (id) => state.inventory.find((item) => item.item_type === "lens" && item.id === id),
accessories: (state) => {
return state.cameras.find((item) => item.item_type === "accessoire");
},
accessoire: (state) => (id) => state.inventory.find((item) => item.item_type === "accessoire" && item.id === id),
brands: (state) => state.brands,
brand: (state) => (id) => state.brands.find((brand) => brand.schluessel === id),
conditions: (state) => state.conditions,
condition: (state) => (id) => state.conditions.find((condition) => condition.schluessel === id),
medias: (state) => state.medias,
media: (state) => (id) => state.medias.find((media) => media.schluessel === id),
buildtypes: (state) => state.buildtypes,
buildtype: (state) => (id) => state.buildtypes.find((buildtype) => buildtype.schluessel === id),
isInitialized: (state) => state.isInitialized,
};
const mutations = {
setCameras(state, payload) {
console.log("mutation.setCameras");
setInventory(state, payload) {
console.log("mutation.setInventory");
const camerasDA = [];
payload.map((camera) => {
state.cameras.push({
@ -39,7 +51,7 @@ const mutations = {
},
storeCamera(sate, payload) {
// console.log("mutation.storeCamera", payload)
const objCamera = state.cameras.find((camera) => camera.id === payload.id);
const objCamera = state.inventory.find((camera) => camera.id === payload.id);
if (objCamera) {
// console.log("found existing Camera", objCamera.id);
payload.edit = false;
@ -48,7 +60,7 @@ const mutations = {
else {
// console.log("creating new Camera");
payload.edit = false;
state.cameras.push(payload);
state.inventory.push(payload);
}
return payload.id;
},
@ -63,50 +75,38 @@ const mutations = {
const objCamera = state.cameras.find((camera) => camera.id === payload.id);
objCamera.edit = payload.edit;
},
setBrands(state, payload) {
// console.log("mutation.setBrands");
state.brands = payload;
// console.log("STORE", state.brands);
},
setConditions(state, payload) {
//console.log("mutation.setConditions");
state.conditions = payload;
//console.log("STORE", state.conditions);
},
setBuildtypes(state, payload) {
//console.log("mutation.setBuildtypes");
state.buildtypes = payload;
//console.log("STORE", state.buildtypes);
setNameKeys(state, payload) {
const field = payload.namekey_type;
state[field] = payload.values;
},
setInitialized(state, payload) {
state.isInitialized = payload;
}
};
const actions = {
fetchCameras(context) {
console.log("action.fetchCameras");
db.getItems("cameras").then((cameras) => {
console.log("From DB", cameras);
context.commit("setCameras", cameras);
fetchNameKeys(context, payload) {
const field = payload.namekey_type;
db.getItems(field).then((items) => {
context.commit("setNameKeys", {
namekey_type: field,
values: items
});
});
},
fetchBrands(context) {
context.commit("setBrands", seed.brands);
},
fetchBuildTypes(context) {
context.commit("setBuildtypes", seed.buildtype);
},
fetchCondition(context) {
context.commit("setConditions", seed.conditions);
fetchInventory(context, payload) {
const field = payload.namekey_type;
db.getItems(field).then((items) => {
context.commit("setInventory", items);
});
},
setCameraActiveState(context, payload) {
console.log("action.setCameraActiveState", payload);
const cameraObj = state.cameras.find((camera) => camera.id === payload.cameraId);
const cameraObj = state.inventory.find((camera) => camera.item_type === "camera" && camera.id === payload.cameraId);
context.commit("setCameraActiveState", { id: payload.cameraId, active: payload.active });
},
setCameraEditState(context, payload) {
console.log("action.setCameraEditState", payload);
const cameraObj = state.cameras.find((camera) => camera.id === payload.cameraId);
const cameraObj = state.inventory.find((camera) => camera.item_type === "camera" && camera.id === payload.cameraId);
context.commit("setCameraEditState", { id: payload.cameraId, edit: payload.edit });
},
storeCamera(context, payload) {
@ -122,15 +122,23 @@ const actions = {
context.commit("setCameraActiveState", { cameraId: payload.id, active: true });
},
initialize(context, payload) {
const stores = [
"inventory",
"brands",
"conditiosn",
"buildtypes",
"medias",
"mounts",
"sets"
];
db.getDb();
const promises = [];
const seedVersion = localStorage.getItem("SEED_VERSION") || 0;
if (payload.seed && seedVersion < SEED_VERSION) {
console.log("SEEDING database");
promises.push(db.saveItems(seed.brands, "brands"));
promises.push(db.saveItems(seed.conditions, "conditions"));
promises.push(db.saveItems(seed.buildtype, "buildtypes"));
promises.push(db.saveItems(seed.cameras, "cameras"));
for (const store of stores) {
promises.push(db.saveItems(seed[store], store));
}
localStorage.setItem("SEED_VERSION", seed.SEED_VERSION.toString());
}
else {
@ -138,12 +146,13 @@ const actions = {
}
Promise.all(promises).then((e) => {
console.log("All written to store");
});
context.dispatch("fetchCameras");
context.dispatch("fetchBrands");
context.dispatch("fetchBuildTypes");
context.dispatch("fetchCondition");
for (const store of stores) {
if (store === "inventory")
context.dispatch("fetchInventory");
context.dispatch("fetchNameKeys", { namekey_type: store });
}
context.commit("setInitialized", true);
});
}
};
const modules = {};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,226 @@
import {ActionContext} from "vuex";
import * as seed from "@/seed";
import BilliDB from "@/indexdDB";
import { v4 as uuidv4 } from 'uuid';
import {SEED_VERSION} from "@/seed";
import NameKey from "@/store/classes/NameKey";
import InventoryItem from "@/store/classes/InventoryItem";
import Camera from "@/store/classes/Camera";
const db = new BilliDB("billibox", 3);
const stores = [
"inventory",
"brands",
"conditions",
"buildtypes",
"manufacturers",
"medias",
"mounts",
"sets"
];
const state = {
isInitialized: false,
inventory: [],
brands: [],
manufacturers: [],
conditions: [],
medias: [],
mounts: [],
sets: [],
buildtypes: []
};
const getters = {
inventory: (state:any) => {
return state.inventory
},
cameras: (state: any) => {
return state.inventory.find((item:InventoryItem) => item.item_type ==="camera");
},
camera: (state: any) => (id: any) => state.inventory.find((item: any) => item.item_type==="camera" &&item.id === id),
activeItem: (state: any) => state.inventory.find((item:any) => item.active ),
lenses: (state: any) => {
return state.inventory.find((item:InventoryItem) => item.item_type ==="lens");
},
lens: (state: any) => (id: any) => state.inventory.find((item: any) => item.item_type==="lens" &&item.id === id),
accessories: (state: any) => {
return state.inventory.find((item:InventoryItem) => item.item_type ==="accessoire");
},
accessoire: (state: any) => (id: any) => state.inventory.find((item: any) => item.item_type==="accessoire" &&item.id === id),
brands: (state: any) => state.brands,
brand: (state: any) => (id: any) => state.brands.find((brand: any) => brand.key === id),
manufacturers: (state: any) => state.manufacturers,
manufacturer: (state: any) => (id: any) => state.manufacturers.find((item: any) => item.key === id),
mounts: (state: any) => state.mounts,
mount: (state: any) => (id: any) => state.mounts.find((item: any) => item.key === id),
conditions: (state: any) => state.conditions,
condition: (state: any) => (id: any) => state.conditions.find((condition: any) => condition.key === id),
medias: (state: any) => state.medias,
media: (state: any) => (id: any) => state.medias.find((media: any) => media.key === id),
buildtypes: (state: any) => state.buildtypes,
buildtype: (state: any) => (id: any) => state.buildtypes.find((buildtype: any) => buildtype.key === id),
isInitialized: (state:any ) => state.isInitialized,
};
const mutations = {
setInventory(state:any, payload:any) {
console.log("mutation.setInventory");
payload.map((item:InventoryItem) => {
state.inventory.push({
...item,
edit: false,
active: false
})
})
console.log("STORE", state.inventory.length);
},
storeCamera(sate:any, payload:any) {
const objCamera = state.inventory.find((camera:Camera) => camera.id === payload.id);
if(objCamera) {
payload.edit =false;
objCamera.name = payload.name;
} else {
payload.edit = false;
state.inventory.push(payload);
}
return payload.id;
},
setItemActiveState(state:any, payload:any) {
console.log("mutation.setItemActiveState");
state.inventory.map((item:InventoryItem) => item.active= false);
const objItem = state.inventory.find((itemId:InventoryItem) => itemId.id === payload.id);
objItem.active = payload.active;
console.log("Result of mutation", objItem);
},
setItemEditState(state:any, payload:any) {
state.inventory.map((item:InventoryItem) => item.edit= false);
const objItem = state.inventory.find((camera:any) => camera.id === payload.id);
objItem.edit = payload.edit;
},
setNameKeys(state:any, payload:any) {
const field = payload.namekey_type;
state[field] = payload.values;
},
setInitialized(state:any, payload:boolean) {
state.isInitialized = payload;
}
};
const actions = {
fetchNameKeys(context:ActionContext<any, any>, payload) {
const field =payload.namekey_type;
db.getItems(field).then((items) => {
context.commit("setNameKeys", {
namekey_type: field,
values:items
});
})
},
fetchInventory(context:ActionContext<any, any>, payload) {
console.log("action.fetchInventory")
db.getItems("inventory").then((items) => {
context.commit("setInventory", items);
})
},
setItemActiveState(context:ActionContext<any, any>, payload:any) {
context.commit("setItemActiveState", {id: payload.id, active:payload.active});
},
setItemEditState(context:ActionContext<any, any>, payload:any) {
console.log("action.setItemEditState", payload)
context.commit("setItemEditState", {id: payload.id, edit:payload.edit});
},
storeCamera(context:ActionContext<any, any>, payload:any) {
// console.log("action.storeCamera", payload)
if(!payload.id) payload.id = uuidv4();
//console.log(" ... with id ", payload.id);
//console.log("Try to save to indexDB");
db.saveItem(payload , "inventory").then( (res) => {
console.log("DB-Save resolved", res )}
)
context.commit("storeCamera", payload);
context.commit("setCameraActiveState", {cameraId:payload.id, active:true})
},
loadDataFromLocalDB(context:ActionContext<any, any>) {
console.log("action.loadDataFromLocalDB")
const storeActions = [];
for (const store of stores) {
if(store ==="inventory") {
storeActions.push(context.dispatch("fetchInventory"));
}
else {
storeActions.push(context.dispatch("fetchNameKeys", {namekey_type:store}));
}
}
Promise.all(storeActions).then( () => {
context.commit("setInitialized", true);
});
},
initialize(context:ActionContext<any, any>, payload) {
db.getDb().then( () => {
const promises = [];
const seedVersion = localStorage.getItem("SEED_VERSION") || 0;
if(payload.seed && seedVersion < SEED_VERSION ) {
console.log("SEEDING database");
for (const store of stores) {
promises.push(db.saveItems(seed[store], store));
}
localStorage.setItem("SEED_VERSION", seed.SEED_VERSION.toString())
} else {
console.log("SEEDING skipped");
context.dispatch("loadDataFromLocalDB")
.then(() => console.log("Store Data loaded"))
.catch((e) => console.log("Error loading StoreData", e));
}
});
}
};
const modules = {};
const inventoryModule = {
state,
getters,
mutations,
actions,
modules
}
export default inventoryModule