import React from "react";
import ReactDOM from "react-dom/client";
import Login from "./pages/login/login.jsx";
import Home from "./pages/home/home.jsx";
import {BrowserRouter, Routes, Route, Navigate} from "react-router-dom";
import {Provider} from 'react-redux'
import '../src/assets/css/clear.css'
import store from './store/index.js'
import zhCN from 'antd/locale/zh_CN';
import {ConfigProvider} from 'antd';
import 'dayjs/locale/zh-cn';
import User from "@/pages/settingPageChild/user/user.jsx";
import Dict from "@/pages/settingPageChild/dict/dict.jsx";
import StatisticsData from "@/pages/homePageChild/statisticsData/statisticsData.jsx";
import ConsumptionProportion from "@/pages/homePageChild/consumptionProportion/consumptionProportion.jsx";
import FlowRanking from "@/pages/homePageChild/flowRanking/flowRanking.jsx";
import LineFlowRanking from "@/pages/homePageChild/lineFlowRanking/lineFlowRanking.jsx";
import PublicOpinion from "@/pages/homePageChild/publicOpinion/publicOpinion.jsx";
import StationEquipment from "@/pages/homePageChild/stationEquipment/stationEquipment.jsx";
import PassengerVolumeData from "@/pages/homePageChild/passengerVolumeData/passengerVolumeData.jsx";
import ClassCompletionRate from "@/pages/homePageChild/classCompletionRate/classCompletionRate.jsx";
import ClassPunctualitRate from "@/pages/homePageChild/classPunctualitRate/classPunctualitRate.jsx";
import CarCompletionRate from "@/pages/homePageChild/carCompletionRate/carCompletionRate.jsx";
import BasicInfomationOfTheLine from "@/pages/linePageChild/basicInfomationOfTheLine/basicInfomationOfTheLine.jsx";
import LineDispatch from "@/pages/linePageChild/lineDispatch/lineDispatch.jsx";


ReactDOM.createRoot(document.getElementById("root")).render(
    <Provider store={store}>

        <React.StrictMode>
            <ConfigProvider locale={zhCN}>
                <BrowserRouter>
                    <Routes>
                        <Route path="/login" element={<Login></Login>}></Route>
                        <Route path="/" element={<Home></Home>}>
                            {/*首页路由*/}
                            <Route path="user" element={<User></User>}></Route>
                            <Route path="dict" element={<Dict></Dict>}></Route>
                            <Route path="statisticsData" element={<StatisticsData></StatisticsData>}></Route>
                            <Route path="consumptionProportion"
                                   element={<ConsumptionProportion></ConsumptionProportion>}></Route>
                            <Route path="flowRanking" element={<FlowRanking></FlowRanking>}></Route>
                            <Route path="lineFlowRanking" element={<LineFlowRanking></LineFlowRanking>}></Route>
                            <Route path="publicOpinion" element={<PublicOpinion></PublicOpinion>}></Route>
                            <Route path="stationEquipment" element={<StationEquipment></StationEquipment>}></Route>
                            <Route path="passengerVolumeData"
                                   element={<PassengerVolumeData></PassengerVolumeData>}></Route>
                            <Route path="classCompletionRate"
                                   element={<ClassCompletionRate></ClassCompletionRate>}></Route>
                            <Route path="classPunctualitRate"
                                   element={<ClassPunctualitRate></ClassPunctualitRate>}></Route>
                            <Route path="carCompletionRate" element={<CarCompletionRate></CarCompletionRate>}></Route>
                            {/*    线路运营路由*/}
                            <Route path="basicInfomationOfTheLine" element={<BasicInfomationOfTheLine></BasicInfomationOfTheLine>}></Route>
                            <Route path="lineDispatch" element={<LineDispatch></LineDispatch>}></Route>
                        </Route>
                        {/**这里重定向到home页面 */}
                        <Route path="*" element={<Navigate to="/statisticsData" replace/>}></Route>
                    </Routes>
                </BrowserRouter>
            </ConfigProvider>
        </React.StrictMode>
    </Provider>
);
