<template>
  <div class="fwgl_container">
    <side-nav-bar
      title="数据分析中心"
      imgSrc="tool_fuwu"
      :nav-list="navList"
      :title-path="navList[0] && navList[0].path"
    ></side-nav-bar>
    <div class="main_container">
      <router-view :key="'type_' + $route.params.type"></router-view>
    </div>
  </div>
</template>

<script>
import sideNavBar from "@/components/side-nav-bar";

export default {
  components: {
    sideNavBar
  },
  data: () => ({
    userNav: [
      {
        name: "我的服务数据分析",
        path: `/data_analysis/my_service`
      },
      {
        name: "我的应用数据分析",
        path: `/data_analysis/my_application`
      },
      {
        name: "组织服务数据分析",
        path: `/data_analysis/org_service`
      },
      {
        name: "组织应用数据分析",
        path: `/data_analysis/org_application`
      },
      {
        name: "运行概况-组织",
        path: `/data_analysis/operation_overview`
      },
      {
        name: "服务管控-组织",
        path: `/data_analysis/service_control`
      }
    ],
    navList: []
  }),
  watch: {
    "$route.fullPath"(path) {
      this.initNavList();
    }
  },
  methods: {
    initNavList() {
      this.navList = this.userNav;
    }
  },
  mounted() {
    this.initNavList();
  }
};
</script>

<style scoped>
.fwgl_container {
  height: calc(100vh - 84px);
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
}
.side_nav_bar {
  width: 180px;
  flex-shrink: 0;
}
.main_container {
  width: calc(100% - 180px);
  flex-grow: 1;
  flex-shrink: 1;
  background-color: #f6f7fb;
  overflow: auto;
}
</style>
