diff --git a/src/main.jsx b/src/main.jsx index 0b75844..dc195f2 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -13,8 +13,8 @@ import Login from "./views/Login"; import SignOut from "./views/SignOut"; import Index from "./views/index"; import ErrorPage from "./views/error-page"; -import PlanNewest from "./views/plan/Newest"; -import PlanDetail from "./views/plan/Detail"; +import ReservationNewest from "./views/reservation/Newest"; +import ReservationDetail from "./views/reservation/Detail"; configure({ useProxies: "ifavailable", @@ -32,8 +32,8 @@ const router = createBrowserRouter([ errorElement: , children: [ { index: true, element: }, - { path: "plan/newest", element: }, - { path: "plan/:planId", element: } + { path: "reservation/newest", element: }, + { path: "reservation/:reservationId", element: } ] }, { diff --git a/src/stores/Plan.js b/src/stores/Reservation.js similarity index 86% rename from src/stores/Plan.js rename to src/stores/Reservation.js index 5d83775..b4caacd 100644 --- a/src/stores/Plan.js +++ b/src/stores/Reservation.js @@ -2,7 +2,7 @@ import { makeAutoObservable, runInAction } from "mobx"; import * as req from '../utils/request'; import { prepareUrl } from '../utils/commons'; -class Plan { +class Reservation { constructor(root) { makeAutoObservable(this, { rootStore: false }); @@ -11,7 +11,7 @@ class Plan { fetchRecent() { runInAction(() => { - this.planList = [ + this.reservationList = [ { key: '1', name: '中华游111029-N111025076', @@ -37,7 +37,7 @@ class Plan { }); } - planList = [ + reservationList = [ { key: '1', name: '-', @@ -48,4 +48,4 @@ class Plan { ]; } -export default Plan; \ No newline at end of file +export default Reservation; \ No newline at end of file diff --git a/src/stores/Root.js b/src/stores/Root.js index fb17968..34a34c3 100644 --- a/src/stores/Root.js +++ b/src/stores/Root.js @@ -1,11 +1,11 @@ import { makeAutoObservable } from "mobx"; -import Plan from "./Plan"; +import Reservation from "./Reservation"; import Auth from "./Auth"; class Root { constructor() { - this.plan = new Plan(this); - this.auth = new Auth(this); + this.reservationStore = new Reservation(this); + this.authStore = new Auth(this); makeAutoObservable(this); } } diff --git a/src/views/App.jsx b/src/views/App.jsx index 5012f37..909298b 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -62,9 +62,9 @@ export default function App() { Plan }, - { key: 2, label: Invoice }, - { key: 3, label: Feedback } + { key: 1, label: Reservation }, + { key: 3, label: Feedback }, + { key: 2, label: Invoice } ] } /> diff --git a/src/views/plan/Detail.jsx b/src/views/reservation/Detail.jsx similarity index 92% rename from src/views/plan/Detail.jsx rename to src/views/reservation/Detail.jsx index 9dfa2b9..5860c0e 100644 --- a/src/views/plan/Detail.jsx +++ b/src/views/reservation/Detail.jsx @@ -58,7 +58,7 @@ const planListColumns = [ ]; function Detail() { - const { planId } = useParams(); + const { reservationId } = useParams(); const { plan } = useStore(); const { planList } = plan; diff --git a/src/views/plan/Newest.jsx b/src/views/reservation/Newest.jsx similarity index 85% rename from src/views/plan/Newest.jsx rename to src/views/reservation/Newest.jsx index c9fb3cd..5a82d8d 100644 --- a/src/views/plan/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -8,7 +8,7 @@ import { useStore } from '../../stores/StoreContext.js'; const { Title } = Typography; -const planListColumns = [ +const reservationListColumns = [ { title: 'Name', dataIndex: 'name', @@ -59,8 +59,8 @@ const planListColumns = [ function Newest() { - const { plan } = useStore(); - const { planList } = plan; + const { reservationStore } = useStore(); + const { reservationList } = reservationStore; useEffect(() => { console.info('Newest.useEffect'); @@ -84,7 +84,7 @@ function Newest() { - +