style: usage download button

This commit is contained in:
jialin
2025-06-17 16:17:26 +08:00
parent 0133524f09
commit 0805d70c07
5 changed files with 32 additions and 34 deletions
@@ -1,11 +1,23 @@
import CardWrapper from '@/components/card-wrapper';
import { SimpleCard } from '@/components/card-wrapper/simple-card';
import MixLineBar from '@/components/echarts/mix-line-bar';
import { ExportOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button } from 'antd';
import dayjs from 'dayjs';
import React from 'react';
import styled from 'styled-components';
import { baseColorMap } from '../../config';
const DownloadButton = styled(Button)`
position: absolute;
top: 10px;
right: 10px;
z-index: 10;
`;
interface RequestTokenInnerProps {
onExport?: () => void;
requestData: {
name: string;
color: string;
@@ -50,10 +62,19 @@ const legendData = [
];
const RequestTokenInner: React.FC<RequestTokenInnerProps> = (props) => {
const { requestData, tokenData, xAxisData } = props;
const { requestData, tokenData, xAxisData, onExport } = props;
const intl = useIntl();
return (
<CardWrapper style={{ width: '100%' }}>
<CardWrapper style={{ width: '100%', position: 'relative' }}>
<DownloadButton
type="text"
icon={<ExportOutlined />}
size="small"
onClick={onExport}
>
{intl.formatMessage({ id: 'common.button.export' })}
</DownloadButton>
<SimpleCard dataList={dataList} height={80}></SimpleCard>
<MixLineBar
chartData={{