<template>
  <div class="process_container">
    <side-nav-bar
      title="流程设计"
      imgSrc="tool_ic_tuisong"
      :nav-list="navList"
      :title-path="navList[0] && navList[0].path"
    ></side-nav-bar>
    <div class="main_container">
      <router-view></router-view>
    </div>
  </div>
</template>

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

export default {
  components: {
    sideNavBar,
  },
  data: () => ({
    userNav: [
      {
        name: "流程管理",
        path: `/progress/designer`,
      },
      {
        name: "流程监控",
        path: `/progress/monitoring`,
      },
    ],
    navList: [],
  }),
  watch: {
    "$route.fullPath"(path) {
      this.initNavList();
    },
  },
  methods: {
    initNavList() {
      this.navList = this.userNav;
    },
  },
  mounted() {
    this.initNavList();
  },
};
</script>

<style scoped>
.process_container {
  height: calc(100vh - 58px);
  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>
