diff --git a/src/empty/emptyImg/empty_notFound.png b/src/empty/emptyImg/empty_notFound.png new file mode 100644 index 000000000..b39c96391 Binary files /dev/null and b/src/empty/emptyImg/empty_notFound.png differ diff --git a/src/empty/index.tsx b/src/empty/index.tsx index 57ee9f0ba..b578d78b6 100644 --- a/src/empty/index.tsx +++ b/src/empty/index.tsx @@ -12,10 +12,11 @@ export const IMG_MAP = { chart: 'empty_chart.png', overview: 'empty_overview.png', permission: 'empty_permission.png', + notFound: 'empty_notFound.png', }; export interface EmptyProps extends AntdEmptyProps { - type?: 'default' | 'search' | 'chart' | 'project' | 'overview' | 'permission'; + type?: 'default' | 'search' | 'chart' | 'project' | 'overview' | 'permission' | 'notFound'; size?: 'default' | 'large'; showEmpty?: boolean; extra?: ReactNode; diff --git a/src/notFound/__tests__/notFound.test.tsx b/src/notFound/__tests__/notFound.test.tsx index 78b760ef1..c98d1d1e7 100644 --- a/src/notFound/__tests__/notFound.test.tsx +++ b/src/notFound/__tests__/notFound.test.tsx @@ -9,7 +9,7 @@ describe('test NotFound', () => { test('renders not found message', () => { const { getByText } = render(); - const element = getByText(/亲,是不是走错地方了?/i); + const element = getByText(/抱歉,您访问的页面不存在/i); expect(element).toBeInTheDocument(); }); }); diff --git a/src/notFound/index.tsx b/src/notFound/index.tsx index a21cc97bf..b453851ff 100644 --- a/src/notFound/index.tsx +++ b/src/notFound/index.tsx @@ -1,21 +1,23 @@ import React from 'react'; -import { FrownOutlined } from '@ant-design/icons'; import classNames from 'classnames'; +import Empty from '../empty'; import './style.scss'; -const NotFound: React.FC = function ({ - className, - style, -}: { +interface INotFoundProps { className?: string; style?: React.CSSProperties; -}) { +} + +const NotFound: React.FC = function ({ className, style }) { return (
-

- 亲,是不是走错地方了? -

+
); }; diff --git a/src/notFound/style.scss b/src/notFound/style.scss index cc8b50358..5c558e449 100644 --- a/src/notFound/style.scss +++ b/src/notFound/style.scss @@ -1,4 +1,6 @@ .dtc-not-found { - line-height: 200px; - text-align: center; + margin-top: 160px; + width: 100%; + display: flex; + justify-content: center; }