Skip to content

Commit 67ddeb0

Browse files
committed
feat(platform): add table route
1 parent 5ab8359 commit 67ddeb0

File tree

146 files changed

+2198
-1672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+2198
-1672
lines changed

package.json

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@
2828
"@amap/amap-jsapi-loader": "^1.0.1",
2929
"@amap/amap-jsapi-types": "^0.0.10",
3030
"@ant-design/icons-svg": "^4.2.1",
31-
"@commitlint/cli": "^17.1.2",
32-
"@commitlint/config-conventional": "^17.1.0",
33-
"@nrwl/cli": "15.0.2",
34-
"@nrwl/eslint-plugin-nx": "15.0.2",
35-
"@nrwl/jest": "15.0.2",
36-
"@nrwl/linter": "15.0.2",
37-
"@nrwl/nx-cloud": "15.0.0",
38-
"@nrwl/react": "15.0.2",
39-
"@nrwl/tao": "15.0.2",
40-
"@nrwl/web": "15.0.2",
41-
"@nrwl/workspace": "15.0.2",
31+
"@commitlint/cli": "^17.2.0",
32+
"@commitlint/config-conventional": "^17.2.0",
33+
"@nrwl/cli": "15.0.10",
34+
"@nrwl/eslint-plugin-nx": "15.0.10",
35+
"@nrwl/jest": "15.0.10",
36+
"@nrwl/linter": "15.0.10",
37+
"@nrwl/nx-cloud": "15.0.2",
38+
"@nrwl/react": "15.0.10",
39+
"@nrwl/tao": "15.0.10",
40+
"@nrwl/web": "15.0.10",
41+
"@nrwl/workspace": "15.0.10",
4242
"@stackblitz/sdk": "^1.8.0",
4343
"@testing-library/jest-dom": "^5.16.5",
4444
"@testing-library/react": "^13.4.0",
4545
"@types/fs-extra": "^9.0.13",
4646
"@types/glob": "^8.0.0",
4747
"@types/jest": "^27.4.1",
48-
"@types/lodash": "^4.14.186",
48+
"@types/lodash": "^4.14.188",
4949
"@types/marked": "^4.0.7",
5050
"@types/node": "16.18.0",
51-
"@types/react": "^18.0.22",
52-
"@types/react-dom": "^18.0.7",
53-
"@types/vscode": "^1.72.0",
51+
"@types/react": "^18.0.25",
52+
"@types/react-dom": "^18.0.8",
53+
"@types/vscode": "^1.73.0",
5454
"@types/yaml-front-matter": "^4.1.0",
55-
"@typescript-eslint/eslint-plugin": "^5.41.0",
56-
"@typescript-eslint/parser": "^5.41.0",
55+
"@typescript-eslint/eslint-plugin": "^5.42.0",
56+
"@typescript-eslint/parser": "^5.42.0",
5757
"axios": "^1.1.2",
5858
"axios-mock-adapter": "^1.21.2",
5959
"babel-jest": "^29.1.2",
@@ -63,10 +63,10 @@
6363
"core-js": "^3.26.0",
6464
"dayjs": "^1.11.6",
6565
"echarts": "^5.4.0",
66-
"eslint": "^8.26.0",
66+
"eslint": "^8.27.0",
6767
"eslint-config-prettier": "^8.5.0",
6868
"eslint-plugin-import": "^2.26.0",
69-
"eslint-plugin-jsdoc": "^39.3.24",
69+
"eslint-plugin-jsdoc": "^39.6.2",
7070
"eslint-plugin-jsx-a11y": "^6.6.1",
7171
"eslint-plugin-markdown": "^3.0.0",
7272
"eslint-plugin-prettier": "^4.2.1",
@@ -77,40 +77,41 @@
7777
"glob": "^8.0.3",
7878
"highlight.js": "^11.6.0",
7979
"husky": "^8.0.1",
80-
"i18next": "^21.10.0",
80+
"i18next": "^22.0.4",
8181
"immer": "^9.0.16",
8282
"is-builtin-module": "^3.2.0",
8383
"jest": "^27.5.1",
8484
"jest-environment-jsdom": "28.1.1",
85+
"jsurl": "^0.1.5",
8586
"lerna": "^6.0.1",
8687
"lodash": "^4.17.21",
87-
"marked": "^4.1.1",
88-
"nx": "15.0.2",
88+
"marked": "^4.2.2",
89+
"nx": "15.0.10",
8990
"postcss-html": "^1.5.0",
9091
"postcss-markdown": "^1.2.0",
9192
"prettier": "^2.7.1",
9293
"react": "^18.2.0",
9394
"react-dom": "^18.2.0",
94-
"react-i18next": "^11.18.6",
95-
"react-router-dom": "^6.4.2",
95+
"react-i18next": "^12.0.0",
96+
"react-router-dom": "^6.4.3",
9697
"react-test-renderer": "^18.2.0",
9798
"regenerator-runtime": "^0.13.10",
9899
"rfs": "^9.0.6",
99100
"rxjs": "^7.5.7",
100101
"rxjs-for-await": "^1.0.0",
101-
"sass": "^1.55.0",
102-
"sort-package-json": "^2.0.0",
103-
"stylelint": "^14.14.0",
102+
"sass": "^1.56.0",
103+
"sort-package-json": "^2.1.0",
104+
"stylelint": "^14.14.1",
104105
"stylelint-config-prettier": "^9.0.3",
105106
"stylelint-config-recess-order": "^3.0.0",
106107
"stylelint-config-recommended-scss": "^8.0.0",
107108
"stylelint-config-standard": "^29.0.0",
108109
"stylelint-scss": "^4.3.0",
109110
"swiper": "^8.4.4",
110-
"table": "^6.8.0",
111+
"table": "^6.8.1",
111112
"ts-jest": "^27.1.4",
112113
"ts-node": "^10.9.1",
113-
"tslib": "^2.4.0",
114+
"tslib": "^2.4.1",
114115
"typescript": "~4.8.4",
115116
"yaml-front-matter": "^4.1.1"
116117
},

