<template>
	<div>
		<t-frame :logo-router="logoRouter" :navs="navs" :count="count" :authorization="authorization" :tag="tag" :menu-list="menuList"  @menu-click="menuClick"></t-frame>
	</div>
</template>
<script>
  import authorization from './authorization.js'
  import { transData } from '../src/utils/utils.js'
  let menu = [
    {
        "menuId": 150104,
        "menuName": "系统日志查询",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/systemLogManage/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 20,
        "menuName": "Accounting Manage",
        "menuDesc": null,
        "menuPid": -1,
        "menuPidName": null,
        "menuType": "0",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": null,
        "menuPic": null,
        "rightTag": "ACCT",
        "systemId": "11009",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1703,
        "menuName": "Batch Query",
        "menuDesc": null,
        "menuPid": 17,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-inquery",
        "menuPic": null,
        "rightTag": "ORD",
        "systemId": "11006",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1801,
        "menuName": "Physical Storage",
        "menuDesc": null,
        "menuPid": 18,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-storage-new",
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 150101,
        "menuName": "机构管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/departMentManage/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 163,
        "menuName": "操作员管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/manager/oper/list",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 43,
        "menuName": "用户登录记录查询",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/systemLogManage/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 40,
        "menuName": "操作员权限管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/manager/operPower/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 19,
        "menuName": "Customer Manage",
        "menuDesc": null,
        "menuPid": -1,
        "menuPidName": null,
        "menuType": "0",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": null,
        "menuPic": null,
        "rightTag": "CRM",
        "systemId": "11008",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 150102,
        "menuName": "区域管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/areaManage/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 161,
        "menuName": "菜单管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/menu/menuMaintain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1702,
        "menuName": "Cmi Batch",
        "menuDesc": null,
        "menuPid": 17,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-batch",
        "menuPic": null,
        "rightTag": "ORD",
        "systemId": "11006",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1804,
        "menuName": "Resource query",
        "menuDesc": null,
        "menuPid": 18,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-Resource-information",
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1802,
        "menuName": "Inquery Result",
        "menuDesc": null,
        "menuPid": 18,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-storage-info",
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 164,
        "menuName": "员工管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/staffManage/toStaffMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 42,
        "menuName": "公告查询",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/bulletinManage/toBulletinQuery",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 41,
        "menuName": "公告管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/bulletinManage/toBulletin",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1701,
        "menuName": "Order Query",
        "menuDesc": null,
        "menuPid": 17,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-order",
        "menuPic": null,
        "rightTag": "ORD",
        "systemId": "11006",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 17,
        "menuName": "Order Manage",
        "menuDesc": null,
        "menuPid": -1,
        "menuPidName": null,
        "menuType": "0",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": null,
        "menuPic": null,
        "rightTag": "ORD",
        "systemId": "11006",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 2001,
        "menuName": "Bill Query",
        "menuDesc": null,
        "menuPid": 20,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-bill-manage",
        "menuPic": null,
        "rightTag": "ACCT",
        "systemId": "11009",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 150103,
        "menuName": "数据权限管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/system/dataPowerManage/toMain",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 162,
        "menuName": "角色管理",
        "menuDesc": null,
        "menuPid": 16,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/role/roleList?rightTag=CRM",
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 16,
        "menuName": "系统管理",
        "menuDesc": null,
        "menuPid": -1,
        "menuPidName": null,
        "menuType": "0",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": null,
        "menuPic": null,
        "rightTag": "SYS",
        "systemId": "11005",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1803,
        "menuName": "Inventory Query",
        "menuDesc": null,
        "menuPid": 18,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-storage-check",
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1805,
        "menuName": "Product Binding",
        "menuDesc": null,
        "menuPid": 18,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-Product-binding",
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 18,
        "menuName": "Resource Manage",
        "menuDesc": null,
        "menuPid": -1,
        "menuPidName": null,
        "menuType": "0",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": null,
        "menuPic": null,
        "rightTag": "RES",
        "systemId": "11007",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    },
    {
        "menuId": 1901,
        "menuName": "Customer 360 Views",
        "menuDesc": null,
        "menuPid": 19,
        "menuPidName": null,
        "menuType": "1",
        "menuOrder": 0,
        "menuTarget": null,
        "menuUrl": "/cmi-Customer-View",
        "menuPic": null,
        "rightTag": "CRM",
        "systemId": "11008",
        "activeTime": null,
        "inactiveTime": null,
        "treeDisplay": null,
        "createTime": null,
        "createOperId": 0,
        "updateTime": null,
        "updateOperId": 0,
        "funcType": null,
        "systemUrl": ""
    }]
  let menuList = transData(menu, 'menuId', 'menuPid', 'children')
  console.log('menulist', menuList)
  export default {
    data () {
      return {
        logoRouter: { path: '/'},
        authorization: authorization,
        tag: 'CRM',
        menuList: menuList,
        navs: [
          {
            type: 'icon',
            icon: 'bell'
          },
          {
            type: 'dropdown',
            icon: 'account-circle',
            children: [
              {
                name: 'icon1'
              },
              {
                name: 'icon2'
              },
              {
                name: 'icon3'
              }
            ]
          },
          {
            type: 'icon',
            icon: 'arrow-right-bold-box-outline',
            handleType: 'logout'
          }
        ],
        count: 6,
        activeMenu: '30',
        openNames: [3]
      }
    },
    methods: {
      menuClick (name) {
        console.log('menu', name)
      }
    }
  }
</script>
