<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2019-07-22 19:42:16
 * @LastEditors: 无尘
 * @LastEditTime: 2019-07-22 19:42:16
 -->
<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: this.$route.query.projectName ? `${this.$route.query.projectName}项目列表` : '',
          path: '/apiProgramGroup'
        },
        {
          name: this.$route.query.interfaceGroupName ? `${this.$route.query.interfaceGroupName}分组列表` : '',
          path: '/groupApiList'
        },
        {
          name: this.$route.query.interfaceName ? `${this.$route.query.interfaceName}` : '',
          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>
