From e23cbff9140ce6ae9c0112a86ed359bf8e4a81b1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 12 Jul 2025 12:18:45 +0800 Subject: [PATCH] refactor: remove react and antd warnings (#11527) --- .../center/components/Applications/index.tsx | 6 ++-- src/pages/account/center/index.tsx | 2 +- .../components/Charts/ChartCard/index.tsx | 5 +-- .../components/Charts/MiniProgress/index.tsx | 6 ++-- .../analysis/components/IntroduceRow.tsx | 8 ++--- .../analysis/components/OfflineData.tsx | 2 +- .../analysis/components/TopSearch.tsx | 2 +- src/pages/dashboard/monitor/index.tsx | 36 +++++++++++-------- src/pages/form/advanced-form/index.tsx | 6 ++-- src/pages/form/basic-form/index.tsx | 2 +- src/pages/form/step-form/index.tsx | 2 +- .../basic-list/components/OperationModal.tsx | 2 +- src/pages/list/basic-list/index.tsx | 4 +-- src/pages/list/search/applications/index.tsx | 8 +++-- src/pages/list/search/articles/index.tsx | 10 ++++-- src/pages/list/search/projects/index.tsx | 2 +- .../list/table-list/components/CreateForm.tsx | 2 +- .../list/table-list/components/UpdateForm.tsx | 8 +++-- src/pages/profile/advanced/index.tsx | 15 ++++---- src/pages/profile/basic/index.tsx | 2 +- src/pages/result/fail/index.tsx | 7 ++-- src/pages/result/success/index.tsx | 7 ++-- .../table-list/components/UpdateForm.tsx | 8 +++-- src/pages/user/register/index.tsx | 2 +- 24 files changed, 87 insertions(+), 67 deletions(-) diff --git a/src/pages/account/center/components/Applications/index.tsx b/src/pages/account/center/components/Applications/index.tsx index f0f46237..e8c273f5 100644 --- a/src/pages/account/center/components/Applications/index.tsx +++ b/src/pages/account/center/components/Applications/index.tsx @@ -77,8 +77,10 @@ const Applications: React.FC = () => { diff --git a/src/pages/account/center/index.tsx b/src/pages/account/center/index.tsx index 834cf932..88881321 100644 --- a/src/pages/account/center/index.tsx +++ b/src/pages/account/center/index.tsx @@ -219,7 +219,7 @@ const Center: React.FC = () => { = (props) => { }; const { loading = false, ...rest } = props; + const cardProps = omit(rest, ['total', 'contentHeight', 'action']); return ( = (props) => { padding: '20px 24px 8px 24px', }, }} - {...rest} + {...cardProps} > {renderContent()} diff --git a/src/pages/dashboard/analysis/components/Charts/MiniProgress/index.tsx b/src/pages/dashboard/analysis/components/Charts/MiniProgress/index.tsx index 55042285..5376e01c 100644 --- a/src/pages/dashboard/analysis/components/Charts/MiniProgress/index.tsx +++ b/src/pages/dashboard/analysis/components/Charts/MiniProgress/index.tsx @@ -4,7 +4,7 @@ export type MiniProgressProps = { target: number; targetLabel?: string; color?: string; - strokeWidth?: number; + size?: number; percent?: number; style?: React.CSSProperties; }; @@ -12,7 +12,7 @@ const MiniProgress: React.FC = ({ targetLabel, target, color = 'rgb(19, 194, 194)', - strokeWidth, + size, percent, }) => { return ( @@ -39,7 +39,7 @@ const MiniProgress: React.FC = ({ style={{ backgroundColor: color || undefined, width: percent ? `${percent}%` : undefined, - height: strokeWidth || undefined, + height: size || undefined, }} /> diff --git a/src/pages/dashboard/analysis/components/IntroduceRow.tsx b/src/pages/dashboard/analysis/components/IntroduceRow.tsx index 432d10c0..6e21f1f3 100644 --- a/src/pages/dashboard/analysis/components/IntroduceRow.tsx +++ b/src/pages/dashboard/analysis/components/IntroduceRow.tsx @@ -30,7 +30,7 @@ const IntroduceRow = ({ @@ -65,7 +65,7 @@ const IntroduceRow = ({ diff --git a/src/pages/dashboard/analysis/components/OfflineData.tsx b/src/pages/dashboard/analysis/components/OfflineData.tsx index a9e5164a..f271c9af 100644 --- a/src/pages/dashboard/analysis/components/OfflineData.tsx +++ b/src/pages/dashboard/analysis/components/OfflineData.tsx @@ -61,7 +61,7 @@ const OfflineData = ({ { @@ -35,7 +34,7 @@ const Monitor: FC = () => { marginBottom: 24, }} > - + { - { style={{ marginBottom: 24, }} - bordered={false} + variant="borderless" > @@ -82,10 +82,12 @@ const Monitor: FC = () => { style={{ marginBottom: 24, }} - bodyStyle={{ - textAlign: 'center', + styles={{ + body: { + textAlign: 'center', + }, }} - bordered={false} + variant="borderless" > { marginBottom: 24, }} > - + { { > diff --git a/src/pages/form/advanced-form/index.tsx b/src/pages/form/advanced-form/index.tsx index 4beea994..83a262ed 100644 --- a/src/pages/form/advanced-form/index.tsx +++ b/src/pages/form/advanced-form/index.tsx @@ -190,7 +190,7 @@ const AdvancedForm: FC> = () => { onFinishFailed={onFinishFailed} > - + > = () => { - + > = () => { - + recordCreatorProps={{ diff --git a/src/pages/form/basic-form/index.tsx b/src/pages/form/basic-form/index.tsx index 882fb0b3..7d053f99 100644 --- a/src/pages/form/basic-form/index.tsx +++ b/src/pages/form/basic-form/index.tsx @@ -28,7 +28,7 @@ const BasicForm: FC> = () => { }; return ( - + > = () => { const formRef = useRef(null); return ( - + = (props) => { trigger={children} modalProps={{ onCancel: () => onDone(), - destroyOnClose: true, + destroyOnHidden: true, bodyStyle: done ? { padding: '72px 0', diff --git a/src/pages/list/basic-list/index.tsx b/src/pages/list/basic-list/index.tsx index 05c8b2d0..3ac9e29a 100644 --- a/src/pages/list/basic-list/index.tsx +++ b/src/pages/list/basic-list/index.tsx @@ -62,7 +62,7 @@ const ListContent = ({ {
- + diff --git a/src/pages/list/search/applications/index.tsx b/src/pages/list/search/applications/index.tsx index e98b5eb8..4b69ccad 100644 --- a/src/pages/list/search/applications/index.tsx +++ b/src/pages/list/search/applications/index.tsx @@ -90,7 +90,7 @@ export const Applications: FC> = () => { return (
- +
{ run(values); @@ -185,8 +185,10 @@ export const Applications: FC> = () => { diff --git a/src/pages/list/search/articles/index.tsx b/src/pages/list/search/articles/index.tsx index 40ba5461..868a11cf 100644 --- a/src/pages/list/search/articles/index.tsx +++ b/src/pages/list/search/articles/index.tsx @@ -132,7 +132,7 @@ const Articles: FC = () => { return ( <> - + { size="large" diff --git a/src/pages/list/search/projects/index.tsx b/src/pages/list/search/projects/index.tsx index ef684b61..fa0401e7 100644 --- a/src/pages/list/search/projects/index.tsx +++ b/src/pages/list/search/projects/index.tsx @@ -89,7 +89,7 @@ const Projects: FC = () => { }; return (
- + { diff --git a/src/pages/list/table-list/components/CreateForm.tsx b/src/pages/list/table-list/components/CreateForm.tsx index 4bbade11..a02ef58a 100644 --- a/src/pages/list/table-list/components/CreateForm.tsx +++ b/src/pages/list/table-list/components/CreateForm.tsx @@ -12,7 +12,7 @@ const CreateForm: React.FC = (props) => { return ( onCancel()} diff --git a/src/pages/list/table-list/components/UpdateForm.tsx b/src/pages/list/table-list/components/UpdateForm.tsx index b3b9183d..c785b1dc 100644 --- a/src/pages/list/table-list/components/UpdateForm.tsx +++ b/src/pages/list/table-list/components/UpdateForm.tsx @@ -35,10 +35,12 @@ const UpdateForm: React.FC = (props) => { return ( @@ -67,7 +66,7 @@ const action = ( } return ( - + - + ); @@ -262,7 +261,9 @@ const Advanced: FC = () => { return ( {dot} @@ -362,7 +363,7 @@ const Advanced: FC = () => { style={{ marginBottom: 24, }} - bordered={false} + variant="borderless" > { style={{ marginBottom: 24, }} - bordered={false} + variant="borderless" > diff --git a/src/pages/profile/basic/index.tsx b/src/pages/profile/basic/index.tsx index 31647f2e..08e6fdbc 100644 --- a/src/pages/profile/basic/index.tsx +++ b/src/pages/profile/basic/index.tsx @@ -166,7 +166,7 @@ const Basic: FC = () => { ]; return ( - + { const { styles } = useStyles(); const Content = ( - + <>
您提交的内容有如下错误:
@@ -49,11 +48,11 @@ export default () => {
- + ); return ( - + { ); const extra = ( - + <> - + ); return ( - + = (props) => { return ( { > 100 ? 100 : value.length * 10} showInfo={false} />