Commit 7723b22b authored by Luna Riegel's avatar Luna Riegel
Browse files

Add object library icons and onclick

parent 58a77157
<template>
<v-sheet>
<VcsFormSection heading="Objektbibliothek">
<VcsFormSection heading="Objektbibliothek" expandable>
<template #help>
<p>Objektbibliothek:</p>
<span>Die Objektbibliothek.</span>
</template>
<template #default>
<v-expansion-panels v-for = "(subcats, categoryName) in objLib" :key="categoryName">
<v-expansion-panel title="categoryName">
<v-expansion-panel >
<v-expansion-panel-title>{{ categoryName }}</v-expansion-panel-title>
<v-container class="py-1 px-1">
<v-list v-for="(entries, subCategory) in subcats" :key = "subCategory" title="subCategory">
<v-container v-for="(entries, subCategory) in subcats" :key = "subCategory" class="py-1 px-1">
<VcsLabel>{{subCategory}}</VcsLabel>
<v-list>
<v-row>
<v-list-item
v-for="entry in entries"
:key="entry.title"
class="d-flex align-center"
@click="fetchCatalogueModel(entry.model)"
style ="cursor: pointer;"
>
<template #prepend>
<v-avatar size="32">
<img :src="entry.icon" :alt="entry.title" />
</v-avatar>
</template>
<v-list-item-title>{{ entry.title }}</v-list-item-title>
<img :src="entry.icon" :alt="entry.icon"/>
</v-list-item>
</v-row>
</v-list>
<v-divider/>
</v-container>
</v-expansion-panel>
</v-expansion-panels>
......@@ -101,9 +100,11 @@
<script>
import {
Icons,
NotificationType, VcsExpansionPanel,
NotificationType,
VcsExpansionPanel,
VcsFormButton,
VcsFormSection,
VcsLabel,
VcsList,
VcsTextField,
VcsTreeview,
......@@ -118,6 +119,7 @@ import {GLTFExporter} from 'three/addons/exporters/GLTFExporter.js';
import {Cartesian2} from '@vcmap-cesium/engine';
const objLib = ref({});
const preloadedModels = ref({});
const defaultItems = [];
const items = ref(defaultItems);
......@@ -205,6 +207,15 @@ function getCatalogueEntries(json, linkPrefix) {
return part;
}
function retrieveCatalogModel(modelLink){
console.log(modelLink);
if(preloadedModels.value[modelLink] != null){
} else {
}
}
function uploadModel() {
// Create an input element
const inputElement = document.createElement("input");
......@@ -312,6 +323,7 @@ function uploadModel() {
export default {
name: 'objectList',
components: {
VcsLabel,
VcsExpansionPanel,
VcsTreeview,
VcsTreeviewTitle,
......@@ -449,6 +461,9 @@ function uploadModel() {
loadModel() {
uploadModel();
},
fetchCatalogueModel(modelLink) {
retrieveCatalogModel(modelLink);
},
loadConfiguration() {
loadObjects(app);
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment