<template>
  <div class="gridman-container">
    <div class="gridman-header">
      <div class="back-button" @click="backPath"></div>
      {{title}}
    </div>
    <div class="gridman-body">
      <router-view @updateProjectId="updateProjectIdParent"></router-view>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'index',
    created() {

    },
    data() {
      return {
        title : '网格化管理'
      }
    },
    methods: {
      updateProjectIdParent(msg) {
        this.title = msg
      },
      backPath() {
        this.title = '网格化管理'
        if (this.$route.path != '/gridman_navigation') {
          this.$router.push({ 'path': '/gridman' })
        } else {
          this.$router.push({ 'path': '/index' })
        }
      }
    }
  }
</script>

<style scoped>
  .gridman-container {
    width: 100%;
    height: 100%;
    background-image: url(/img/gridman/bg.png);
    background-size: 100% 100%;
  }

  .gridman-header {
    width: 100%;
    height: 99px;
    background-image: url(/img/gridman/header.png);
    background-size: 100% 100%;
    text-align: center;
    color: #fff;
    line-height: 90px;
    font-size: 36px;
    letter-spacing: 5px;
  }

  .back-button {
    width: 140px;
    height: 40px;
    position: absolute;
    top: 60px;
    left: 40px;
    cursor: pointer;

  }

  .gridman-body {
    width: 100%;
    height: calc(100% - 100px);

  }
</style>