<template>
  <div class="api-body-content border-box">
    <div class="common-nav">
      <nav-bread :navPath="navPath"></nav-bread>
    </div>
    <div class="api-body-main common-body-main border-box">
      <!-- style="height: auto;" -->
      <div class="api-main-content border-box">
        <api-version-show></api-version-show>
      </div>
    </div>
  </div>
</template>
<script>
import navBread from '@/components/nav/nav-bread.vue';
import apiVersionShow from '@/components/api/api-version-show.vue';
import { getRequest } from '@/api/api';
export default {
  name: 'apiListManageShow',
  components: {
    navBread,
    apiVersionShow
  },
  data() {
    return {
      // 面包屑参数
      navPath: [
        {
          name: 'API管理',
          path: '/apiProgram'
        },
        {
          name: 'API列表',
          path: '/apiList'
        },
        {
          name: '管理',
          path: '/apiListManage'
        },
        {
          name: '查看',
          path: ''
        }
      ]
    };
  },
  methods: {
    /**
     *  获取数据
     */
    getData() {
      const that = this;
      let para = {
        project: that.repProjectName,
        router: that.pathName,
        requestProject: that.repProjectName
      };
      getRequest('/haoban-manage-web/menu-detail', para)
        .then(res => {
          let resData = res.data;
          if (resData.errorCode == 1) {
            if (!resData.result) {
              that.$message.error({
                duration: 1000,
                message: '暂无数据'
              });
              return;
            }
            return;
          }
          that.$message.error({
            duration: 1000,
            message: resData.message
          });
        })
        .catch(function(error) {
          that.$message.error({
            duration: 1000,
            message: error.message
          });
        });
    }
  },
  watch: {
    $route: {
      handler: function(val, oldVal) {},
      // 深度观察监听
      deep: true
    }
  },

  /* 接收数据 */
  mounted() {
    const that = this;
    that.$emit('showTab', 22);
  }
};
</script>

<style lang="less" scoped></style>
