/* eslint-disable import/no-unresolved */
import React from 'react';
import {
  DatabaseOutlined,
  UsergroupAddOutlined,
  SolutionOutlined,
  TableOutlined,
  HomeOutlined,
  CreditCardOutlined,
  FileTextOutlined,
  AppstoreOutlined,
  FundProjectionScreenOutlined,
  ReadOutlined,
} from '@ant-design/icons';
import asyncComponent from './importComponent';
// 菜单
// import UserLayout from '@/layouts/UserLayout';
// import BasicLayout from '@/layouts/BasicLayout';
// import BlankLayout from '@/layouts/BlankLayout';
// 登录
// import Login from '@/pages/user/login';
// 解决方案管理
// import CurrentSolution from '@/pages/currentSolution/CurrentSolution';
// 数据库管理
// import InitDataBase from '@/pages/database/InitDataBase/InitDataBase';
// import DatabaseInitialization from '@/pages/database/databaseInitialization/DatabaseInitialization';
// import ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase';
// import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig';
// 用户中心
// import UserManage from '@/pages/userCenter/userManage/UserManage';
// import UserManage from '@/pages/userCenter/userManage/UserManage';

// import RoleManage from '@/pages/userCenter/roleManage/RoleManage';
// import SiteManage from '@/pages/userCenter/siteManage/SiteManage';
// 数据中心
// import Dictionary from '@/pages/dataCenter/dictionary';

// 组态平台

// 平台中心
// import SchemeConfig from '@/pages/platformCenter/gis/schemeConfig/SchemeConfig';
// import DimensionsConfig from '@/pages/platformCenter/gis/dimensionsConfig/dimensionsConfig';
// import MessageManager from '@/pages/platformCenter/messageManage';
// import SchemeDetail from '@/pages/platformCenter/messageManage/schemeDetail/schemeDetail';
// import HostManager from '@/pages/platformCenter/hostmanager';
// import VideoManager from '@/pages/platformCenter/videoManager';
// import BaseFrameContainer from '@/pages/platformCenter/baseFrameContainer';
// import IntegratedLogin from '@/pages/platformCenter/integratedLogin/integrate';
// 业务中心
// import TableManager from '@/pages/bsmanager/base/tablemanager';
// import FiledConfig from '@/pages/bsmanager/base/tablemanager/filedConfig/filedConfig';
// import StandingBook from '@/pages/bsmanager/base/standingBook/standingBook';
// import Incident from '@/pages/bsmanager/workOrder/incident/incident';
// import IncidentFlow from '@/pages/bsmanager/workOrder/incident/incidentFlow';
// import IncidentView from '@/pages/bsmanager/workOrder/incident/incidentView';
// import Flow from '@/pages/bsmanager/workOrder/workFlow/flow';
// import FlowNode from '@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode';
// import Workflow from '@/pages/bsmanager/workOrder/workflowEdit/Workflow';
// import Maintenance from '@/pages/bsmanager/patrolMaintenance/maintenance/maintenance';
// import PatrolFeedback from '@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback';

// 应用中心
// import ProductConfig from '@/pages/productCenter/productConfig/productConfig';
// import WebConfigPage from '@/pages/productCenter/webConfig';
// import MobileConfigPage from '@/pages/productCenter/mobileConfig';

// 系统日志
// import ServiceLog from '@/pages/log/serviceLog';
// import LoginLog from '@/pages/log/loginLog';
// import OmsLog from '@/pages/log/omsLog';

import { USER_MODE } from '@/utils/constants';

