根据翻译重命名

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 SignOut from "./views/SignOut";
import Index from "./views/index"; import Index from "./views/index";
import ErrorPage from "./views/error-page"; import ErrorPage from "./views/error-page";
import PlanNewest from "./views/plan/Newest"; import ReservationNewest from "./views/reservation/Newest";
import PlanDetail from "./views/plan/Detail"; import ReservationDetail from "./views/reservation/Detail";
configure({ configure({
useProxies: "ifavailable", useProxies: "ifavailable",
@ -32,8 +32,8 @@ const router = createBrowserRouter([
errorElement: <ErrorPage />, errorElement: <ErrorPage />,
children: [ children: [
{ index: true, element: <Index /> }, { index: true, element: <Index /> },
{ path: "plan/newest", element: <PlanNewest />}, { path: "reservation/newest", element: <ReservationNewest />},
{ path: "plan/:planId", element: <PlanDetail />} { path: "reservation/:reservationId", element: <ReservationDetail />}
] ]
}, },
{ {

@ -2,7 +2,7 @@ import { makeAutoObservable, runInAction } from "mobx";
import * as req from '../utils/request'; import * as req from '../utils/request';
import { prepareUrl } from '../utils/commons'; import { prepareUrl } from '../utils/commons';
class Plan { class Reservation {
constructor(root) { constructor(root) {
makeAutoObservable(this, { rootStore: false }); makeAutoObservable(this, { rootStore: false });
@ -11,7 +11,7 @@ class Plan {
fetchRecent() { fetchRecent() {
runInAction(() => { runInAction(() => {
this.planList = [ this.reservationList = [
{ {
key: '1', key: '1',
name: '中华游111029-N111025076', name: '中华游111029-N111025076',
@ -37,7 +37,7 @@ class Plan {
}); });
} }
planList = [ reservationList = [
{ {
key: '1', key: '1',
name: '-', name: '-',
@ -48,4 +48,4 @@ class Plan {
]; ];
} }
export default Plan; export default Reservation;

@ -1,11 +1,11 @@
import { makeAutoObservable } from "mobx"; import { makeAutoObservable } from "mobx";
import Plan from "./Plan"; import Reservation from "./Reservation";
import Auth from "./Auth"; import Auth from "./Auth";
class Root { class Root {
constructor() { constructor() {
this.plan = new Plan(this); this.reservationStore = new Reservation(this);
this.auth = new Auth(this); this.authStore = new Auth(this);
makeAutoObservable(this); makeAutoObservable(this);
} }
} }

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

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

@ -8,7 +8,7 @@ import { useStore } from '../../stores/StoreContext.js';
const { Title } = Typography; const { Title } = Typography;
const planListColumns = [ const reservationListColumns = [
{ {
title: 'Name', title: 'Name',
dataIndex: 'name', dataIndex: 'name',
@ -59,8 +59,8 @@ const planListColumns = [
function Newest() { function Newest() {
const { plan } = useStore(); const { reservationStore } = useStore();
const { planList } = plan; const { reservationList } = reservationStore;
useEffect(() => { useEffect(() => {
console.info('Newest.useEffect'); console.info('Newest.useEffect');
@ -84,7 +84,7 @@ function Newest() {
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table columns={planListColumns} dataSource={toJS(planList)} /> <Table columns={reservationListColumns} dataSource={toJS(reservationList)} />
</Col> </Col>
</Row> </Row>
</Space> </Space>
Loading…
Cancel
Save