Files
MiragenFlow/admin/src/pages/Dashboard/Base/components/Overview.tsx
T
Qiufeng 84e9e7bff5
GitHub Pages / build (push) Canceled after 0s
GitHub Pages / deploy (push) Canceled after 0s
Docker image / meta (push) Successful in 24s
Docs Docker image / meta (push) Successful in 7s
Docker image / build (amd64, linux/amd64, ubuntu-latest) (push) Failing after 59s
Docs Docker image / build (amd64, linux/amd64, ubuntu-latest) (push) Failing after 30s
Docker image / merge (push) Canceled after 0s
Docs Docker image / merge (push) Canceled after 0s
Docker image / build (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Docs Docker image / build (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
release: v0.17.0
2026-08-19 22:09:49 +08:00

70 lines
2.3 KiB
TypeScript

import React, { useState } from 'react';
import { Button, Col, Row, Card } from 'tdesign-react';
import ReactEcharts from 'echarts-for-react';
import useDynamicChart from 'hooks/useDynamicChart';
import Board, { ETrend } from 'components/Board';
import LastWeekDatePicker from 'components/DatePicker';
import { getBarChartOptions } from '../chart';
import Style from './Overview.module.less';
const options = getBarChartOptions();
const Overview = (): React.ReactElement => {
const [customOptions, setCustomOptions] = useState(options);
const onTimeChange = (value: any) => {
// eslint-disable-next-line no-shadow
const options = getBarChartOptions(value);
setCustomOptions(options);
};
const dynamicChartOption = useDynamicChart(customOptions, {
placeholderColor: ['legend.textStyle.color', 'xAxis.axisLabel.color', 'yAxis.axisLabel.color'],
});
return (
<div className={Style.overviewPanel}>
<Row>
<Col xs={12} xl={9} span={12}>
<Card title=' 出入库概览 ' subtitle='(件)' actions={LastWeekDatePicker(onTimeChange)} bordered={false}>
<ReactEcharts
option={dynamicChartOption} // option:图表配置项
notMerge={true}
lazyUpdate={true}
style={{ height: 351 }}
/>
</Card>
</Col>
<Col xs={12} xl={3} span={12}>
<Card actions={<Button>导出数据</Button>} bordered={false}>
<Row>
<Col xl={12} xs={6} span={12}>
<Board
title='本月出库总计(件)'
count='1726'
trend={ETrend.down}
trendNum='20.3%'
desc='自从上周以来'
border={false}
style={{ height: '168px' }}
/>
</Col>
<Col xl={12} xs={6} span={12}>
<Board
title='活跃用户(个)'
count='1126'
trend={ETrend.down}
trendNum='20.5%'
desc='自从上周以来'
border={false}
style={{ height: '168px' }}
/>
</Col>
</Row>
</Card>
</Col>
</Row>
</div>
);
};
export default React.memo(Overview);