diff --git a/front/src/assets/sidebar.scss b/front/src/assets/sidebar.scss index b61baac..20eaf6e 100644 --- a/front/src/assets/sidebar.scss +++ b/front/src/assets/sidebar.scss @@ -55,9 +55,6 @@ $boxShadow: 0px 0px 8px rgba(0, 0, 0, .25); } &-content { - max-height: 50vh; - overflow: auto; - background-color: $bg; border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem; @@ -70,6 +67,7 @@ $boxShadow: 0px 0px 8px rgba(0, 0, 0, .25); padding: 1.125rem 1rem; border-bottom: 2px solid var(--primary-color); max-height: 4rem; + overflow: hidden; transition: max-height 300ms linear; &:last-child { diff --git a/front/src/components/Promo/load_models.vue b/front/src/components/Promo/load_models.vue index 3de0425..8a90b0e 100644 --- a/front/src/components/Promo/load_models.vue +++ b/front/src/components/Promo/load_models.vue @@ -93,9 +93,12 @@ const loadModels = async () => { (controls.value as any)._needsUpdate = true; (controls.value as any).update() - const sidebar_items = [] as PromoScene[] + const sidebar_clickable = [] as PromoScene[] + const sidebar_visible = [] as PromoScene[] clickable_items.value = [] + sidebar_scene.setName({ name: raw_data.name, description: raw_data.name }) + loading_store.status = 'model' for (let index = 0; index < data.length; index++) { loading_store.count = index @@ -105,6 +108,7 @@ const loadModels = async () => { item.modelUrl = `${IMAGE_URL}/${element.model_file}` let { scene: loaded_scene } = await useGLTF(item.modelUrl) item.modelFile = loaded_scene + item.id = element.id item.name = element.name if (!element.is_enabled) { @@ -126,7 +130,12 @@ const loadModels = async () => { const res = await fetch(`${SERVER_URL}/api/obj/clickable/?source=${element.id}`) const clickable_areas = await res.json() clickable.list.push(...clickable_areas) + + if (!element.can_not_disable) { + sidebar_visible.push(element) + } } + sidebar_scene.setVisible(sidebar_visible) let c = new Color() if (envVars.clear_color) { @@ -195,15 +204,15 @@ const loadModels = async () => { clickable_items.value.push(point) clickable_refs.value.push(ref(`${element.id}_clickable`)) - sidebar_items.push({ + sidebar_clickable.push({ + is_enabled: true, id: element.id, name: element.name }) } } - sidebar_scene.name = raw_data.name; - sidebar_scene.setData(sidebar_items) + sidebar_scene.setClickable(sidebar_clickable) loading_store.status = 'boxes' const box = new Box3(); @@ -385,7 +394,8 @@ onUnmounted(() => { diff --git a/front/src/components/Promo/sidebar.vue b/front/src/components/Promo/sidebar.vue index a141b65..4d6ea8f 100644 --- a/front/src/components/Promo/sidebar.vue +++ b/front/src/components/Promo/sidebar.vue @@ -8,8 +8,6 @@ const sidebar = usePromoSidebar() const sidebar_scene = usePromoScene() const sidebar_obj = ref() -const route = useRoute() - const opened_desc = ref() const openedChange = () => { @@ -46,6 +44,29 @@ const toggleAccordion = (name: string) => {

Объекты

+ + + + - - \ No newline at end of file diff --git a/front/src/stores/promo_scene.ts b/front/src/stores/promo_scene.ts index 98680fd..9ac0053 100644 --- a/front/src/stores/promo_scene.ts +++ b/front/src/stores/promo_scene.ts @@ -1,19 +1,28 @@ import { defineStore } from 'pinia' type state = { - name: string, - list: PromoScene[] + name?: string, + description?: string, + clickable: PromoScene[], + visible: PromoScene[], } export const usePromoScene = defineStore('promo_scene', { state: () => { return { - name: '', - list: [] + clickable: [], + visible: [], } as state }, actions: { - setData(data: PromoScene[]) { - this.list = data + setName(data: any) { + this.name = data.name + this.description = data.description + }, + setClickable(data: PromoScene[]) { + this.clickable = data + }, + setVisible(data: PromoScene[]) { + this.visible = data } } })