import React from 'react';
import {
  DatabaseOutlined,
  UsergroupAddOutlined,
  SettingOutlined,
  HomeOutlined,
  SolutionOutlined,
  //   AndroidOutlined,
  //   CommentOutlined,
  TableOutlined,
  CopyOutlined,
} from '@ant-design/icons';
import UserLayout from '../layouts/UserLayout';
import Login from '../pages/user/login';
import BasicLayout from '../layouts/BasicLayout';
import BlankLayout from '../layouts/BlankLayout';
import RequestTest from '../pages/testPages/request';
import InitDataBase from '../pages/database/InitDataBase';
import ManagementDataBase from '../pages/database/ManagementDataBase';
import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig';
import CurrentSolution from '@/pages/currentSolution/CurrentSolution';
import UserManage from '../pages/userCenter/userManage/UserManage';
import RoleManage from '@/pages/userCenter/roleManage/RoleManage';
import SiteManage from '../pages/userCenter/siteManage/SiteManage';
import SiteManageV2 from '../pages/userCenter/siteManageV2/SiteManage';
import Dictionary from '../pages/dataCenter/dictionary';
import Dictionary1 from '../pages/dataCenter/dictionary1';
// import Search from '../pages/dataCenter/search';
import ServiceLog from '../pages/log/serviceLog';
import LoginLog from '../pages/log/loginLog';
import OmsLog from '../pages/log/omsLog';
// import DefaultComponent from '../pages/orgnazation/DefaultComponent';
import TestTable from '../pages/orgnazation/TestTable';
import WebConfigPage from '@/pages/webConfig';
// import AppConfigPage from '@/pages/appConfig';
import MobileConfigPage from '@/pages/mobileConfig';
import ProductConfig from '@/pages/webConfig/productConfig';
import { USER_MODE } from '@/utils/constants';
import BaseFrameContainer from '@/components/BaseFrameContainer';
import JumpContainer from '@/components/JumpContainer';
import HostManager from '@/pages/platformCenter/hostmanager';
import MessageManager from '@/pages/platformCenter/messageManage';
import VideoManager from '@/pages/platformCenter/videoManager';
import SchemeDetail from '@/pages/platformCenter/schemeDetail/schemeDetail';
import SchemeConfig from '@/pages/platformCenter/schemeConfig/SchemeConfig';
import DimensionsConfig from '@/pages/platformCenter/dimensionsConfig/dimensionsConfig';

import TaskScheduling from '@/pages/artificial/taskScheduling/taskScheduling';
import PoliciesIssued from '@/pages/artificial/policiesIssued/policiesIssued';
import AuthControl from '@/pages/authcontrol';
import TableManager from '@/pages/platformCenter/bsmanager/tablemanager';
import StandingBook from '@/pages/platformCenter/standingBook/standingBook';
import FiledConfig from '@/pages/platformCenter/filedConfig/filedConfig';
import Incident from '@/pages/platformCenter/bsmanager/workOrder/incident';
import IncidentFlow from '@/pages/platformCenter/bsmanager/workOrder/incidentFlow';
import IncidentView from '@/pages/platformCenter/bsmanager/workOrder/incidentView';
import Maintenance from '@/pages/platformCenter/bsmanager/maintenance/maintenance';
import Flow from '@/pages/platformCenter/bsmanager/workFlow/flow';
import FlowNode from '@/pages/platformCenter/bsmanager/workFlow/flowNode/flowNode';
import Workflow from '@/pages/platformCenter/bsmanager/workflowEdit/Workflow';
// import ColConen from '@/components/Colophon/colContent';

const iconStyle = { verticalAlign: '0.125em' };

const superAuthority = [USER_MODE.SUPER];
const adminAuthority = [...superAuthority, USER_MODE.ADMIN];
// const commonAuthority = [...adminAuthority, USER_MODE.COMMON];

