/*
 * @Author: your name
 * @Date: 2022-01-07 10:04:20
 * @LastEditTime: 2025-04-08 11:45:42
 * @LastEditors: code4eat awesomedema@gmail.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /KC-MiddlePlatform/config/config.ts
 */

import { defineConfig } from 'umi';

import proxy from './proxy';


const { REACT_APP_ENV } = process.env;

export default defineConfig({
  hash: true,
  nodeModulesTransform: {
    type: 'none',
  },
  title: false,
  publicPath: '/',
  dva: {
    immer: true,
    hmr: true,
  },
  extraBabelIncludes: ['/@superset-ui/embedded-sdk/'],
  antd: {
    config: {
      prefixCls: 'kcmp-ant',
      // getPopupContainer:(triggerNode:HTMLElement)=>triggerNode
    },
  },
  lessLoader: {
    modifyVars: { '@ant-prefix': 'kcmp-ant', 'root-entry-name': 'default' },
  },

  theme: {
    '@primary-color': '#3376FE',
    '@primary-color-hover': '#3376FE',
    // '@root-entry-name':'root-entry-name'
  },
  routes: [
    {
      path: '/',
      component: '@/layouts/index.tsx',
      routes: [
        {
          path: '/app1',
          microApp: 'app1',
          // access: 'canVisitThisApp'
          microAppProps: {
            autoSetLoading: true,
            autoCaptureError: true,
          },
        },
        // {
        //   path: '/costMana',
        //   microApp: 'costMana',
        // },
        {
          path: '/PFMBackC',
          microApp: 'PFMBackC',
          microAppProps: {
            autoSetLoading: true,
            autoCaptureError: true,
          },
        },
        {
          path: '/reviewMana',
          microApp: 'reviewMana',
          microAppProps: {
            autoSetLoading: true,
            autoCaptureError: true,
          },
        },
        {
          path: '/budgetManaSystem',
          microApp: 'budgetManaSystem',
          microAppProps: {
            // autoSetLoading: true,
            autoCaptureError: true,
          },
        },
        {
          path: '/pfmBackMana',
          microApp: 'pfmBackMana',
          microAppProps: {
            autoSetLoading: true,
            autoCaptureError: true,
          },
        },
        {
          path: '/CostAccountingSys',
          microApp: 'CostAccountingSys',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/MediResourceManaSys',
          microApp: 'MediResourceManaSys',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/MedicalWisdomCheckSys',
          microApp: 'MedicalWisdomCheckSys',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/devServer',
          microApp: 'devServer',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/personnelManaSystem',
          microApp: 'personnelManaSystem',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/nursingWorkersManaSystem',
          microApp: 'nursingWorkersManaSystem',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/nurseManageSystem',
          microApp: 'nurseManageSystem',
          microAppProps: {
            autoCaptureError: true,
            //loader: (loading:boolean) => <div>loading</div>,
          },
        },
        {
          path: '/channelIndex/channelIndexOne',
          component: '@/pages/channelIndex/channelIndexOne/index.tsx',
        },
        {
          path: '/index',
          title: '欢迎进入医管平台',
          component: '@/pages/index/index.tsx',
        },
        {
          path: '/noAccess',
          component: './noAccess',
        },
        {
          path: '/platform',
          component: '@/pages/platform/_layout.tsx',
          routes: [
            {
              path: '/platform/sqlEditer',
              component: '@/pages/platform/sqlediter/index.tsx',
            },
            {
              path: '/platform/home',
              component: '@/pages/platform/home/index.tsx',
            },
            {
              path: '/platform/setting',
              routes: [
                {
                  path: '/platform/setting/embeddedDashboard/:dashboardId',
                  component: '@/pages/platform/setting/embeddedDashboard/index.tsx',
                },
                {
                  path: '/platform/setting/userManage',
                  component: '@/pages/platform/setting/userManage/index.tsx',
                },
                {
                  path: '/platform/setting/hospManage',
                  component: '@/pages/platform/setting/hospManage/index.tsx',
                },
                {
                  path: '/platform/setting/menuManage',
                  component: '@/pages/platform/setting/menuManage/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/roleManage',
                  component: '@/pages/platform/setting/roleManage/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                // {
                //   path: '/platform/setting/reports',
                //   component: '@/pages/platform/setting/reports/index.tsx',
                // },
                {
                  path: '/platform/setting/departmentMana',
                  component: '@/pages/platform/setting/departmentMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/pubDicTypeMana',
                  component: '@/pages/platform/setting/pubDicTypeMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/hospParamsMana',
                  component: '@/pages/platform/setting/hospParamsMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/pubDicMana/:type',
                  component: '@/pages/platform/setting/pubDicMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/indicatorMana',
                  component: '@/pages/platform/setting/indicatorMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/indicatoLagacy',
                  component: '@/pages/platform/setting/indicatoLagacy/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/paramsMana',
                  component: '@/pages/platform/setting/paramsMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/systemNavMana',
                  component: '@/pages/platform/setting/systemNavMana/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/notificationTemplate',
                  component: '@/pages/platform/setting/notificationTemplate/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/kcClassification',
                  component: '@/pages/platform/setting/kcClassification/index.tsx',
                  wrappers: ['@/wrappers/auth'],
                },
                {
                  path: '/platform/setting/dataFilling',
                  name: '数据填报',
                  routes: [
                    {
                      name: '填报管理',
                      path: '/platform/setting/dataFilling/fillingMana',
                      component: '@/pages/platform/setting/dataFilling/fillingMana/index',
                    },
                    {
                      name: '我的填报',
                      path: '/platform/setting/dataFilling/mineFilling',
                      component: '@/pages/platform/setting/dataFilling/mineFilling/index',
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          path: '/personalCenter',
          component: '@/pages/personalCenter/index.tsx',
          // wrappers: [
          //   '@/wrappers/auth',
          // ],
        },
        { path: '/login', layout: false, component: '@/pages/login/index' },
      ],
    },
  ],

  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
  fastRefresh: {},
  layout: {
    layout: 'top',
  },
  // mfsu: {},
  qiankun: {
    master: {
      sandbox: {
        // strictStyleIsolation:true,
        // experimentalStyleIsolation: true, // 试验性
        //  experimentalSandbox: 'proxy'
      },
    },
  },
});