packages/hooks/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
"sideEffects": false,
2424
"dependencies": {
2525
"@react-devui/utils": "file:../utils",
26-
"immer": "^9.0.15",
26+
"immer": "^9.0.16",
2727
"lodash": "^4.17.21",
28-
"react": "^18.2.0",
29-
"react-dom": "^18.2.0",
3028
"rxjs": "^7.5.7"
3129
},
30+
"peerDependencies": {
31+
"react": "^18.2.0",
32+
"react-dom": "^18.2.0"
33+
},
3234
"publishConfig": {
3335
"access": "public",
3436
"directory": "../../dist/packages/hooks"

packages/icons/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@
2424
"dependencies": {
2525
"@ant-design/icons-svg": "^4.2.1",
2626
"@react-devui/utils": "file:../utils",
27-
"lodash": "^4.17.21",
28-
"react": "^18.2.0"
27+
"lodash": "^4.17.21"
28+
},
29+
"peerDependencies": {
30+
"react": "^18.2.0",
31+
"react-dom": "^18.2.0"
2932
},
3033
"publishConfig": {
3134
"access": "public",

packages/platform/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
"axios": "^1.1.2",
2929
"axios-mock-adapter": "^1.21.2",
3030
"bootstrap": "^5.2.2",
31-
"core-js": "^3.25.5",
31+
"core-js": "^3.26.0",
3232
"echarts": "^5.4.0",
3333
"i18next": "^21.10.0",
34+
"immer": "^9.0.16",
3435
"lodash": "^4.17.21",
3536
"react": "^18.2.0",
3637
"react-dom": "^18.2.0",
3738
"react-i18next": "^11.18.6",
3839
"react-router-dom": "^6.4.2",
39-
"regenerator-runtime": "^0.13.9",
40+
"regenerator-runtime": "^0.13.10",
4041
"rxjs": "^7.5.7"
4142
}
4243
}

