Browse Source
feat: add card wrappers to error pages and buttons to sales tabs (#11513)
pull/11527/head
afc163
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with
67 additions and
54 deletions
-
src/loading.tsx
-
src/pages/404.tsx
-
src/pages/dashboard/analysis/components/SalesCard.tsx
-
src/pages/dashboard/analysis/style.style.ts
-
src/pages/exception/403/index.tsx
-
src/pages/exception/404/index.tsx
-
src/pages/exception/500/index.tsx
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { Skeleton } from 'antd'; |
|
|
|
|
|
|
|
const Loading: React.FC = () => ( |
|
|
|
<Skeleton style={{ margin: '24px 40px' }} active /> |
|
|
|
<Skeleton style={{ margin: '24px 40px', height: '60vh' }} active /> |
|
|
|
); |
|
|
|
|
|
|
|
export default Loading; |
|
|
|
|
|
|
|
@ -1,18 +1,20 @@ |
|
|
|
import { history, useIntl } from '@umijs/max'; |
|
|
|
import { Button, Result } from 'antd'; |
|
|
|
import { Button, Card, Result } from 'antd'; |
|
|
|
import React from 'react'; |
|
|
|
|
|
|
|
const NoFoundPage: React.FC = () => ( |
|
|
|
<Result |
|
|
|
status="404" |
|
|
|
title="404" |
|
|
|
subTitle={useIntl().formatMessage({ id: 'pages.404.subTitle' })} |
|
|
|
extra={ |
|
|
|
<Button type="primary" onClick={() => history.push('/')}> |
|
|
|
{useIntl().formatMessage({ id: 'pages.404.buttonText' })} |
|
|
|
</Button> |
|
|
|
} |
|
|
|
/> |
|
|
|
<Card variant="borderless"> |
|
|
|
<Result |
|
|
|
status="404" |
|
|
|
title="404" |
|
|
|
subTitle={useIntl().formatMessage({ id: 'pages.404.subTitle' })} |
|
|
|
extra={ |
|
|
|
<Button type="primary" onClick={() => history.push('/')}> |
|
|
|
{useIntl().formatMessage({ id: 'pages.404.buttonText' })} |
|
|
|
</Button> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Card> |
|
|
|
); |
|
|
|
|
|
|
|
export default NoFoundPage; |
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { Column } from '@ant-design/plots'; |
|
|
|
import { Card, Col, DatePicker, Row, Tabs } from 'antd'; |
|
|
|
import { Button, Card, Col, DatePicker, Row, Tabs } from 'antd'; |
|
|
|
import type { RangePickerProps } from 'antd/es/date-picker'; |
|
|
|
import numeral from 'numeral'; |
|
|
|
import type { DataItem } from '../data.d'; |
|
|
|
@ -51,30 +51,34 @@ const SalesCard = ({ |
|
|
|
tabBarExtraContent={ |
|
|
|
<div className={styles.salesExtraWrap}> |
|
|
|
<div className={styles.salesExtra}> |
|
|
|
<a |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
className={isActive('today')} |
|
|
|
onClick={() => selectDate('today')} |
|
|
|
> |
|
|
|
今日 |
|
|
|
</a> |
|
|
|
<a |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
className={isActive('week')} |
|
|
|
onClick={() => selectDate('week')} |
|
|
|
> |
|
|
|
本周 |
|
|
|
</a> |
|
|
|
<a |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
className={isActive('month')} |
|
|
|
onClick={() => selectDate('month')} |
|
|
|
> |
|
|
|
本月 |
|
|
|
</a> |
|
|
|
<a |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
className={isActive('year')} |
|
|
|
onClick={() => selectDate('year')} |
|
|
|
> |
|
|
|
本年 |
|
|
|
</a> |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
<RangePicker |
|
|
|
value={rangePickerValue} |
|
|
|
|
|
|
|
@ -89,6 +89,7 @@ const useStyles = createStyles(({ token }) => { |
|
|
|
}, |
|
|
|
currentDate: { |
|
|
|
color: token.colorPrimary, |
|
|
|
fontWeight: 'bold', |
|
|
|
}, |
|
|
|
salesBar: { |
|
|
|
padding: '0 0 32px 32px', |
|
|
|
|
|
|
|
@ -1,15 +1,17 @@ |
|
|
|
import { Link } from '@umijs/max'; |
|
|
|
import { Button, Result } from 'antd'; |
|
|
|
import { Button, Card, Result } from 'antd'; |
|
|
|
|
|
|
|
export default () => ( |
|
|
|
<Result |
|
|
|
status="403" |
|
|
|
title="403" |
|
|
|
subTitle="Sorry, you are not authorized to access this page." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back to home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
<Card variant="borderless"> |
|
|
|
<Result |
|
|
|
status="403" |
|
|
|
title="403" |
|
|
|
subTitle="Sorry, you are not authorized to access this page." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back to home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Card> |
|
|
|
); |
|
|
|
|
|
|
|
@ -1,15 +1,17 @@ |
|
|
|
import { Link } from '@umijs/max'; |
|
|
|
import { Button, Result } from 'antd'; |
|
|
|
import { Button, Card, Result } from 'antd'; |
|
|
|
|
|
|
|
export default () => ( |
|
|
|
<Result |
|
|
|
status="404" |
|
|
|
title="404" |
|
|
|
subTitle="Sorry, the page you visited does not exist." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back Home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
<Card variant="borderless"> |
|
|
|
<Result |
|
|
|
status="404" |
|
|
|
title="404" |
|
|
|
subTitle="Sorry, the page you visited does not exist." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back Home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Card> |
|
|
|
); |
|
|
|
|
|
|
|
@ -1,15 +1,17 @@ |
|
|
|
import { Link } from '@umijs/max'; |
|
|
|
import { Button, Result } from 'antd'; |
|
|
|
import { Button, Card, Result } from 'antd'; |
|
|
|
|
|
|
|
export default () => ( |
|
|
|
<Result |
|
|
|
status="500" |
|
|
|
title="500" |
|
|
|
subTitle="Sorry, something went wrong." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back Home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
<Card variant="borderless"> |
|
|
|
<Result |
|
|
|
status="500" |
|
|
|
title="500" |
|
|
|
subTitle="Sorry, something went wrong." |
|
|
|
extra={ |
|
|
|
<Link to="/"> |
|
|
|
<Button type="primary">Back Home</Button> |
|
|
|
</Link> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Card> |
|
|
|
); |
|
|
|
|