import React, { Fragment } from "react";
import { Router, Route, Switch } from "dva/router";
import IndexPage from "./routes/IndexPage";
import Sewage from "./routes/Sewage";
import PineNet from "./routes/PineNet";
import PumpStation from "./routes/PumpStation";
import WaterSupply from "./routes/WaterSupply";
import { Iconstyle } from "./assets/icon/iconfont";
import { Globalstyle } from "./style/global.js";
import FloodControl from "./routes/FloodControl";
import Pine from "./routes/Pine";

function RouterConfig({ history }) {
  const route = () => {
    return (
      <Fragment>
        {/* 全局样式注册到界面中 */}
        <Iconstyle></Iconstyle>
        <Globalstyle></Globalstyle>

        {/* 路由管理 */}
        <Switch>
          <Route path="/" exact component={IndexPage} />
          {/* <Route path='/map' exact component={BMap} /> */}
          <Route path="/water-supply" exact component={WaterSupply} />
          <Route path="/sewage" exact component={Sewage} />
          <Route path="/pine-net" exact component={PineNet} />
          <Route path="/pine" exact component={Pine} />
          <Route path="/pump-station" exact component={PumpStation} />
          <Route path="/flood-control" exact component={FloodControl} />
        </Switch>
      </Fragment>
    );
  };

  return <Router history={history}>{route()}</Router>;
}

export default RouterConfig;
