|
|
@@ -1,4 +1,5 @@
|
|
|
import React from 'react';
|
|
|
+import { motion } from 'framer-motion';
|
|
|
import BarElement from './BarElement';
|
|
|
import DataLabel from './DataLabel';
|
|
|
|
|
|
@@ -27,19 +28,34 @@ const DebtRatioMetrics: React.FC<DebtRatioMetricsProps> = ({ data }) => {
|
|
|
) : 0;
|
|
|
|
|
|
return (
|
|
|
- <div className="h-full flex flex-col">
|
|
|
+ <motion.div
|
|
|
+ className="h-full flex flex-col"
|
|
|
+ initial={{ opacity: 0, scale: 0.95 }}
|
|
|
+ animate={{ opacity: 1, scale: 1 }}
|
|
|
+ transition={{ duration: 0.6, delay: 0.3 }}
|
|
|
+ >
|
|
|
{/* 模块标题 */}
|
|
|
- <div className="text-center mb-4">
|
|
|
+ <motion.div
|
|
|
+ className="text-center mb-4"
|
|
|
+ initial={{ opacity: 0, y: -20 }}
|
|
|
+ animate={{ opacity: 1, y: 0 }}
|
|
|
+ transition={{ duration: 0.5, delay: 0.4 }}
|
|
|
+ >
|
|
|
<h3 className="text-xl font-bold text-white">资产负债率(百分比)</h3>
|
|
|
<p className="text-sm text-white/70">资产负债率对比</p>
|
|
|
- </div>
|
|
|
+ </motion.div>
|
|
|
|
|
|
{/* 数据图表区域 */}
|
|
|
<div className="flex-1 flex items-end justify-center space-x-8">
|
|
|
{data ? (
|
|
|
<>
|
|
|
{/* 2023年数据 */}
|
|
|
- <div className="flex flex-col items-center">
|
|
|
+ <motion.div
|
|
|
+ className="flex flex-col items-center"
|
|
|
+ initial={{ opacity: 0, x: -30 }}
|
|
|
+ animate={{ opacity: 1, x: 0 }}
|
|
|
+ transition={{ duration: 0.5, delay: 0.5 }}
|
|
|
+ >
|
|
|
<BarElement
|
|
|
value={data2023?.assetLiabilityRatio || 0}
|
|
|
maxValue={maxValue}
|
|
|
@@ -52,10 +68,15 @@ const DebtRatioMetrics: React.FC<DebtRatioMetricsProps> = ({ data }) => {
|
|
|
unit="%"
|
|
|
className="mt-4"
|
|
|
/>
|
|
|
- </div>
|
|
|
+ </motion.div>
|
|
|
|
|
|
{/* 2024年数据 */}
|
|
|
- <div className="flex flex-col items-center">
|
|
|
+ <motion.div
|
|
|
+ className="flex flex-col items-center"
|
|
|
+ initial={{ opacity: 0, x: 30 }}
|
|
|
+ animate={{ opacity: 1, x: 0 }}
|
|
|
+ transition={{ duration: 0.5, delay: 0.7 }}
|
|
|
+ >
|
|
|
<BarElement
|
|
|
value={data2024?.assetLiabilityRatio || 0}
|
|
|
maxValue={maxValue}
|
|
|
@@ -68,17 +89,27 @@ const DebtRatioMetrics: React.FC<DebtRatioMetricsProps> = ({ data }) => {
|
|
|
unit="%"
|
|
|
className="mt-4"
|
|
|
/>
|
|
|
- </div>
|
|
|
+ </motion.div>
|
|
|
</>
|
|
|
) : (
|
|
|
- <div className="text-white/50 text-center">
|
|
|
+ <motion.div
|
|
|
+ className="text-white/50 text-center"
|
|
|
+ initial={{ opacity: 0 }}
|
|
|
+ animate={{ opacity: 1 }}
|
|
|
+ transition={{ duration: 0.5 }}
|
|
|
+ >
|
|
|
数据加载中...
|
|
|
- </div>
|
|
|
+ </motion.div>
|
|
|
)}
|
|
|
</div>
|
|
|
|
|
|
{/* 图例说明 */}
|
|
|
- <div className="flex justify-center space-x-6 mt-4 text-xs text-white/60">
|
|
|
+ <motion.div
|
|
|
+ className="flex justify-center space-x-6 mt-4 text-xs text-white/60"
|
|
|
+ initial={{ opacity: 0, y: 20 }}
|
|
|
+ animate={{ opacity: 1, y: 0 }}
|
|
|
+ transition={{ duration: 0.5, delay: 0.9 }}
|
|
|
+ >
|
|
|
<div className="flex items-center">
|
|
|
<div className="w-3 h-3 bg-blue-500 rounded mr-1" />
|
|
|
<span>2023年负债率</span>
|
|
|
@@ -87,8 +118,8 @@ const DebtRatioMetrics: React.FC<DebtRatioMetricsProps> = ({ data }) => {
|
|
|
<div className="w-3 h-3 bg-blue-700 rounded mr-1" />
|
|
|
<span>2024年负债率</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </motion.div>
|
|
|
+ </motion.div>
|
|
|
);
|
|
|
};
|
|
|
|