Skip to content

Commit a12b357

Browse files
committed
feat: 升级相关依赖
1 parent 7c35f2e commit a12b357

File tree

17 files changed

+107
-156
lines changed

17 files changed

+107
-156
lines changed

package.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,47 @@
2020
},
2121
"dependencies": {
2222
"@alitajs/antd-plus": "^2.5.0",
23-
"@ant-design/icons": "^4.6.2",
24-
"@ant-design/pro-card": "^1.11.6",
25-
"@ant-design/pro-layout": "^6.16.0",
26-
"@ant-design/pro-table": "^2.32.1",
27-
"@formily/antd": "^1.3.13",
28-
"@formily/antd-components": "^1.3.13",
29-
"@pansy/hooks": "^2.3.0",
23+
"@ant-design/icons": "^4.7.0",
24+
"@ant-design/pro-card": "^1.18.30",
25+
"@ant-design/pro-layout": "^6.32.12",
26+
"@ant-design/pro-table": "^2.63.4",
27+
"@formily/antd": "^2.0.10",
28+
"@formily/antd-components": "^1.3.17",
29+
"@formily/core": "^2.0.10",
30+
"@formily/react": "^2.0.10",
3031
"@pansy/policy": "^0.5.0",
31-
"@pansy/react-amap": "1.1.0",
32+
"@pansy/react-amap": "2.12.3",
3233
"@pansy/react-charts": "^1.0.0",
33-
"@pansy/react-watermark": "^2.1.0",
34-
"antd": "^4.15.0",
35-
"classnames": "^2.2.6",
34+
"@pansy/react-hooks": "^0.9.2",
35+
"@pansy/react-watermark": "^3.1.8",
36+
"antd": "^4.18.6",
37+
"classnames": "^2.3.1",
3638
"moment": "^2.29.1",
3739
"numeral": "^2.0.6",
3840
"react": "^17.0.2",
3941
"react-dom": "^17.0.2",
40-
"react-helmet-async": "^1.0.9",
41-
"styled-components": "^5.2.2",
42-
"umi": "^3.4.7",
43-
"umi-request": "^1.3.5",
42+
"react-helmet-async": "^1.2.2",
43+
"styled-components": "^5.3.3",
44+
"umi": "^3.5.20",
45+
"umi-request": "^1.4.0",
4446
"use-merge-value": "^1.0.2"
4547
},
4648
"devDependencies": {
4749
"@alitajs/umi-plugin-antd-plus": "0.2.0",
4850
"@alitajs/umi-plugin-console-version": "0.4.0",
4951
"@alitajs/umi-preset-react": "0.3.0",
50-
"@types/classnames": "2.3.0",
51-
"@types/numeral": "2.0.1",
52-
"@types/react": "17.0.3",
53-
"@types/react-dom": "17.0.3",
54-
"@types/styled-components": "5.1.10",
52+
"@types/classnames": "2.3.1",
53+
"@types/numeral": "2.0.2",
54+
"@types/react": "17.0.39",
55+
"@types/react-dom": "17.0.11",
56+
"@types/styled-components": "5.1.22",
5557
"@walrus/cli": "1.3.4",
56-
"@walrus/plugin-release": "1.13.0",
58+
"@walrus/plugin-release": "1.14.3",
5759
"@walrus/preset-lint": "1.1.8",
58-
"better-mock": "0.3.1",
60+
"better-mock": "0.3.2",
5961
"cross-env": "7.0.3",
6062
"husky": "5.2.0",
61-
"typescript": "4.2.4"
63+
"typescript": "4.5.5"
6264
},
6365
"husky": {
6466
"hooks": {
@@ -70,9 +72,5 @@
7072
"> 1%",
7173
"last 2 versions",
7274
"not ie < 10"
73-
],
74-
"engines": {
75-
"node": ">=10.13.0",
76-
"yarn": ">=1.3.2"
77-
}
75+
]
7876
}

