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

const publicPath = process.env.NODE_ENV == 'development' ? '/' : '/gt-dig/';

export default defineConfig({
  hash: true,
  antd: {},
  access: {},
  model: {},
  initialState: {},
  request: {},
  dva: {},
  layout: false,
  // publicPath: process.env.NODE_ENV == 'development' ? '/' : '/gt-dig/',
  publicPath: '/',
  metas: [
    // 配置html禁止缓存
    { 'http-equiv': 'pragma', content: 'no-cache' },
    { 'http-equiv': 'cache-control', content: 'no-cache' },
    { 'http-equiv': 'expires', content: '0' },
    { 'http-equiv': 'X-UA-Compatible', content: 'IE=EmulateIE9' },
    { name: 'transparent', content: 'true' },
    {
      name: 'viewport',
      content:
        'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
    },
  ],
  headScripts: [`${publicPath}rem.js`],
  proxy: {
    '/api': {
      // target: 'http://47.96.12.136:8888/',
      target: 'http://47.96.12.136:8788/',
      // target: 'http://120.55.44.4:8903/',
      // target: 'https://work.greentech.com.cn/',
      changeOrigin: true,
    },
  },
  routes: [
    {
      path: '/',
      redirect: '/home/92',
    },
    {
      name: '首页',
      path: '/home/:projectId',
      component: './Home',
    },
    {
      name: '项目选择',
      path: '/projects/:projectId',
      component: './Projects',
    },
    {
      name: '菜单栏',
      path: '/menu/:projectId',
      component: './Menu',
    },
    {
      name: '水量监测',
      path: '/home/water-amt-mng/:projectId',
      component: './Home/WaterAmtMng',
    },
    {
      name: '水质监测',
      path: '/home/water-quality-mng/:projectId',
      component: './Home/QualityMng',
    },
    {
      name: '能耗监测',
      path: '/home/energy/:projectId',
      component: './Home/EnergyCostComparison',
    },
    {
      name: '药耗监测',
      path: '/home/chem-cost/:projectId',
      component: './Home/ChemCostComparison',
    },
    {
      name: '工况管理',
      path: '/smart/work/:projectId',
      component: './Smart',
    },
    {
      name: '工况评估',
      path: '/smart/condition-detection/:projectId',
      component: './Smart/ConditionDetection',
    },
    {
      name: '优化任务',
      path: '/smart/optimization-tasks/:projectId',
      component: './Smart/OptimizationTasks',
    },
    {
      name: '模拟仿真',
      path: '/smart/simulate/:projectId',
      component: './Smart/Simulate',
    },
    {
      name: '智能管控',
      path: '/controller/:projectId',
      component: './Controller',
    },
    {
      name: '感知监控',
      path: '/controller/hardware/:projectId',
      component: './Controller/Hardware',
    },
    {
      name: '设备定位',
      path: '/controller/device/:projectId',
      component: './Controller/Device',
    },
    // {
    //   name: '空调监控',
    //   path: '/hardware-controller/air-conditioner/:projectId',
    //   component: './Controller/AirConditioner',
    // },
    // {
    //   name: '灯光监控',
    //   path: '/hardware-controller/light/:projectId',
    //   component: './Controller/Light',
    // },
    {
      name: '系统自检',
      path: '/self-inspection/:projectId',
      component: './EqSelfInspection',
    },
    {
      name: '自检列表',
      path: '/self-inspection/list/:projectId',
      component: './EqSelfInspection/List',
    },
    {
      name: '自检报告',
      path: '/self-inspection/detail/:projectId/:routeId',
      component: './EqSelfInspection/ReportDetail',
    },
    {
      name: '自检统计',
      path: '/self-inspection/statistics/:projectId',
      component: './EqSelfInspection/Statistics',
    },
    {
      name: '任务管理 - 工单管理',
      path: '/task-manage/:projectID',
      component: './TaskManage',
    },
    {
      name: '任务列表',
      path: '/task-manage/list',
      component: './TaskManage/Detail/TaskList/TaskList',
    },
    {
      name: '任务详情',
      path: '/task-manage/list/detail',
      component: './TaskManage/Detail/TaskDetail/TaskDetail',
    },
    {
      name: '工单列表',
      path: '/task-manage/work-order/list',
      component: './TaskManage/Detail/WorkOrderList/WorkOrderList',
    },
    {
      name: '任务关联工单详情',
      path: '/task-manage/list/order-detail',
      component: './TaskManage/Detail/TaskOrder/TaskOrder',
    },
    {
      name: '任务弹窗',
      path: '/task-manage/pop/:projectID',
      component: './TaskManage/Popup',
    },
    {
      name: '工单详情弹窗',
      path: '/task-manage/pop/work-order/:projectID',
      component: './TaskManage/Popup/WorkOrderModal',
    },
    {
      name: '消息中心',
      path: '/message/:projectId',
      component: './MessageCenter',
    },
    {
      name: '设备管理',
      path: '/device/:projectId',
      component: './DeviceManager',
    },
    {
      name: '出入库管理详情',
      path: '/device/detail/:projectId/:type',
      component: './DeviceManager/detail',
    },
    {
      name: '备品管理总览',
      path: '/device/storage/:projectId',
      component: './DeviceManager/storage',
    },
    {
      name: '安全管理',
      path: '/safety/:projectId', ///safety management
      component: './SafetyManagement',
    },
    // 视频图片预览
    {
      path: '/alarm/preview',
      name: '',
      component: './Alarm/Preview',
    },
    {
      name: '门禁日志',
      path: '/safety/detail/:projectId', ///safety management
      component: './SafetyManagement/doorDetail',
    },
    // 智慧运营
    {
      name: '',
      path: '/smart-ops/:projectId', ///safety management
      component: './SmartOps/index',
    },
    // 工况分析详情
    {
      name: '',
      path: '/smart-ops/work-analysis-detail/:projectId', ///safety management
      component: './SmartOps/WorkAnalysisDetail',
    },
    // 历史记录
    {
      name: '',
      path: '/smart-ops/history-record/:projectId', ///safety management
      component: './SmartOps/HistoryRecord',
    },
    // 操作记录
    {
      name: '',
      path: '/smart-ops/operation-record/:projectId',
      component: './SmartOps/OperationRecord',
    },
    // 图标弹窗页面
    {
      name: '',
      path: '/smart-ops/chart-page/:projectId',
      component: './SmartOps/ChartPage',
    },
    // 系统工作日报
    {
      name: '',
      path: '/system-daily/:projectId',
      component: './SystemDaily/index',
    },
    //个人中心
    {
      name: '个人中心',
      path: '/center/:projectId',
      component: './Center/index',
    },
    {
      name: '我的任务',
      path: '/center/my-task/:projectId',
      component: './Center/MyTask',
    },
    {
      name: '我的任务列表',
      path: '/center/my-task/task-list',
      component: './Center/MyTask/List/TaskList',
    },
    {
      name: '我的工单列表',
      path: '/center/my-task/work-order-list',
      component: './Center/MyTask/List/WorkOrderList',
    },
    {
      name: '我的任务详情',
      path: '/center/my-task/task-detail',
      component: './Center/MyTask/Detail/TaskDetail',
    },
    {
      name: '我的工单详情',
      path: '/center/my-task/work-order-detail',
      component: './Center/MyTask/Detail/WorkOrderDetail',
    },
    //智慧运营报告
    {
      name: '',
      path: '/smart-report/:projectId',
      component: './SmartReport/index',
    },
  ],
  npmClient: 'yarn',
});
