/* eslint-disable import/no-unresolved */
import React from 'react';
import {
  DatabaseOutlined,
  UsergroupAddOutlined,
  SolutionOutlined,
  TableOutlined,
  CreditCardOutlined,
  FileTextOutlined,
  AppstoreOutlined,
  FundProjectionScreenOutlined,
} from '@ant-design/icons';
// 菜单
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 ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase';
import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig';
// 用户中心
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 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/maintenance/maintenance';

// 应用中心
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 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: adminAuthority,
          routes: [
            {
              path: '/dbm/dbInit',
              name: '数据库连接',
              authority: adminAuthority,
              component: InitDataBase,
            },
            {
              path: '/dbm/dbsm',
              name: '数据库标准化管理',
              authority: adminAuthority,
              component: ManagementDataBase,
            },
            {
              path: '/dbm/connectConfig',
              name: '数据库连接配置',
              authority: adminAuthority,
              component: DatabaseConnectConfig,
            },
          ],
        },
        {
          path: '/userCenter',
          name: '用户中心',
          component: BlankLayout,
          icon: <UsergroupAddOutlined style={iconStyle} />,
          routes: [
            {
              path: '/userCenter/UserManage',
              name: '用户管理',
              component: UserManage,
            },
            {
              path: '/userCenter/RoleManage',
              name: '角色管理',
              component: RoleManage,
            },
            {
              path: '/userCenter/SiteManage',
              name: '站点管理',
              component: SiteManage,
            },
          ],
        },
        {
          path: '/platformCenter',
          component: BlankLayout,
          name: '平台中心',
          icon: <FundProjectionScreenOutlined style={iconStyle} />,
          routes: [
            {
              path: '/platformCenter/gis',
              name: 'GIS平台',
              component: BlankLayout,
              routes: [
                {
                  path: '/platformCenter/gis/twoDimensionConfig',
                  name: '地图配置',
                  component: SchemeConfig,
                },
                {
                  path: '/platformCenter/gis/threeDimensionConfig',
                  name: '三维配置',
                  component: DimensionsConfig,
                },
              ],
              // 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: '/platformCenter/notify',
              name: '消息平台',
              component: MessageManager,
            },
            {
              path: '/platformCenter/SchemeDetail',
              name: '模板编辑',
              component: SchemeDetail,
              hideMenu: true,
            },
            {
              path: '/platformCenter/emq',
              name: '宿主管理',
              url: '/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true',
              component: HostManager,
            },

            {
              path: '/platformCenter/video',
              name: '视频平台',
              component: VideoManager,
            },
            {
              path: '/platformCenter/iot',
              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: '/bsmanger',
          component: BlankLayout,
          name: '业务中心',
          icon: <CreditCardOutlined style={iconStyle} />,
          routes: [
            {
              path: '/bsmanger/base',
              name: '基础配置',
              component: BlankLayout,
              routes: [
                {
                  path: '/bsmanger/base/tablemanger',
                  name: '表/字段',
                  component: TableManager,
                },
                {
                  path: '/bsmanger/base/filedConfig/:id',
                  name: '字段配置',
                  component: FiledConfig,
                  hideMenu: true,
                },
                {
                  path: '/bsmanger/base/standingBook',
                  name: '台账管理',
                  component: StandingBook,
                },
              ],
            },
            {
              path: '/bsmanger/workOrder',
              name: '工单管理',
              component: BlankLayout,
              routes: [
                {
                  path: '/bsmanger/workOrder/incident',
                  name: '事件',
                  component: Incident,
                },
                {
                  path: '/bsmanger/workOrder/incidentFlow',
                  name: '事件受理流程',
                  hideMenu: true,
                  component: IncidentFlow,
                },
                {
                  path: '/bsmanger/workOrder/incidentView',
                  name: '事件辅助视图',
                  hideMenu: true,
                  component: IncidentView,
                },
                {
                  path: '/bsmanger/workOrder/flow',
                  name: '流程',
                  component: Flow,
                },
                {
                  path: '/bsmanger/workOrder/flowNode',
                  name: '流程节点',
                  hideMenu: true,
                  component: FlowNode,
                },
                {
                  path: '/bsmanger/workOrder/Workflow',
                  name: '工作流编辑',
                  component: Workflow,
                },
              ],
            },
            {
              path: '/bsmanger/maintenance',
              name: '巡维保',
              component: Maintenance,
            },
          ],
        },
        {
          path: '/productCenter',
          component: BlankLayout,
          name: '应用中心',
          icon: <AppstoreOutlined style={iconStyle} />,
          routes: [
            {
              path: '/productCenter/product',
              name: '产品配置',
              component: ProductConfig,
            },
            {
              path: '/productCenter/web',
              name: 'Web配置',
              component: WebConfigPage,
            },
            {
              path: '/productCenter/app',
              name: '移动应用配置',
              component: MobileConfigPage,
            },
          ],
        },
        {
          path: '/dataCenter',
          name: '数据中心',
          icon: <TableOutlined style={iconStyle} />,
          component: BlankLayout,
          routes: [
            {
              path: '/dataCenter/dictionary',
              name: '数据字典',
              component: Dictionary,
            },
          ],
        },
        {
          path: '/log',
          component: BlankLayout,
          name: '系统日志',
          icon: <FileTextOutlined style={iconStyle} />,
          routes: [
            {
              path: '/log/service',
              name: '服务监控',
              component: ServiceLog,
            },
            {
              path: '/log/login',
              name: '登录日志',
              component: LoginLog,
            },
            {
              path: '/log/omsLog',
              name: '运维痕迹',
              component: OmsLog,
            },
          ],
        },
      ],
    },
  ],
};
