index.jsx 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React from "react";
  2. import ReactDOM from "react-dom/client";
  3. import Login from "./pages/login/login.jsx";
  4. import Home from "./pages/home/home.jsx";
  5. import {BrowserRouter, Routes, Route, Navigate} from "react-router-dom";
  6. import {Provider} from 'react-redux'
  7. import '../src/assets/css/clear.css'
  8. import store from './store/index.js'
  9. import zhCN from 'antd/locale/zh_CN';
  10. import {ConfigProvider} from 'antd';
  11. import 'dayjs/locale/zh-cn';
  12. import User from "@/pages/settingPageChild/user/user.jsx";
  13. import Dict from "@/pages/settingPageChild/dict/dict.jsx";
  14. import StatisticsData from "@/pages/homePageChild/statisticsData/statisticsData.jsx";
  15. import ConsumptionProportion from "@/pages/homePageChild/consumptionProportion/consumptionProportion.jsx";
  16. import FlowRanking from "@/pages/homePageChild/flowRanking/flowRanking.jsx";
  17. import LineFlowRanking from "@/pages/homePageChild/lineFlowRanking/lineFlowRanking.jsx";
  18. import PublicOpinion from "@/pages/homePageChild/publicOpinion/publicOpinion.jsx";
  19. import StationEquipment from "@/pages/homePageChild/stationEquipment/stationEquipment.jsx";
  20. import PassengerVolumeData from "@/pages/homePageChild/passengerVolumeData/passengerVolumeData.jsx";
  21. import ClassCompletionRate from "@/pages/homePageChild/classCompletionRate/classCompletionRate.jsx";
  22. import ClassPunctualitRate from "@/pages/homePageChild/classPunctualitRate/classPunctualitRate.jsx";
  23. import CarCompletionRate from "@/pages/homePageChild/carCompletionRate/carCompletionRate.jsx";
  24. import BasicInfomationOfTheLine from "@/pages/linePageChild/basicInfomationOfTheLine/basicInfomationOfTheLine.jsx";
  25. import LineDispatch from "@/pages/linePageChild/lineDispatch/lineDispatch.jsx";
  26. ReactDOM.createRoot(document.getElementById("root")).render(
  27. <Provider store={store}>
  28. <React.StrictMode>
  29. <ConfigProvider locale={zhCN}>
  30. <BrowserRouter>
  31. <Routes>
  32. <Route path="/login" element={<Login></Login>}></Route>
  33. <Route path="/" element={<Home></Home>}>
  34. {/*首页路由*/}
  35. <Route path="user" element={<User></User>}></Route>
  36. <Route path="dict" element={<Dict></Dict>}></Route>
  37. <Route path="statisticsData" element={<StatisticsData></StatisticsData>}></Route>
  38. <Route path="consumptionProportion"
  39. element={<ConsumptionProportion></ConsumptionProportion>}></Route>
  40. <Route path="flowRanking" element={<FlowRanking></FlowRanking>}></Route>
  41. <Route path="lineFlowRanking" element={<LineFlowRanking></LineFlowRanking>}></Route>
  42. <Route path="publicOpinion" element={<PublicOpinion></PublicOpinion>}></Route>
  43. <Route path="stationEquipment" element={<StationEquipment></StationEquipment>}></Route>
  44. <Route path="passengerVolumeData"
  45. element={<PassengerVolumeData></PassengerVolumeData>}></Route>
  46. <Route path="classCompletionRate"
  47. element={<ClassCompletionRate></ClassCompletionRate>}></Route>
  48. <Route path="classPunctualitRate"
  49. element={<ClassPunctualitRate></ClassPunctualitRate>}></Route>
  50. <Route path="carCompletionRate" element={<CarCompletionRate></CarCompletionRate>}></Route>
  51. {/* 线路运营路由*/}
  52. <Route path="basicInfomationOfTheLine" element={<BasicInfomationOfTheLine></BasicInfomationOfTheLine>}></Route>
  53. <Route path="lineDispatch" element={<LineDispatch></LineDispatch>}></Route>
  54. </Route>
  55. {/**这里重定向到home页面 */}
  56. <Route path="*" element={<Navigate to="/statisticsData" replace/>}></Route>
  57. </Routes>
  58. </BrowserRouter>
  59. </ConfigProvider>
  60. </React.StrictMode>
  61. </Provider>
  62. );