根据翻译重命名

release
Jimmy Liow 2 years ago
parent e5ebfbd7dd
commit bc6d1b7a40

@ -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: <ErrorPage />,
children: [
{ index: true, element: <Index /> },
{ path: "plan/newest", element: <PlanNewest />},
{ path: "plan/:planId", element: <PlanDetail />}
{ path: "reservation/newest", element: <ReservationNewest />},
{ path: "reservation/:reservationId", element: <ReservationDetail />}
]
},
{

@ -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;
export default Reservation;

@ -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);
}
}

@ -62,9 +62,9 @@ export default function App() {
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={['2']} items={
[
{ key: 1, label: <Link to="/plan/newest">Plan</Link> },
{ key: 2, label: <Link to="/invoice/list">Invoice</Link> },
{ key: 3, label: <Link to="/feedback/list">Feedback</Link> }
{ key: 1, label: <Link to="/reservation/newest">Reservation</Link> },
{ key: 3, label: <Link to="/feedback/list">Feedback</Link> },
{ key: 2, label: <Link to="/invoice/list">Invoice</Link> }
]
} />
</Col>

@ -58,7 +58,7 @@ const planListColumns = [
];
function Detail() {
const { planId } = useParams();
const { reservationId } = useParams();
const { plan } = useStore();
const { planList } = plan;

@ -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() {
</Row>
<Row>
<Col span={24}>
<Table columns={planListColumns} dataSource={toJS(planList)} />
<Table columns={reservationListColumns} dataSource={toJS(reservationList)} />
</Col>
</Row>
</Space>
Loading…
Cancel
Save