import type { RouteRecordRaw } from 'vue-router'

const asyncRouter: RouteRecordRaw[] = [
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/exception/403.vue'),
    meta: {
      title: '首页',
      icon: 'House'
    }
  },
  // -- APPEND HERE --
  {
    path: 'https://jijian.sxidc.com/',
    name: 'jijian',
    component: () => ({}),
    meta: {
      title: '极简低代码',
      icon: 'Aim'
    }
  },
  {
    path: '/system',
    name: 'system',
    meta: {
      title: '系统管理',
      icon: 'icon-system'
    },
    children: [
      {
        path: '/system/user',
        name: 'systemUser',
        component: () => import('@/views/system/User.vue'),
        meta: {
          title: '用户管理',
          icon: 'user',
          keepAlive: true,
          viewName: 'User'
        }
      },
      {
        path: '/system/role',
        name: 'systemRole',
        component: () => import('@/views/system/Role.vue'),
        meta: {
          title: '角色管理',
          icon: 'avatar',
          keepAlive: true,
          viewName: 'Role'
        }
      },
      {
        path: '/system/dict',
        name: 'systemDict',
        component: () => import('@/views/system/Dict.vue'),
        meta: {
          title: '字典管理',
          icon: 'memo'
        }
      },
      {
        path: '/system/menu',
        name: 'systemMenu',
        component: () => import('@/views/system/Menu.vue'),
        meta: {
          title: '菜单管理',
          icon: 'menu'
        }
      },
      {
        path: '/system/area',
        name: 'systemArea',
        component: () => import('@/views/system/Area.vue'),
        meta: {
          title: '区域管理',
          icon: 'Reading'
        }
      },
      {
        path: '/system/configure',
        name: 'systemConfigure',
        component: () => import('@/views/system/Configure.vue'),
        meta: {
          title: '系统配置',
          icon: 'Edit'
        }
      }
    ]
  },
  {
    path: '/org',
    name: 'org',
    meta: {
      title: '组织机构',
      icon: 'OfficeBuilding'
    },
    children: [
      {
        path: '/org/orgList',
        name: 'orgList',
        component: () => import('@/views/org/Org.vue'),
        meta: {
          title: '机构管理',
          icon: 'OfficeBuilding'
        }
      }
    ]
  },
  {
    path: '/miniprogram',
    name: 'miniprogram',
    meta: {
      title: '小程序管理',
      icon: 'icon-system'
    },
    children: [
      {
        path: '/miniprogram/banner',
        name: 'miniBanner',
        component: () => import('@/views/miniprogram/Banner.vue'),
        meta: {
          title: '轮播图',
          icon: 'picture'
        }
      },
      {
        path: '/miniprogram/question',
        name: 'miniQuestion',
        component: () => import('@/views/miniprogram/Question.vue'),
        meta: {
          title: '常见问题',
          icon: 'QuestionFilled'
        }
      },
      {
        path: '/miniprogram/feedback',
        name: 'miniFeedback',
        component: () => import('@/views/miniprogram/Feedback.vue'),
        meta: {
          title: '意见反馈',
          icon: 'Promotion'
        }
      },
      {
        path: '/miniprogram/about',
        name: 'miniAbout',
        component: () => import('@/views/miniprogram/About.vue'),
        meta: {
          title: '关于我们',
          icon: 'user'
        }
      },
      {
        path: '/miniprogram/version',
        name: 'miniVersion',
        component: () => import('@/views/miniprogram/Version.vue'),
        meta: {
          title: '版本信息',
          icon: 'list'
        }
      }
    ]
  },
  {
    path: '/list',
    name: 'list',
    meta: {
      title: '列表页',
      icon: 'Notification'
    },
    children: [
      {
        path: '/list/cardList',
        name: 'cardList',
        component: () => import('@/views/list/CardList.vue'),
        meta: {
          title: '卡片列表'
        }
      }
    ]
  },
  {
    path: '/form',
    name: 'form',
    meta: {
      title: '表单页',
      icon: 'Notebook'
    },
    children: [
      {
        path: '/form/basic',
        name: 'formBasic',
        component: () => import('@/views/form/Basic.vue'),
        meta: {
          title: '基础表单'
        }
      },
      {
        path: '/form/advanced',
        name: 'formAdvanced',
        component: () => import('@/views/form/Advanced.vue'),
        meta: {
          title: '高级表单'
        }
      },
      {
        path: '/form/tab',
        name: 'formTab',
        component: () => import('@/views/form/Tab.vue'),
        meta: {
          title: 'tab表单'
        }
      },
      {
        path: '/form/step',
        name: 'formStep',
        component: () => import('@/views/form/Step.vue'),
        meta: {
          title: '步骤表单'
        }
      }
    ]
  },
  {
    path: '/result',
    name: 'result',
    meta: {
      title: '结果页',
      icon: 'CircleCheck'
    },
    children: [
      {
        path: '/result/success',
        name: 'resultSuccess',
        component: () => import('@/views/result/Success.vue'),
        meta: {
          title: '成功页'
        }
      },
      {
        path: '/result/error',
        name: 'resultError',
        component: () => import('@/views/result/Error.vue'),
        meta: {
          title: '失败页'
        }
      }
    ]
  },
  {
    path: '/monitor',
    name: 'monitor',
    meta: {
      title: '系统监控',
      icon: 'Notification'
    },
    children: [
      {
        path: '/monitor/logList',
        name: 'logList',
        component: () => import('@/views/monitor/LogList.vue'),
        meta: {
          title: '日志查询',
          icon: 'List'
        }
      },
      {
        path: '/monitor/messageNotif',
        name: 'messageNotif',
        component: () => import('@/views/monitor/MessageNotif.vue'),
        meta: {
          title: '消息通知',
          icon: 'ChatRound'
        }
      }
    ]
  },
  {
    path: '/extension',
    name: 'extension',
    meta: { title: '扩展组件', icon: 'StarFilled' },
    children: [
      {
        path: '/extension/tableSelect',
        name: 'tableSelect',
        component: () => import('@/views/extension/tableSelect/index.vue'),
        meta: {
          title: '下拉表格',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/splitePanel',
        name: 'splitePanel',
        component: () => import('@/views/extension/splitePanel/index.vue'),
        meta: {
          title: '分割面板',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/excel',
        name: 'excel',
        component: () => import('@/views/extension/excel/index.vue'),
        meta: {
          title: '导入导出Excel',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/checkCard',
        name: 'checkCard',
        component: () => import('@/views/extension/checkCard/index.vue'),
        meta: {
          title: '可选卡片',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/printer',
        name: 'printer',
        component: () => import('@/views/extension/printer/index.vue'),
        meta: {
          title: '打印组件',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/tour',
        name: 'tour',
        component: () => import('@/views/extension/tour/index.vue'),
        meta: {
          title: '引导组件',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/stausText',
        name: 'stausText',
        component: () => import('@/views/extension/stausText/index.vue'),
        meta: {
          title: '文本状态',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/citySelect',
        name: 'citySelect',
        component: () => import('@/views/extension/citySelect/index.vue'),
        meta: {
          title: '区域选择',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/sharePoster',
        name: 'sharePoster',
        component: () => import('@/views/extension/sharePoster/index.vue'),
        meta: {
          title: '海报分享',
          icon: 'MoreFilled'
        }
      },
      {
        path: '/extension/complexSelect',
        name: 'complexSelect',
        component: () => import('@/views/extension/complexSelect/index.vue'),
        meta: {
          title: '组织选择',
          icon: 'MoreFilled'
        }
      }
      // {
      //   path: '/extension/map',
      //   name: 'extensionMap',
      //   component: () => import('@/views/extension/map/index.vue'),
      //   meta: {
      //     title: '地图选择',
      //     icon: 'MoreFilled'
      //   }
      // }
    ]
  },
  {
    path: '/iframe',
    name: 'iframe',
    component: () => import('@/views/iframe/Iframe.vue'),
    meta: {
      title: 'iframe示例',
      icon: 'Notebook'
    }
  },
  {
    path: '/userInfo',
    name: 'userInfo',
    component: () => import('@/views/user/UserInfo.vue'),
    meta: {
      title: '个人中心',
      icon: 'House'
    },
    hidden: true
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/exception/404',
    hidden: true
  }
]

export default asyncRouter