src/components/right-content/avatar-dropdown.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useCallback } from 'react';
22
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
33
import { Avatar, Menu, Spin } from 'antd';
4+
import { MenuProps } from 'antd/es/menu';
45
import { history, useModel } from 'umi';
56
import { getPageQuery } from '@/utils';
67
import { fetchLogout } from '@/services/login';
@@ -32,13 +33,8 @@ const loginOut = async () => {
3233
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
3334
const { initialState, setInitialState } = useModel('@@initialState');
3435

35-
const onMenuClick = useCallback(
36-
(event: {
37-
key: React.Key;
38-
keyPath: React.Key[];
39-
item: React.ReactInstance;
40-
domEvent: React.MouseEvent<HTMLElement>;
41-
}) => {
36+
const onMenuClick: MenuProps['onClick'] = useCallback(
37+
(event) => {
4238
const { key } = event;
4339
if (key === 'logout') {
4440
// @ts-ignore

src/layouts/user-layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FC } from 'react';
1+
import React from 'react';
22
import { Link, useIntl, SelectLang } from 'umi';
33
import {
44
MenuDataItem,
@@ -18,7 +18,7 @@ export interface UserLayoutProps {
1818
route?: ProLayoutProps['route'];
1919
}
2020

21-
const UserLayout: FC<UserLayoutProps> = (props) => {
21+
const UserLayout: React.FC<UserLayoutProps> = (props) => {
2222
const {
2323
children,
2424
location = {

src/pages/404.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Button, Result } from 'antd';
22
import React from 'react';
33
import { useHistory } from 'umi';
44

5-
const NoFoundPage: React.FC<{}> = () => {
5+
export default () => {
66
const history = useHistory();
77

88
return (
@@ -18,5 +18,3 @@ const NoFoundPage: React.FC<{}> = () => {
1818
/>
1919
)
2020
};
21-
22-
export default NoFoundPage;

src/pages/dashboard/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, { Suspense } from 'react';
22
import { Space, Row, Col } from 'antd';
3-
import moment from 'moment';
43
import { useRequest } from 'umi';
5-
import Watermark from '@pansy/react-watermark';
64
import { GridContent, PageLoading } from '@ant-design/pro-layout';
75
import { fetchChartData } from '@/services/dashboard';
86

@@ -21,8 +19,6 @@ const Dashboard: React.FC = () => {
2119
<Space direction="vertical" size="middle" style={{ width: '100%' }}>
2220
<Suspense fallback={<PageLoading />}>
2321
<IntroduceRow loading={loading} />
24-
25-
<Watermark zIndex={998} text={['王某某 6909', moment().format('YYYY-MM-DD HH:mm:ss')]} isBody />
2622
</Suspense>
2723

2824
<Suspense fallback={null}>

src/pages/index.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/pages/libraries/amap/components/cluster/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react';
2-
import { ClusterComponentProps } from '@pansy/react-amap/es/markers';
32
import styles from './index.less';
43

5-
export const Cluster: React.FC<ClusterComponentProps> = ({ count }) => {
4+
export interface ClusterProps {
5+
count: number;
6+
}
7+
8+
export const Cluster: React.FC<ClusterProps> = ({ count }) => {
69
return (
710
<div className={styles.markers}>
811
{count}

src/pages/libraries/amap/index.tsx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
import React, { useState } from 'react';
22
import { PageContainer } from '@ant-design/pro-layout';
3-
import { Map, Markers, ControlBar } from '@pansy/react-amap';
4-
import { MarkersProps } from '@pansy/react-amap/es/markers';
3+
import { Map, ControlBar, MarkerCluster } from '@pansy/react-amap';
54
import { Marker, Cluster } from './components';
65
import './styles.less';
76

87
const randomMarker = (len: number) => (
98
Array(len).fill(true).map(() => ({
10-
position: {
11-
longitude: 100 + Math.random() * 30,
12-
latitude: 30 + Math.random() * 20,
13-
},
14-
}))
9+
lnglat: [ 100 + Math.random() * 30, 30 + Math.random() * 20,]
10+
})) as AMap.MarkerCluster.DataOptions[]
1511
);
1612

17-
const MapComponent: React.FC = () => {
18-
const [markers] = useState<MarkersProps['markers']>(randomMarker(100));
13+
export default () => {
14+
const [markers] = useState<AMap.MarkerCluster.DataOptions[]>(randomMarker(100));
1915

2016
return (
2117
<PageContainer>
2218
<div style={{ width: '100%', height: 800 }}>
2319
<Map zoom={5}>
2420
<ControlBar position={{ right: '10px', bottom: '10px' }} />
25-
<Markers
26-
markers={markers}
27-
useCluster={{
28-
render: () => {
29-
return <Cluster />
30-
}
21+
<MarkerCluster
22+
data={markers}
23+
renderCluster={(data) => {
24+
return <Cluster count={data.count} />
3125
}}
3226
render={() => <Marker />}
3327
/>
@@ -36,5 +30,3 @@ const MapComponent: React.FC = () => {
3630
</PageContainer>
3731
)
3832
}
39-
40-
export default MapComponent;
Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
1-
import React, { useState, useEffect, useRef } from 'react';
1+
import React, { useState } from 'react';
22
import moment from 'moment';
3+
import { useInterval } from '@pansy/react-hooks'
34
import Watermark from '@pansy/react-watermark';
45

56
export default () => {
6-
const interval = useRef<NodeJS.Timeout>();
77
const [watermarkTexts, setWatermarkTexts] = useState<string[]>(
88
['王某某 6909', moment().format('YYYY-MM-DD HH:mm:ss')]
99
);
1010

11-
useEffect(
12-
() => {
13-
// @ts-ignore
14-
interval.current = setInterval(
15-
() => {
16-
setWatermarkTexts((texts) => {
17-
texts[1] = moment().format('YYYY-MM-DD HH:mm:ss');
11+
useInterval(() => {
12+
setWatermarkTexts((texts) => {
13+
texts[1] = moment().format('YYYY-MM-DD HH:mm:ss');
1814

19-
return texts;
20-
})
21-
},
22-
3000
23-
)
24-
25-
return () => {
26-
interval.current && clearInterval(interval.current);
27-
}
28-
},
29-
[]
30-
);
15+
return texts;
16+
})
17+
}, 3 * 1000);
3118

3219
return (
33-
<div style={{ width: '100%', height: 800 }}>
34-
<Watermark text={watermarkTexts} />
35-
</div>
20+
<Watermark width={200} height={200} text={watermarkTexts}>
21+
<div style={{ width: '100%', height: 800 }} />
22+
</Watermark>
3623
)
3724
}

0 commit comments

Comments
 (0)