packages/platform/src/app/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ export function App() {
2929
useMount(() => {
3030
i18n.changeLanguage(languageStorage.value);
3131

32-
const [authReq] = http<UserState>({
32+
http<UserState>({
3333
url: '/auth/me',
3434
method: 'get',
35-
});
36-
authReq.subscribe({
35+
}).subscribe({
3736
next: (res) => {
3837
setLoading(false);
3938
init(res);

packages/platform/src/app/Routes.tsx

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { Control, ControlMode } from '../core/useACL';
2-
import type { DBreadcrumbItem } from '@react-devui/ui/components/breadcrumb';
3-
import type { DId } from '@react-devui/ui/utils/types';
42
import type { IndexRouteObject, NonIndexRouteObject, RouteMatch } from 'react-router-dom';
53

6-
import { isUndefined, nth } from 'lodash';
4+
import { nth } from 'lodash';
75
import React from 'react';
86
import { useTranslation } from 'react-i18next';
97
import { matchRoutes, Navigate, renderMatches, useLocation } from 'react-router-dom';
@@ -21,6 +19,8 @@ import AppLoginRoute from './routes/login/Login';
2119
const AppAMapRoute = React.lazy(() => import('./routes/dashboard/amap/AMap'));
2220
const AppEChartsRoute = React.lazy(() => import('./routes/dashboard/echarts/ECharts'));
2321

22+
const AppStandardTableRoute = React.lazy(() => import('./routes/list/standard-table/StandardTable'));
23+
2424
const AppACLRoute = React.lazy(() => import('./routes/test/acl/ACL'));
2525
const AppHttpRoute = React.lazy(() => import('./routes/test/http/Http'));
2626

@@ -35,8 +35,13 @@ export type CanActivateFn = (route: RouteItem) => true | React.ReactElement;
3535

3636
export interface RouteData {
3737
title?: string;
38-
titleI18n?: string;
39-
breadcrumb?: DBreadcrumbItem<DId> | false;
38+
breadcrumb?:
39+
| {
40+
title?: string;
41+
link?: boolean;
42+
separator?: React.ReactNode;
43+
}
44+
| false;
4045
acl?:
4146
| {
4247
control: Control | Control[];
@@ -71,13 +76,17 @@ export function AppRoutes() {
7176
path: LOGIN_PATH,
7277
element: <AppLoginRoute />,
7378
data: {
74-
titleI18n: 'login',
79+
title: t('login', { ns: 'title' }),
7580
},
7681
},
7782
{
7883
path: '/',
7984
element: <AppLayout />,
8085
data: {
86+
breadcrumb: {
87+
title: t('home', { ns: 'title' }),
88+
link: true,
89+
},
8190
canActivate: [tokenGuard],
8291
canActivateChild: [tokenGuard],
8392
},
@@ -88,6 +97,11 @@ export function AppRoutes() {
8897
},
8998
{
9099
path: 'dashboard',
100+
data: {
101+
breadcrumb: {
102+
title: t('dashboard.', { ns: 'title' }),
103+
},
104+
},
91105
children: [
92106
{
93107
path: 'amap',
@@ -97,7 +111,10 @@ export function AppRoutes() {
97111
</React.Suspense>
98112
),
99113
data: {
100-
titleI18n: 'dashboard.amap',
114+
title: t('dashboard.amap', { ns: 'title' }),
115+
breadcrumb: {
116+
link: true,
117+
},
101118
acl: ROUTES_ACL.dashboard.amap,
102119
canActivate: [ACLGuard],
103120
},
@@ -110,15 +127,49 @@ export function AppRoutes() {
110127
</React.Suspense>
111128
),
112129
data: {
113-
titleI18n: 'dashboard.echarts',
130+
title: t('dashboard.echarts', { ns: 'title' }),
131+
breadcrumb: {
132+
link: true,
133+
},
114134
acl: ROUTES_ACL.dashboard.echarts,
115135
canActivate: [ACLGuard],
116136
},
117137
},
118138
],
119139
},
140+
{
141+
path: 'list',
142+
data: {
143+
breadcrumb: {
144+
title: t('list.', { ns: 'title' }),
145+
},
146+
},
147+
children: [
148+
{
149+
path: 'standard-table',
150+
element: (
151+
<React.Suspense fallback={<AppFCPLoader />}>
152+
<AppStandardTableRoute />
153+
</React.Suspense>
154+
),
155+
data: {
156+
title: t('list.standard-table', { ns: 'title' }),
157+
breadcrumb: {
158+
link: true,
159+
},
160+
acl: ROUTES_ACL.list['standard-table'],
161+
canActivate: [ACLGuard],
162+
},
163+
},
164+
],
165+
},
120166
{
121167
path: 'test',
168+
data: {
169+
breadcrumb: {
170+
title: t('test.', { ns: 'title' }),
171+
},
172+
},
122173
children: [
123174
{
124175
path: 'acl',
@@ -128,7 +179,7 @@ export function AppRoutes() {
128179
</React.Suspense>
129180
),
130181
data: {
131-
titleI18n: 'test.acl',
182+
title: t('test.acl', { ns: 'title' }),
132183
acl: ROUTES_ACL.test.acl,
133184
canActivate: [ACLGuard],
134185
},
@@ -141,7 +192,7 @@ export function AppRoutes() {
141192
</React.Suspense>
142193
),
143194
data: {
144-
titleI18n: 'test.http',
195+
title: t('test.http', { ns: 'title' }),
145196
acl: ROUTES_ACL.test.http,
146197
canActivate: [ACLGuard],
147198
},
@@ -186,8 +237,7 @@ export function AppRoutes() {
186237
return renderMatches(matches);
187238
})();
188239

189-
const { title: _title, titleI18n } = nth(matches, -1)?.route.data ?? {};
190-
const title = _title ?? (isUndefined(titleI18n) ? undefined : t(titleI18n, { ns: 'title' }));
240+
const { title } = nth(matches, -1)?.route.data ?? {};
191241
usePageTitle(title);
192242

193243
return (

packages/platform/src/app/components/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ export { AppMap } from './map';
1313

1414
export type { AppRouteHeaderProps, AppRouteHeaderBreadcrumbProps, AppRouteHeaderHeaderProps } from './route-header';
1515
export { AppRouteHeader } from './route-header';
16+
17+
export type { AppStatusDotProps } from './status-dot';
18+
export { AppStatusDot } from './status-dot';
19+
20+
export type { AppTableFilterProps } from './table-filter';
21+
export { AppTableFilter } from './table-filter';

0 commit comments

Comments
 (0)