view client/src/components/App.vue @ 2549:9bf6b767a56a

client: refactored and improved splitscreen for diagrams To make different diagrams possible, the splitscreen view needed to be decoupled from the cross profiles. Also the style has changed to make it more consistent with the rest of the app. The standard box header is now used and there are collapse and expand animations.
author Markus Kottlaender <markus@intevation.de>
date Fri, 08 Mar 2019 08:50:47 +0100
parents bb5286acfee2
children 2d2b7fdc0c01
line wrap: on
line source

<template>
  <div id="app" class="main">
    <div v-if="isAuthenticated" class="d-flex flex-column userinterface">
      <div class="topbar d-flex pt-2 mx-2">
        <div class="mr-auto d-flex">
          <Sidebar :routeName="routeName"></Sidebar>
          <div :class="searchContainer">
            <Search v-if="isMapVisible"></Search>
            <Contextbox v-if="isMapVisible"></Contextbox>
          </div>
        </div>
        <div class="ml-auto d-flex">
          <div class="d-flex flex-column align-items-end">
            <Profiles v-if="isMapVisible"></Profiles>
            <Pdftool v-if="isMapVisible"></Pdftool>
          </div>
          <div class="d-flex flex-column align-items-end">
            <Identify v-if="isMapVisible"></Identify>
            <Layers v-if="isMapVisible"></Layers>
          </div>
          <Toolbar v-if="isMapVisible"></Toolbar>
        </div>
      </div>
      <div class="flex-fill"></div>
      <div class="d-flex flex-row align-items-end">
        <Infobar v-if="isMapVisible"></Infobar>
      </div>
      <Zoom v-if="isMapVisible"></Zoom>
      <Splitscreen />
    </div>
    <div class="d-flex flex-column"><router-view /></div>
    <vue-snotify></vue-snotify>
    <Popup />
  </div>
</template>

<style lang="scss" scoped>
.userinterface {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
}

#app {
  height: 100%;
  width: 100%;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>

<script>
/* This is Free Software under GNU Affero General Public License v >= 3.0
 * without warranty, see README.md and license for details.
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 * License-Filename: LICENSES/AGPL-3.0.txt
 *
 * Copyright (C) 2018 by via donau
 *   – Österreichische Wasserstraßen-Gesellschaft mbH
 * Software engineering by Intevation GmbH
 *
 * Author(s):
 * Thomas Junk <thomas.junk@intevation.de>
 * Markus Kottländer <markus.kottlaender@intevation.de>
 */
import { mapState } from "vuex";

export default {
  name: "app",
  computed: {
    ...mapState("user", ["isAuthenticated"]),
    ...mapState("application", ["contextBoxContent", "showSearchbar"]),
    isMapVisible() {
      return /importoverview|stretches|review|bottlenecks|mainview/.test(
        this.routeName
      );
    },
    routeName() {
      const routeName = this.$route.name;
      return routeName;
    },
    searchContainer() {
      return [
        "ml-2",
        {
          wide: this.showSearchbar
        }
      ];
    }
  },
  components: {
    Profiles: () => import("./fairway/Profiles"),
    Infobar: () => import("./fairway/Infobar"),
    Pdftool: () => import("./Pdftool"),
    Zoom: () => import("./Zoom"),
    Identify: () => import("./identify/Identify"),
    Layers: () => import("./layers/Layers"),
    Sidebar: () => import("./Sidebar"),
    Search: () => import("./Search"),
    Contextbox: () => import("./Contextbox"),
    Toolbar: () => import("./toolbar/Toolbar"),
    Popup: () => import("./Popup"),
    Splitscreen: () => import("./Splitscreen")
  }
};
</script>