// 菜单
const UserLayout = asyncComponent(() => import('@/layouts/UserLayout'));
const BasicLayout = asyncComponent(() => import('@/layouts/BasicLayout'));
const BlankLayout = asyncComponent(() => import('@/layouts/BlankLayout'));
// 登录
const Login = asyncComponent(() => import('@/pages/user/login'));
// 解决方案管理
const CurrentSolution = asyncComponent(() => import('@/pages/currentSolution/CurrentSolution'));
// 数据库管理
const InitDataBase = asyncComponent(() => import('@/pages/database/InitDataBase/InitDataBase'));
const DatabaseInitialization = asyncComponent(() =>
  import('@/pages/database/databaseInitialization/DatabaseInitialization'),
);
const ManagementDataBase = asyncComponent(() =>
  import('@/pages/database/ManagementDataBase/ManagementDataBase'),
);
const DatabaseConnectConfig = asyncComponent(() =>
  import('@/pages/database/databaseConfig/DatabaseConfig'),
);
// 用户中心
const UserManage = asyncComponent(() => import('@/pages/userCenter/userManage/UserManage'));
const Workflow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workflowEdit/Workflow'));
const RoleManage = asyncComponent(() => import('@/pages/userCenter/roleManage/RoleManage'));
const SiteManage = asyncComponent(() => import('@/pages/userCenter/siteManage/SiteManage'));
// 数据中心
const Dictionary = asyncComponent(() => import('@/pages/dataCenter/dictionary'));
// 平台中心
const SchemeConfig = asyncComponent(() =>
  import('@/pages/platformCenter/gis/schemeConfig/SchemeConfig'),
);
const DimensionsConfig = asyncComponent(() =>
  import('@/pages/platformCenter/gis/dimensionsConfig/dimensionsConfig'),
);
const PanoramaConfig = asyncComponent(() =>
  import('@/pages/platformCenter/gis/panoramaConfig/index'),
);
const MessageManager = asyncComponent(() => import('@/pages/platformCenter/messageManage'));
const SchemeDetail = asyncComponent(() =>
  import('@/pages/platformCenter/messageManage/schemeDetail/schemeDetail'),
);
const HostManager = asyncComponent(() => import('@/pages/platformCenter/hostmanager'));
const VideoManager = asyncComponent(() => import('@/pages/platformCenter/videoManager'));
const BaseFrameContainer = asyncComponent(() =>
  import('@/pages/platformCenter/baseFrameContainer'),
);
const IntegratedLogin = asyncComponent(() =>
  import('@/pages/platformCenter/integratedLogin/integrate'),
);
// 业务中心
const TableManager = asyncComponent(() => import('@/pages/bsmanager/base/tablemanager'));
const FiledConfig = asyncComponent(() =>
  import('@/pages/bsmanager/base/tablemanager/filedConfig/filedConfig'),
);
const StandingBook = asyncComponent(() =>
  import('@/pages/bsmanager/base/standingBook/standingBook'),
);
const Incident = asyncComponent(() => import('@/pages/bsmanager/workOrder/incident/incident'));
const IncidentFlow = asyncComponent(() =>
  import('@/pages/bsmanager/workOrder/incident/incidentFlow'),
);
const IncidentView = asyncComponent(() =>
  import('@/pages/bsmanager/workOrder/incident/incidentView'),
);
const Flow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workFlow/flow'));
const FlowNode = asyncComponent(() =>
  import('@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'),
);
const Maintenance = asyncComponent(() =>
  import('@/pages/bsmanager/patrolMaintenance/maintenance/maintenance'),
);
const PatrolFeedback = asyncComponent(() =>
  import('@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback'),
);
// 应用中心
const ProductConfig = asyncComponent(() =>
  import('@/pages/productCenter/productConfig/productConfig'),
);
const WebConfigPage = asyncComponent(() => import('@/pages/productCenter/webConfig'));
const MobileConfigPage = asyncComponent(() => import('@/pages/productCenter/mobileConfig'));
// 系统日志
const ServiceLog = asyncComponent(() => import('@/pages/log/serviceLog'));
const LoginLog = asyncComponent(() => import('@/pages/log/loginLog'));
const OmsLog = asyncComponent(() => import('@/pages/log/omsLog'));
const superAuthority = [USER_MODE.SUPER];
const adminAuthority = [...superAuthority, USER_MODE.ADMIN];
const iconStyle = { verticalAlign: 'middle' };
export default {
  routes: [
    {
      path: '/user',
      component: UserLayout,
      hideMenu: true,
      routes: [
        {
          name: 'login',
          path: '/user/login',
          component: Login,
        },
      ],
    },
    {
      path: '/',
      component: BasicLayout,
      routes: [
        {
          path: '/solution',
          name: '解决方案',
          icon: <SolutionOutlined style={iconStyle} />,
          authority: superAuthority,
          component: CurrentSolution,
        },
        {
          path: '/dbm',
          name: '数据库',
          icon: <DatabaseOutlined style={iconStyle} />,
          component: BlankLayout,
          authority: superAuthority,
          routes: [
            {
              path: '/dbm/dbInitializa',
              name: '数据库初始化',
              authority: superAuthority,
              component: DatabaseInitialization,
            },
            {
              path: '/dbm/dbInit',
              name: '数据库连接',
              authority: superAuthority,
              component: InitDataBase,
            },
            {
              path: '/dbm/dbUpdate',
              name: '数据库升级',
              authority: superAuthority,
              component: ManagementDataBase,
            },
            {
              path: '/dbm/dbSource',
              name: '多数据源',
              authority: superAuthority,
              component: DatabaseConnectConfig,
            },
          ],
        },
        {
          path: '/authority',
          name: '组织架构',
          component: BlankLayout,
          icon: <UsergroupAddOutlined style={iconStyle} />,
          routes: [
            {
              path: '/authority/user',
              name: '机构管理',
              component: UserManage,
            },
            {
              path: '/authority/role',
              name: '角色管理',
              component: RoleManage,
            },
            {
              path: '/authority/station',
              name: '站点管理',
              component: SiteManage,
            },
          ],
        },
        {
          path: '/application',
          component: BlankLayout,
          name: '应用搭建',
          icon: <AppstoreOutlined style={iconStyle} />,
          routes: [
            {
              path: '/application/product',
              name: '产品授权',
              component: ProductConfig,
            },
            {
              path: '/application/web',
              name: 'Web搭建',
              component: WebConfigPage,
            },
            {
              path: '/application/mobile',
              name: 'Mobile搭建',
              component: MobileConfigPage,
            },
          ],
        },
        {
          path: '/biz',
          component: BlankLayout,
          name: '台账/工作流',
          icon: <CreditCardOutlined style={iconStyle} />,
          routes: [
            {
              path: '/biz/account',
              name: '台账',
              component: BlankLayout,
              routes: [
                {
                  path: '/biz/account/table',
                  name: '表/字段',
                  component: TableManager,
                },
                {
                  path: '/biz/account/fieldConfig',
                  name: '字段配置',
                  component: FiledConfig,
                  hideMenu: true,
                },
                {
                  path: '/biz/account/list',
                  name: '台账列表',
                  component: StandingBook,
                },
              ],
            },
            {
              path: '/biz/workflow',
              name: '工作流',
              component: BlankLayout,
              routes: [
                {
                  path: '/biz/workflow/event',
                  name: '事件',
                  component: Incident,
                },
                {
                  path: '/biz/workflow/eventFlow',
                  name: '事件受理流程',
                  hideMenu: true,
                  component: IncidentFlow,
                },
                {
                  path: '/biz/workflow/eventView',
                  name: '事件辅助视图',
                  hideMenu: true,
                  component: IncidentView,
                },
                {
                  path: '/biz/workflow/case',
                  name: '工单',
                  component: Flow,
                },
                {
                  path: '/biz/workflow/caseNode',
                  name: '流程节点',
                  hideMenu: true,
                  component: FlowNode,
                },
                {
                  path: '/biz/workflow/editor',
                  name: '工作流编辑',
                  component: Workflow,
                },
              ],
            },
            {
              path: '/biz/patrolMaintenance',
              name: '巡检维保',
              component: BlankLayout,
              routes: [
                {
                  path: '/biz/patrolMaintenance/patrolFeedback',
                  name: '巡检反馈',
                  component: PatrolFeedback,
                },
                {
                  path: '/biz/patrolMaintenance/maintenance',
                  name: '维保模板',
                  component: Maintenance,
                },
              ],
            },
          ],
        },
        {
          path: '/platform',
          component: BlankLayout,
          name: '平台管理',
          icon: <FundProjectionScreenOutlined style={iconStyle} />,
          routes: [
            {
              path: '/platform/gis',
              name: 'GIS平台',
              component: BlankLayout,
              routes: [
                {
                  path: '/platform/gis/map',
                  name: '地图配置',
                  component: SchemeConfig,
                },
                {
                  path: '/platform/gis/3Dmap',
                  name: '三维配置',
                  component: DimensionsConfig,
                },
                {
                  path: '/platform/gis/panoramaConfig',
                  name: '全景图配置',
                  component: PanoramaConfig,
                },
              ],
              // routes: [{
              //   path: '/platformCenter/schemeConfig',
              //   name: '方案配置',
              //   component: SchemeConfig,
              // }]
              // tabs: [
              //   {
              //     tabName: '范围配置',
              //     url:
              //       '/web4/?widget=product/Tool/EditBoundary/EditBoundary&serverCollextion=JiangNing_JNGW&solution=熊猫智慧水务平台',
              //   },
              //   {
              //     tabName: '方案配置',
              //     url:
              //       '/web4/?widget=product/Tool/MapSettings/MapSettings|hideMap=true',
              //   },
              //   {
              //     tabName: '七参数配置',
              //     type: 'sevenParams',
              //   },
              // ],
            },
            {
              path: '/platform/notification',
              name: '消息中心',
              component: MessageManager,
            },
            {
              path: '/platform/schemeDetail',
              name: '模板编辑',
              component: SchemeDetail,
              hideMenu: true,
            },
            {
              path: '/platform/video',
              name: '视频',
              component: VideoManager,
            },
            {
              path: '/platform/configuration',
              name: '组态',
              component: BaseFrameContainer,
              // tabs: [
              // {
              //   tabName: '模型类型',
              //   url:
              //     '/web4/?widget=configuration/ConfigurationsOperationV1/ModelTypeManage/ModelTypeManage|hideMap=true',
              // },
              // {
              //   tabName: '模型文件',
              //   url:
              //     '/web4/?widget=configuration/ConfigurationsOperationV1/ModelFileManage/ModelFileManage|hideMap=true',
              // },
              // {
              //   tabName: '画板管理',
              //   url:
              //     '/web4/?widget=configuration/ConfigurationsOperationV1/DrawBoardManage/DrawBoardManage|hideMap=true',
              // },
              // ],
            },
            {
              path: '/platform/host',
              name: '宿主管理',
              url: '/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true',
              component: HostManager,
            },
            {
              path: '/platform/integrate',
              name: '集成登录',
              component: IntegratedLogin,
            },
          ],
        },
        {
          path: '/data/dic',
          name: '数据字典',
          icon: <ReadOutlined style={iconStyle} />,
          component: Dictionary,
        },
        // {
        //   path: '/dataCenter',
        //   name: '数据中心',
        //   icon: <TableOutlined style={iconStyle} />,
        //   component: BlankLayout,
        //   routes: [
        //     {
        //       path: '/dataCenter/dictionary',
        //       name: '数据字典',
        //       component: Dictionary,
        //     },
        //   ],
        // },
        {
          path: '/system',
          component: BlankLayout,
          name: '系统日志',
          icon: <FileTextOutlined style={iconStyle} />,
          routes: [
            {
              path: '/system/apiService',
              name: '服务监控',
              component: ServiceLog,
            },
            {
              path: '/system/loginLog',
              name: '登录日志',
              component: LoginLog,
            },
            {
              path: '/system/omsLog',
              name: '运维痕迹',
              component: OmsLog,
            },
          ],
        },
      ],
    },
  ],
};
