中英文切换 初始化
This commit is contained in:
@@ -10,8 +10,10 @@ import * as echarts from 'echarts';
|
||||
|
||||
// 接口引入
|
||||
import { getAlarmStatistics } from '../../api/alarmApi.js';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const AlarmStatistics = () => {
|
||||
const { t } = useTranslation();
|
||||
const barChartRef = useRef(null);
|
||||
const pieChartRef = useRef(null);
|
||||
|
||||
@@ -77,7 +79,7 @@ const AlarmStatistics = () => {
|
||||
series: [{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
data: pieData.length ? pieData : [{ value: 1, name: '暂无数据' }],
|
||||
data: pieData.length ? pieData : [{ value: 1, name: t('common.noData') }],
|
||||
color: ['#F53F3F', '#FF7D00', '#F7BA1E', '#165DFF'],
|
||||
}]
|
||||
};
|
||||
@@ -97,7 +99,7 @@ const AlarmStatistics = () => {
|
||||
|
||||
return (
|
||||
<div style={{ padding: 24, background: '#f5f7fa', minHeight: '100vh' }}>
|
||||
<Card title="告警概览" bordered={false} style={{ marginBottom: 24, borderRadius: 8 }}>
|
||||
<Card title={t('alerts.alertOverview')} bordered={false} style={{ marginBottom: 24, borderRadius: 8 }}>
|
||||
<Row gutter={16} align="middle">
|
||||
<Col xs={24} sm={12} md={6}>
|
||||
<Space size={16}>
|
||||
@@ -105,7 +107,7 @@ const AlarmStatistics = () => {
|
||||
<BellOutlined style={{ fontSize: 24, color: '#F53F3F' }} />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>告警总数</div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>{t('report.totalAlerts')}</div>
|
||||
<div style={{ fontSize: 24, fontWeight: 700 }}>{statData.total || 0}</div>
|
||||
</div>
|
||||
</Space>
|
||||
@@ -129,7 +131,7 @@ const AlarmStatistics = () => {
|
||||
<ClockCircleOutlined style={{ fontSize: 24, color: '#FF7D00' }} />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>待处理</div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>{t('constants.pending')}</div>
|
||||
<div style={{ fontSize: 24, fontWeight: 700 }}>{statData.pending || 0}</div>
|
||||
</div>
|
||||
</Space>
|
||||
@@ -141,7 +143,7 @@ const AlarmStatistics = () => {
|
||||
<CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>已关闭</div>
|
||||
<div style={{ fontSize: 14, color: '#4E5969' }}>{t('constants.closed')}</div>
|
||||
<div style={{ fontSize: 24, fontWeight: 700 }}>{statData.closed || 0}</div>
|
||||
</div>
|
||||
</Space>
|
||||
|
||||
Reference in New Issue
Block a user