const { homePage } = require('../../config')
// 视图组件
const view = {
  tabs: () => import('@vue2-client/layouts/tabs'),
  blank: () => import('@vue2-client/layouts/BlankView'),
  page: () => import('@vue2-client/layouts/PageView'),
  // his-web$ceshiGrid?type=GridView&configName=RxPreparedMed
  gridView: () => import('@vue2-client/layouts/GridView'),
  login: () => import('@vue2-client/pages/login/Login'),
  loginv3: () => import('@vue2-client/pages/login/LoginV3')
}
// 动态路由对象定义
const routerResource = {}
// --------------------------------------基本视图组件--------------------------------------
// 空白视图
routerResource.blank = view.blank
// 单页面视图
routerResource.singlePage = view.blank
// 栅格配置视图
routerResource.gridView = () => import('@vue2-client/layouts/GridView')
// VuePage视图
routerResource.vuePage = () => import('@vue2-client/layouts/VuePage')
// 测试
routerResource.businessQuery = view.blank
// 业务查询 - 收费查询
routerResource.chargeQuery = () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue')
// --------------------------------------仪表盘--------------------------------------
routerResource.dashboard = view.blank
// 工作台
routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
// --------------------------------------系统配置--------------------------------------
routerResource.system = view.blank
// 字典管理
routerResource.dictionaryManage = () => import('@vue2-client/pages/system/dictionary')
// 文件管理
routerResource.fileManager = () => import('@vue2-client/pages/system/file')
// 登录日志
routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
// 操作日志
routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
// 系统问题反馈工单
routerResource.submitTicket = () => import('@vue2-client/pages/system/ticket')
// 通用服务评价
routerResource.ServiceReview = () => import('@vue2-client/pages/ServiceReview')
// 系统设置
routerResource.settings = () => import('@vue2-client/pages/system/settings')
// 页面编辑器
routerResource.editablePage = () => import('@vue2-client/pages/lowCode/lowCodeEditor.vue')
// 数据检索
routerResource.dynamicStatistics = () => import('@vue2-client/pages/DynamicStatistics')
// 数据检索(新)
routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynamicStatistics')

routerResource.machineHand = () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue')
// 示例页面
routerResource.example = {
  path: 'example',
  name: '示例主页面',
  // component: () => import('@vue2-client/pages/LayoutTest/index.vue')
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue')
  // component: () => import('@vue2-client/base-client/components/his/HChart/demo.vue'),
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
  component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue')
  // component: () => import('@vue2-client/base-client/components/common/AfMap/demo.vue')
  // component: () => import('@vue2-client/base-client/components/common/ImagePreviewModal/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XImagePreview/demo.vue'),
  // component: () => import('@vue2-client/components/xScrollBox/example.vue'),
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue')
  // component: () => import('@vue2-client/base-client/components/common/XInspectionDetailDrawer/demo.vue')
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue')
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/HIS/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XForm/demo.vue'),
  // component: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelectDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/his/XImportExcelButton/XFrontImportExcelDemo.vue'),
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
  // component: () => import('@vue2-client/pages/XPageViewExample/index.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
  // component: () => import('@vue2-client/base-client/components/common/XPrint/Demo.vue'),
  // component: () => import('@vue2-client/base-client/components/AI/demo.vue'),
  // component: () => import('@vue2-client/components/g2Charts/demo.vue'),
  // component: () => import('@vue2-client/pages/LogicCallExample/index.vue'),
  // component: () => import('@vue2-client/components/FilePreview/FilePreviewDemo.vue'),
  // component: () => import('@vue2-client/pages/ReportGrid/index.vue'),
  // component: () => import('@vue2-client/base-client/components/common/HIS/demo.vue'),
}
// routerResource.example = () =>
//    import('@vue2-client/pages/Example')
routerResource.XReportView = () => import('@vue2-client/pages/XReportView')

routerResource.XReportGrid = () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo')

routerResource.XTab = () => import('@vue2-client/base-client/components/common/XInspectionDetailDrawer/demo.vue')
routerResource.addressManage = () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue')
// 大屏界面, 放行登录
routerResource.bigDashboard = () => import('@vue2-client/pages/dashboard/index.vue')

// 基础路由组件注册
const routerMap = {
  login: {
    authority: '*',
    path: '/login',
    component: process.env.VUE_APP_LOGIN_VERSION === 'V3' ? view.loginv3 : view.login
  },
  root: {
    path: '/',
    name: '首页',
    // 只有在非微前端环境下才进行重定向，或者通过环境变量控制
    redirect: window.__MICRO_APP_ENVIRONMENT__ ? undefined : homePage,
    component: process.env.VUE_APP_SINGLE_PAPER === 'TRUE' ? view.blank : view.tabs
  },
  exp403: {
    authority: '*',
    name: 'exp403',
    path: '403',
    component: () => import('@vue2-client/pages/exception/403')
  },
  exp404: {
    name: 'exp404',
    path: '404',
    component: () => import('@vue2-client/pages/exception/404')
  },
  exp500: {
    name: 'exp500',
    path: '500',
    component: () => import('@vue2-client/pages/exception/500')
  }
}
Object.assign(routerMap, routerResource)
export default routerMap
