/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-08-02 11:28:57
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2025-02-28 10:35:48
 * @FilePath: /MediResourceManaSys/.umirc.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { defineConfig } from '@umijs/max';

import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';


const { REACT_APP_ENV } = process.env;
const path = require('path');



export default defineConfig({
  hash:true,
  antd: {
    configProvider: {
      prefixCls: 'mrms-ant',
    },
  },
  locale: {
    default: 'zh-CN',
    antd: true,
    title: false,
    baseNavigator: true,
    baseSeparator: '-',
  },
  // alias:{
  //   'ace-builds': path.resolve(__dirname, './node_modules/ace-builds/src-noconflict'),
  // },
  qiankun: {
    slave: {},
  },
  mfsu: false,
  lessLoader: {
    modifyVars: {
      '@ant-prefix': 'mrms-ant',
      '@primary-color': '#3377FF',
      '@border-color-base': '#dae2f2'
    },
    javascriptEnabled: true,
  }, //对应修改生成的 antd 样式类名

  chainWebpack(config, { webpack }) {
    config.plugin('monaco-editor').use(MonacoWebpackPlugin, [
        {
            // 指定需要加载的语言和特性
            languages: ['sql', 'javascript', 'typescript']
        }
    ]);
  },

  access: {},
  model: {},

  initialState: {},
  request: {},
  layout: {
    title: '医资管理系统',
    layout: 'side',
    menuProps: {
      theme: 'light',
    }
  },
  manifest: {
    basePath: '/',
  },
  publicPath: REACT_APP_ENV == 'dev' ? '/' : '/medical/',
  proxy: {
    '/gateway': {
      target: 'http://120.27.235.181:5000/gateway',//开发
      //target:'http://47.96.149.190:5000/gateway', //演示
      changeOrigin: true,
      // pathRewrite: { '^/gateway': '' },

    }
  },
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/noAccess',
      component: './noAccess',
    },
    {
      path: '/home',
      component: './Home/index',
    },
    {
      path:'/personalCenter',
      name:'个人中心',
      routes:[
        {
          name:'我的资质',
          path: '/personalCenter/myQualifications',
          component: './personalCenter/myQualifications/index',
        },
        {
          name:'我的申请',
          path: '/personalCenter/myApplication',
          component: './personalCenter/myApplication/index',
        },
      ]
    },
    {
      path:'/qualificationMana',
      name:'资质管理',
      routes:[
        {
          name:'资质授权',
          path: '/qualificationMana/qualificationAuth',
          component: './qualificationMana/qualificationAuth/index',
        },
        {
          name:'授权期限管理',
          path: '/qualificationMana/qualificationExperiedMana',
          component: './qualificationMana/qualificationExperiedMana/index',
        },
        {
          name:'资质批量授权',
          path: '/qualificationMana/qualificationBatchAuth',
          component: './qualificationMana/qualificationBatchAuth/index',
        },
        {
          name:'医生资质授权',
          path: '/qualificationMana/doctorQualifiAuth',
          component: './qualificationMana/doctorQualifiAuth/index',
        },
        {
          name:'资质分类管理',
          path: '/qualificationMana/qualificationClassfiMana',
          component: './qualificationMana/qualificationClassfiMana/index',
        },
        {
          name:'资质字典管理',
          path: '/qualificationMana/qualifiDicMana',
          component: './qualificationMana/qualifiDicMana/index',
        },
        {
          name:'资质审批',
          path: '/qualificationMana/qualificationApproval/:type',
          component: './qualificationMana/qualificationApproval/index',
        },
      ]
    },
    {
      path:'/certificateMana',
      name:'证书管理',
      routes:[
        {
          name:'证书管理',
          path: '/certificateMana',
          component: './certificateMana/index',
        },
      ]
    },
    {
      path:'/indicator',
      name:'指标一览',
      routes:[
      {}
      ]
    },
    {
      path:'/dataFilling',
      name:'数据填报',
      routes:[
        {}
      ]
    },
    { path: '*', component: '@/pages/404' },
    
 

   

  ],
  npmClient: 'yarn',
});