export default {
  routes: [
    {
      path: '/user',
      component: UserLayout,
      hideMenu: true,
      routes: [
        {
          name: 'login',
          path: '/user/login',
          component: Login,
        },
      ],
    },
    {
      path: '/test/request',
      hideMenu: true,
      component: RequestTest,
    },
    {
      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: '/dbm/authcontrol',
            //   name: '数据鉴权',
            //   authority: superAuthority,
            //   component: AuthControl,
            // },
          ],
        },

        {
          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: SiteManageV2,
            },
          ],
        },
        {
          path: '/userCenter/testTable',
          name: '测试表格',
          hideMenu: true,
          component: TestTable,
        },
        {
          path: '/platformCenter',
          component: BlankLayout,
          name: '平台中心',
          icon: <SettingOutlined 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/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: '/platformCenter/order',
            //   name: '业务平台',
            //   component: JumpContainer,
            // },
            // {
            //   path: '/platformCenter/artificial',
            //   component: BlankLayout,
            //   name: '智能平台',
            //   icon: <CopyOutlined style={iconStyle} />,
            //   routes: [
            //     {
            //       path: '/platformCenter/artificial/policiesIssued',
            //       name: '方案管理',
            //       component: PoliciesIssued,
            //     },
            //     {
            //       path: '/platformCenter/artificial/taskScheduling',
            //       name: '任务调度',
            //       component: TaskScheduling,
            //     },
            //   ],
            // },
            {
              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/bsmanger',
              component: BlankLayout,
              name: '业务平台',
              icon: <CopyOutlined style={iconStyle} />,
              routes: [
                {
                  path: '/platformCenter/bsmanger/tablemanger',
                  name: '表/字段',
                  component: TableManager,
                },
                {
                  path: '/platformCenter/bsmanger/filedConfig/:id',
                  name: '字段配置',
                  component: FiledConfig,
                  hideMenu: true,
                },
                {
                  path: '/platformCenter/bsmanger/standingBook',
                  name: '台账管理',
                  component: StandingBook,
                },
                {
                  path: '/platformCenter/bsmanger/incident',
                  name: '事件',
                  component: Incident,
                },
                {
                  path: '/platformCenter/bsmanger/incidentFlow',
                  name: '事件受理流程',
                  hideMenu: true,
                  component: IncidentFlow,
                },
                {
                  path: '/platformCenter/bsmanger/incidentView',
                  name: '事件辅助视图',
                  hideMenu: true,
                  component: IncidentView,
                },
                {
                  path: '/platformCenter/bsmanger/flow',
                  name: '流程',
                  component: Flow,
                },
                {
                  path: '/platformCenter/bsmanger/flowNode',
                  name: '流程节点',
                  hideMenu: true,
                  component: FlowNode,
                },
                {
                  path: '/platformCenter/bsmanger/Workflow',
                  name: '工作流编辑',
                  component: Workflow,
                },
                {
                  path: '/platformCenter/bsmanger/maintenance',
                  name: '巡维保',
                  component: Maintenance,
                },
                // {
                //   path: '/platformCenter/bsmanger/standbookmanager',
                //   name: '台账配置',
                //   component: TableManager,
                // }
              ],
            },
            {
              path: '/platformCenter/video',
              name: '视频平台',
              component: VideoManager,
            },
          ],
        },
        {
          path: '/productCenter',
          component: BlankLayout,
          name: '应用中心',
          icon: <HomeOutlined 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: '数据字典1',
              hideMenu: true,
              component: Dictionary,
            },
            {
              path: '/dataCenter/dictionary1',
              name: '数据字典',
              component: Dictionary1,
            },
            // {
            //   path: '/dataCenter/search',
            //   name: '数据字典',
            //   component: Search,
            // },
            // {
            //   path: '/dataCenter/video',
            //   name: '视频管理',
            //   url:
            //     '/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云',
            //   component: BaseFrameContainer,
            // },
          ],
        },
        {
          path: '/log',
          component: BlankLayout,
          name: '系统日志',
          icon: <CopyOutlined style={iconStyle} />,
          routes: [
            {
              path: '/log/service',
              name: '服务监控',
              component: ServiceLog,
            },
            {
              path: '/log/login',
              name: '登录日志',
              component: LoginLog,
            },
            {
              path: '/log/omsLog',
              name: '运维痕迹',
              component: OmsLog,
            },
          ],
        },
      ],
    },
  ],
};
