import Layout from '@/layout'

const financeRouter = {
  path: '/finance',
  component: Layout,
  redirect: '/finance/receipt',
  alwaysShow: true, // will always show the root menu
  name: 'FinanceSetting', // name必须和后台配置一致，不然匹配不到
  meta: { title: '财务设置', icon: 'component' },
  children: [
    {
      path: 'receipt',
      component: () => import('@/views/index'),
      redirect: '/finance/receipt/list',
      name: 'ReceiptManage',
      meta: { title: '收款列表', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/finance/receipt/list.vue'),
          name: 'ReceiptList',
          meta: { title: '收款列表', activeMenu: '/finance/receipt' }
        },
        {
          path: 'detail',
          hidden: true,
          component: () => import('@/views/finance/receipt/detail.vue'),
          name: 'ReceiptDetail',
          meta: { title: '收款详情', noCache: true, activeMenu: '/finance/receipt' }
        }
      ]
    },
    {
      path: 'receipts',
      component: () => import('@/views/index'),
      redirect: '/finance/receipts/users',
      name: 'ReceiptUserManage',
      meta: { title: '收款人权限', icon: 'documentation' },
      children: [
        {
          path: 'users',
          hidden: true,
          component: () => import('@/views/finance/receipt/users.vue'),
          name: 'ReceiptUserList',
          meta: { title: '收款人权限', activeMenu: '/finance/receipts' }
        },
        {
          path: 'user/edit',
          hidden: true,
          component: () => import('@/views/finance/receipt/user.vue'),
          name: 'ReceiptUserEdit',
          meta: { title: '编辑收款人', noCache: true, activeMenu: '/finance/receipts' }
        },
        {
          path: 'user/add',
          hidden: true,
          component: () => import('@/views/finance/receipt/user.vue'),
          name: 'ReceiptUserEdit',
          meta: { title: '添加收款人', noCache: true, activeMenu: '/finance/receipts' }
        }
      ]
    }
  ]
}
export default financeRouter
