<template>

  <el-scrollbar wrap-class="scrollbar-wrapper">
    <div
      style="height:56px;line-height:56px;padding:0 20px;overflow:hidden;background:#20B6EB;color:#fff;font-size:16px;">
      鲸致生活-门户系统</div>
    <!-- background-color="#304156" -->
    <el-menu v-if="permission_routers.length > 0" :show-timeout="200" :default-active="$route.path"
      :collapse="isCollapse" mode="vertical" background-color="#fff" text-color="#34383D" active-text-color="#20B6EB">
      <!-- text-color="#bfcbd9"
      active-text-color="#409EFF" -->
      <sidebar-item v-for="route in permission_routers" :key="route.path" :item="route" :base-path="route.path" />
    </el-menu>
    <div v-else
      style="margin-top:50px;width: 100%;height: 50px;line-height: 20px;font-size: 13px;text-align: center;color: rgb(153, 153, 153);">
       无此系统权限<br/>如需要请联系管理员</div>
  </el-scrollbar>
</template>

<script>
import { mapGetters } from 'vuex'
import SidebarItem from './SidebarItem'

export default {
  components: { SidebarItem },
  computed: {
    ...mapGetters([
      'permission_routers',
      'sidebar'
    ]),
    isCollapse() {
      return !this.sidebar.opened
    }
  },
  data() {
    return {
      permission_routers1: [
        {
          path: "/user",
          redirect: "noredirect",
          alwaysShow: true,
          name: "userManage",
          meta: {
            title: "会员中心",
            icon: "people"
          },
          children: [
            {
              path: "user",
              name: "user",
              meta: {
                perms: ["GET /admin/user/list"],
                title: "会员管理",
                noCache: true,
                icon: "user",
                keepAlive: true
              }
            },
            {
              path: "address",
              name: "address",
              meta: {
                perms: ["GET /admin/address/list"],
                title: "收货地址",
                noCache: true,
                icon: "tree",
                keepAlive: true
              }
            },
            {
              path: "collect",
              name: "collect",
              meta: {
                perms: ["GET /admin/collect/list"],
                title: "会员收藏",
                noCache: true,
                icon: "clipboard",
                keepAlive: true
              }
            },

          ]
        },
        {
          path: "/order",
          redirect: "noredirect",
          alwaysShow: true,
          name: "mallManage",
          meta: {
            title: "订单中心",
            icon: "shopping"
          },
          children: [
            {
              path: "order",
              name: "order",
              meta: {
                perms: [
                  "GET /admin/order/list",
                  "POST /admin/order/commission",
                  "POST /admin/order/modifyStatus",
                  "GET /admin/order/export",
                  "POST /admin/order/import",
                  "POST /admin/order/applyRefund",
                  "POST /admin/order/delete",
                  "POST /admin/order/reply",
                  "POST /admin/order/createMemo",
                  'POST /admin/hmInterst/addInterst',
                  'POST /admin/orderbook/reassign',
                  'GET /admin/orderbook/cancelBook',
                  'GET /admin/orderbook/finish',
                  "POST /admin/sms/send",
                  'GET /admin/order/ishandle',
                ],
                title: "订单管理",
                noCache: true,
                icon: "order",
                keepAlive: true
              }
            },
            {
              path: "schedulingP",
              name: "schedulingP",
              meta: {
                perms: [
                  'POST /admin/workerOccupy/selectOccupyByQuery'
                ],
                title: "档期管理",
                noCache: true,
                icon: "form",
                keepAlive: true
              }
            },
            {
              path: "addressCheck",
              name: "addressCheck",
              meta: {
                perms: [
                  'GET /admin/addressCheck/getCalendarStockByAddress'
                ],
                title: "服务区域查询",
                noCache: true,
                icon: "guide",
                keepAlive: true
              }
            },

          ]
        },
      ]
    }
  },
  activated() {

  },
  created() {
    console.log(this.$store.state);
  }

}
</script>
<style scoped>
#app .sidebar-container>>>.is-active.submenu-title-noDropdown {
  background: #E5F8FF !important;
  border-left: 4px solid #20B6EB;
}

#app .sidebar-container>>>.is-active>.el-submenu__title {
  background: #E5F8FF !important;
  border-left: 4px solid #20B6EB;
}

/* #app .sidebar-container  >>> .el-submenu  .el-menu-item.is-active{
  background: #E5F8FF!important;
  border-left:4px solid #20B6EB;
} */
</style>
