From c241bbe5e133fa0ec13614975ccf566ea1b98a96 Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Wed, 12 Apr 2023 10:57:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E6=9C=9F=E9=80=89?= =?UTF-8?q?=E6=8B=A9=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 13 ++++++-- package.json | 1 + src/stores/Plan.js | 45 ++++++++++++++++++++++----- src/views/App.jsx | 7 ----- src/views/Plan.jsx | 77 ++++++++++++++++++++-------------------------- 5 files changed, 83 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index c11bcd6..90646f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,17 @@ { "name": "global.highlights.hub", - "version": "0.0.0", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "global.highlights.hub", - "version": "0.0.0", + "version": "0.1.0", "dependencies": { "antd": "^5.4.0", "mobx": "^6.9.0", "mobx-react": "^7.6.0", + "moment": "^2.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.10.0" @@ -1536,6 +1537,14 @@ } } }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index c6bf54a..1716ae8 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "antd": "^5.4.0", "mobx": "^6.9.0", "mobx-react": "^7.6.0", + "moment": "^2.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.10.0" diff --git a/src/stores/Plan.js b/src/stores/Plan.js index 8bf24c5..5d83775 100644 --- a/src/stores/Plan.js +++ b/src/stores/Plan.js @@ -1,20 +1,51 @@ -import { makeAutoObservable } from "mobx"; +import { makeAutoObservable, runInAction } from "mobx"; +import * as req from '../utils/request'; +import { prepareUrl } from '../utils/commons'; class Plan { - count = 0; constructor(root) { makeAutoObservable(this, { rootStore: false }); this.root = root; } - increase() { - this.count += 1; + fetchRecent() { + runInAction(() => { + this.planList = [ + { + key: '1', + name: '中华游111029-N111025076', + age: 32, + address: '5大1小', + tags: ['nice', 'developer'], + }, + { + key: '2', + name: '中华游111030-HY110704017', + age: 42, + address: '2大', + tags: ['loser'], + }, + { + key: '3', + name: '中华游111030-Y111004040', + age: 32, + address: '30大', + tags: ['cool', 'teacher'], + }, + ]; + }); } - decrease() { - this.count -= 1; - } + planList = [ + { + key: '1', + name: '-', + age: 0, + address: '-', + tags: ['*'], + } + ]; } export default Plan; \ No newline at end of file diff --git a/src/views/App.jsx b/src/views/App.jsx index f65051c..263b8ae 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -113,13 +113,6 @@ export default function App() { - - { console.info('planId: ' + planId); - }, [planId]); + }, [planId]); return ( - - - Parameter: {planId} - - - - - - - - - - - - + Newest Plans + + + Parameter: {planId} + + + + Group Date: + + + + + + + + + +
+ + ); }